private void InitializeConstructor() { _dbContext = new ParkingDbContext(); _subscriberRepository = new efRepositoryBase <Subscriber>(_dbContext); _subscriptionRepository = new efRepositoryBase <Subscription>(_dbContext); _recipeRepository = new efRepositoryBase <Recipe>(_dbContext); }
private void InitializeConstructor() { _dbContext = new ParkingDbContext(); _subscriberRepository = new efRepositoryBase <Subscriber>(_dbContext); _cityRepository = new efRepositoryBase <City>(_dbContext); _districtRepository = new efRepositoryBase <District>(_dbContext); }
public void Setup() { var optionsBuilder = new DbContextOptionsBuilder <ParkingDbContext>().UseInMemoryDatabase("integrationTestDB"); contexto = new ParkingDbContext(optionsBuilder.Options); _placaRepository = new Repository <PlacaEntity>(contexto); _picoPlacarepository = new Repository <PicoPlacaDigits>(contexto); placaService = new PlacaService(_placaRepository, _picoPlacarepository); contexto.Database.EnsureCreated(); }
public void Setup() { var optionsBuilder = new DbContextOptionsBuilder <ParkingDbContext>().UseInMemoryDatabase("integrationTestDB"); contexto = new ParkingDbContext(optionsBuilder.Options); entryRepository = new Repository <EntryEntity>(contexto); cellRepository = new Repository <CellEntity>(contexto); departureRepository = new Repository <DepartureEntity>(contexto); rateRepository = new Repository <RateEntity>(contexto); placaRepository = new Repository <PlacaEntity>(contexto); picoPlacarepository = new Repository <PicoPlacaDigits>(contexto); cellService = new CellService(cellRepository); rateService = new RateService(rateRepository); placaService = new PlacaService(placaRepository, picoPlacarepository); departureService = new DepartureService(departureRepository, entryRepository, rateService, cellService); contexto.Database.EnsureCreated(); }
public DatosController(TempDbContext context, ParkingDbContext parkingDbContext) { _context = context; _parkingDbContext = parkingDbContext; if (_parkingDbContext.Places.Any()) { return; } for (int i = 0; i < 32; i++) { floors[i] = new Place { PlaceId = i + 1, PlaceNumber = i + 1, State = false }; } foreach (var item in floors) { _parkingDbContext.Places.Add(item); } _parkingDbContext.SaveChangesAsync(); }
public OwnersController(ParkingDbContext context) { _context = context; }
public ContactRepository(ParkingDbContext dbContext) { _dbContext = dbContext; }
public CarsController(ParkingDbContext context) { _context = context; if (!_context.Cars.Any()) { _context.Cars.Add(new Car { FloorID = 1, PlaceID = 1, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 1, PlaceID = 2, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 1, PlaceID = 3, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 1, PlaceID = 4, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 1, PlaceID = 5, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 1, PlaceID = 6, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 1, PlaceID = 7, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 1, PlaceID = 8, LicensePlate = "N/A", Owner = "N/A" }); //Piso2 _context.Cars.Add(new Car { FloorID = 2, PlaceID = 1, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 2, PlaceID = 2, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 2, PlaceID = 3, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 2, PlaceID = 4, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 2, PlaceID = 5, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 2, PlaceID = 6, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 2, PlaceID = 7, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 2, PlaceID = 8, LicensePlate = "N/A", Owner = "N/A" }); //Piso3 _context.Cars.Add(new Car { FloorID = 3, PlaceID = 1, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 3, PlaceID = 3, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 3, PlaceID = 4, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 3, PlaceID = 5, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 3, PlaceID = 6, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 3, PlaceID = 7, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 3, PlaceID = 7, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 3, PlaceID = 8, LicensePlate = "N/A", Owner = "N/A" }); //Piso4 _context.Cars.Add(new Car { FloorID = 4, PlaceID = 1, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 4, PlaceID = 3, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 4, PlaceID = 4, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 4, PlaceID = 5, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 4, PlaceID = 6, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 4, PlaceID = 7, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 4, PlaceID = 7, LicensePlate = "N/A", Owner = "N/A" }); _context.Cars.Add(new Car { FloorID = 4, PlaceID = 8, LicensePlate = "N/A", Owner = "N/A" }); _context.SaveChangesAsync(); } }
public ParkingRepository(ParkingDbContext parkingDbContext) => _context = parkingDbContext;
private void InitializeConstructors() { _dbContext = new ParkingDbContext(); _recipeRepository = new efRepositoryBase <Recipe>(_dbContext); }
public Repository(ParkingDbContext context) { this.context = context; }
public GaragesController(ParkingDbContext context) { _context = context; }