コード例 #1
0
 private void InitializeConstructor()
 {
     _dbContext              = new ParkingDbContext();
     _subscriberRepository   = new efRepositoryBase <Subscriber>(_dbContext);
     _subscriptionRepository = new efRepositoryBase <Subscription>(_dbContext);
     _recipeRepository       = new efRepositoryBase <Recipe>(_dbContext);
 }
コード例 #2
0
 private void InitializeConstructor()
 {
     _dbContext            = new ParkingDbContext();
     _subscriberRepository = new efRepositoryBase <Subscriber>(_dbContext);
     _cityRepository       = new efRepositoryBase <City>(_dbContext);
     _districtRepository   = new efRepositoryBase <District>(_dbContext);
 }
コード例 #3
0
        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();
        }
コード例 #4
0
        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();
        }
コード例 #5
0
 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();
 }
コード例 #6
0
 public OwnersController(ParkingDbContext context)
 {
     _context = context;
 }
 public ContactRepository(ParkingDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #8
0
ファイル: CarsController.cs プロジェクト: 0000duck/Parking
 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();
     }
 }
コード例 #9
0
 public ParkingRepository(ParkingDbContext parkingDbContext) => _context = parkingDbContext;
コード例 #10
0
 private void InitializeConstructors()
 {
     _dbContext        = new ParkingDbContext();
     _recipeRepository = new efRepositoryBase <Recipe>(_dbContext);
 }
コード例 #11
0
ファイル: Repository.cs プロジェクト: Radek12345/ParkingApp
 public Repository(ParkingDbContext context)
 {
     this.context = context;
 }
コード例 #12
0
 public GaragesController(ParkingDbContext context)
 {
     _context = context;
 }