public SQLWarehouseRepository(DbContext dbContext) { _dbContext = (ParcelLogisticsContext)dbContext; _dbContext.Database.EnsureCreated(); /*if (_dbContext.Warehouses.Any()) return; * * var warehouses = new WarehouseDAO[] * { * new WarehouseDAO{Code="TEST",Description="My Warehouse", Duration=0.5m, Parent=null}, * * }; * foreach (WarehouseDAO w in warehouses) * { * _dbContext.Warehouses.Add(w); * } * _dbContext.SaveChanges();*/ }
public SQLTruckRepository(DbContext dbContext) { _dbContext = (ParcelLogisticsContext)dbContext; _dbContext.Database.EnsureCreated(); }