Esempio n. 1
0
 private void SeedData()
 {
     _vehicleDbContext.RemoveRange(_vehicleDbContext.Cars);
     _vehicleDbContext.AddRange(
         new Car
     {
         Make        = "nissan",
         Model       = "x-trail",
         Engine      = "2-cylinder",
         Doors       = 4,
         Wheels      = 4,
         VehicleType = VehicleType.Car,
         BodyType    = BodyType.SUV
     },
         new Car
     {
         Make        = "nissan",
         Model       = "x-trail Ti",
         Engine      = "4-cylinder",
         Doors       = 4,
         Wheels      = 4,
         VehicleType = VehicleType.Car,
         BodyType    = BodyType.SUV
     }
         );
     _vehicleDbContext.SaveChanges();
 }