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();*/
        }
示例#2
0
 public SQLTruckRepository(DbContext dbContext)
 {
     _dbContext = (ParcelLogisticsContext)dbContext;
     _dbContext.Database.EnsureCreated();
 }