public Program() { ICommand _command = new Command(); ICheckCommand _checkCommand = new CheckCommand(_command); ISlot _slot = new Slot(); IParkingLotRepository _parkingRepository = new ParkingLotRepository(); ICheckParkingLotCreated checkParkingLotCreated = new CheckParkingLotCreated(_parkingRepository); ICommandExecutorSelector createParkingLot = new CreateParkingLot(_checkCommand, _slot, checkParkingLotCreated, _parkingRepository); IValidateVeicleDetails _validateVeicleDetails = new ValidateVeicleDetails(); IParkingVehicle _parkingVehicle = new ParkingVehicle(); IParkSuccessMessage _parkSuccessMessage = new ParkSuccessMessage(); ICommandExecutorSelector park = new Park(_checkCommand, _validateVeicleDetails, _parkingVehicle, _parkingRepository, _parkSuccessMessage); ISlotToEmpty _slotToEmpty = new SlotToEmpty(); IMaxSlotIndex _maxSlotIndex = new MaxSlotIndex(); IValidateSlotNumberToEmpty _validateSlotNumberToEmpty = new ValidateSlotNumberToEmpty(_parkingRepository, _maxSlotIndex); ILeaveSuccessMessage _leaveSuccessMessage = new LeaveSuccessMessage(); ICommandExecutorSelector leave = new Leave(_checkCommand, _slotToEmpty, _validateSlotNumberToEmpty, _parkingRepository, _leaveSuccessMessage); IStatusOutput _statusOutput = new StatusOutput(); ICommandExecutorSelector status = new Status(_parkingRepository, _statusOutput); IVehicleColor _vehicleColor = new VehicleColor(); IVehicleByColor _vehicleByColor = new VehicleByColor(); IVehicleByColorSuccessMessage _vehicleByColorSuccessMessage = new VehicleByColorSuccessMessage(); ICommandExecutorSelector regNoByColor = new RegistrationNumbersForCarsWithColour(_checkCommand, _vehicleColor, _parkingRepository, _vehicleByColor, _vehicleByColorSuccessMessage); ISlotByColor _slotByColor = new SlotByColor(); ISlotByColorMessage _slotByColorMessage = new SlotByColorMessage(); ICommandExecutorSelector slotNoByColor = new SlotNumbersForCarsWithColour(_checkCommand, _vehicleColor, _parkingRepository, _slotByColor, _slotByColorMessage); IVehicleRegistrationNumber _vehicleRegistrationNumber = new VehicleRegistrationNumber(); ISlotByRegistrationNumber _slotByRegistrationNumber = new SlotByRegistrationNumber(); ICommandExecutorSelector slotByRegistration = new SlotNumberForRegistrationNumber(_checkCommand, _vehicleRegistrationNumber, _parkingRepository, _slotByRegistrationNumber); ICommandExecutorSelector[] _selectors = { createParkingLot, park, leave, status, regNoByColor, slotNoByColor, slotByRegistration }; _provider = new CommandExecutorProvider(_selectors); }
public UnitOfWork(PbsDbContext context) { _context = context; AuthRepository = new AuthRepository(_context); UserRepository = new UserRepository(_context); AddressRepository = new AddressRepository(_context); ParkingLotRepository = new ParkingLotRepository(_context); SlotRepository = new SlotRepository(_context); SlotTypeRepository = new SlotTypeRepository(_context); RoleRepository = new RoleRepository(_context); HomeRepository = new HomeRepository(_context); BookingRepository = new BookingRepository(_context); }