Last active
January 22, 2018 15:56
-
-
Save kid/eb2e972639c6232fb2110c912e3a44b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IStringParameter { | |
public int Id { get; } | |
public string Key { get; } | |
} | |
public abstract class StringParameter : IStringParameter | |
{ | |
public abstract int Id { get; } | |
public abstract string Key { get; } | |
public abstract string Description { get; } | |
public abstract bool Nullable { get; } | |
} | |
public class X : StringParameter { | |
public int Id { get { return 42; } } | |
[...] | |
} | |
// C# 6 and beyond: | |
public class Y : StringParameter { | |
public int Id => 42; | |
public string Key => "Foobar"; | |
[...] | |
} | |
public class Z : StringParameter { | |
public int Id { get; } | |
public string Key { get; } | |
public Z() { | |
Id = 42; | |
Key = "Foobar"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment