static void Main(string[] args) { // ken is the prototype, except a few things, the properties won't change much in clones. // https://en.wikipedia.org/wiki/Prototype_pattern var ken = new Prototype { Name = "Ken", Age = 27 }; var barry = (Prototype) ken.Clone(); barry.Name = "Barry"; }
static void Report(string s, Prototype a, Prototype b) { Console.WriteLine("\n{0}\nPrototype {1}\nClone {2}", s, a, b); }
static string GetDetails(Prototype p) { return($"ID: {p.ID} hashcode: {p.GetHashCode()}"); }