Beispiel #1
0
 public void Insert()
 {
     Db.Users.Add(User1);
     Db.Users.Add(User2);
     Db.Products.Add(Prod1);
     Db.Products.Add(Prod2);
     Db.Products.Add(Prod3);
     Db.Reports.Add(Report1);
     Db.Comments.Add(Comment1);
     Db.SaveChanges();
 }
Beispiel #2
0
 public static void InitializeBugTracking(string connStr, string adminPwd)
 {
     using (var db = new BugReportContext())
     {
         db.Database.Delete();
         db.Database.Create();
         var user = new Utente()
         {
             Name = "Admin", CodFisc = "CF", Age = 12, Dob = DateTime.Today, LogIn = adminPwd, Surname = "admin", Indirizzo = new Address()
             {
                 Civico = 0, Interno = 0, Via = ""
             }
         };
         db.Users.Add(user);
         db.SaveChanges();
     }
 }