Exemple #1
0
 internal SerializedDataStorage()
 {
     try
     {
         _persons = SerializationManager.Deserialize <List <Person> >(FileFolderHelper.StorageFilePath);
     }
     catch (FileNotFoundException)
     {
         _persons = new List <Person>();
         for (int i = 0; i < 50; i++)
         {
             RandomDateTime random = new RandomDateTime();
             _persons.Add(new Person(random.GenRandomString(i), "Person_" + i, "user_" + i + "@gmail.com",
                                     random.GenRandomDateTime(new DateTime(1960 + i, i % 12 + 1, 1, 8, 30, 52), DateTime.Today)));
         }
         SaveChanges();
     }
 }