Skip to content

Instantly share code, notes, and snippets.

@DominicFinn
Last active April 28, 2017 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominicFinn/729706bc03fb90532c8517d280b0c166 to your computer and use it in GitHub Desktop.
Save DominicFinn/729706bc03fb90532c8517d280b0c166 to your computer and use it in GitHub Desktop.
Classes for my blog post on Object Creation.
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";
}
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