static void Main(string[] args) { //var prototype = new ForkliftPrototype //{ // Name = "Default", // ProductionYear = 2019, // Type = "Electric", // Size = new Size // { // Width = 500, // Height=1000 // } //}; //Console.WriteLine("Default"); //Console.WriteLine(prototype); //var nowazmienna = prototype.Clone(); //nowazmienna.Name = "LOL"; //nowazmienna.Type = "Jakis"; //Console.WriteLine(nowazmienna); //var Id = new IdNr.Instance(Id); var us = IdNr.Instance(); var student = new StudentPrototype { Id = 2, Name = "ImiÄ™", LastName = "Nazwisko" }; Console.WriteLine(student); Console.Read(); }
public static IdNr Instance() { if (instance == null) { instance = new IdNr(); } instance.Id++; return(instance); }