Last active
April 28, 2017 09:41
-
-
Save DominicFinn/729706bc03fb90532c8517d280b0c166 to your computer and use it in GitHub Desktop.
Classes for my blog post on Object Creation.
This file contains 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
sealed class BadDojo | |
{ | |
public IList<Student> Students { get; set; } | |
public Sensei Sensei { get; set; } | |
public string Summary => $"this dojo is run by {Sensei.Name} and has {Students.Count} students"; | |
} |
This file contains 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var badDojo = new BadDojo() | |
{ | |
Sensei = new Sensei("Barney") | |
}; | |
Console.WriteLine(badDojo.Summary); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment