public static MyfabClass GiveMeInstance() { if (myclassinstance == null) { myclassinstance = new MyfabClass(); myclassinstance.identifier = Guid.NewGuid().ToString(); } return(myclassinstance); }
static void Main(string[] args) { MyfabClass class1 = MyfabClass.GiveMeInstance(); MyfabClass class2 = MyfabClass.GiveMeInstance(); Console.WriteLine(class1.identifier); Console.WriteLine(class2.identifier); Console.ReadLine(); }