Exemplo n.º 1
0
 public static void Initialize(MobileContext context)
 {
     if (!context.Phones.Any())
     {
         context.Phones.AddRange(
             new Phone
         {
             Name    = "iPhone X",
             Company = "Apple",
             Price   = 600
         },
             new Phone
         {
             Name    = "Samsung Galaxy Edge",
             Company = "Samsung",
             Price   = 550
         },
             new Phone
         {
             Name    = "Pixel 3",
             Company = "Google",
             Price   = 500
         }
             );
         context.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public DBController(MobileContext db)
 {
     _db = db;
 }