Exemplo n.º 1
0
 public static void Initialize(EventProjectDbContext c)
 {
     c.Database.EnsureCreated(); //kas andmebaas on olemas
     if (c.Events.Any())
     {
         return;                 //kui aadresside tabelis midagi, lõpetab tegevuse
     }
     c.SaveChanges();
 }
Exemplo n.º 2
0
 public override void TestInitialize()
 {
     base.TestInitialize();
     type = typeof(EventObjectsRepository);
     Assert.AreEqual(0, db.Events.Count());
     for (var i = 0; i < count; i++)
     {
         db.Events.Add(GetRandom.Object <EventDbRecord>());
         db.SaveChanges();
     }
 }