Example #1
0
 public VehicleDriverService(
     IVehicleDriverRepository vehicleDriverRepository,
     IVehicleService vehicleService,
     IDriverService driverService)
 {
     this.vehicleDriverRepository = vehicleDriverRepository;
     this.vehicleService          = vehicleService;
     this.driverService           = driverService;
 }
Example #2
0
        /// <summary>
        ///  Create a new instance of DgtAppService
        /// </summary>
        public DgtAppService(
            IBrandRepository brandRepository,
            IInfractionTypeRepository infractionTypeRepository,
            IDriverRepository driverRepository,
            IVehicleRepository vehicleRepository,
            IInfractionRepository infractionRepository,
            IVehicleDriverRepository vehicleDriverRepository)
        {
            //Check dependencies
            if (brandRepository == null)
            {
                throw new ArgumentNullException("brandRepository");
            }

            if (infractionTypeRepository == null)
            {
                throw new ArgumentNullException("infractionTypeRepository");
            }

            if (driverRepository == null)
            {
                throw new ArgumentNullException("driverRepository");
            }

            if (vehicleRepository == null)
            {
                throw new ArgumentNullException("vehicleRepository");
            }

            if (infractionRepository == null)
            {
                throw new ArgumentNullException("infractionRepository");
            }

            if (vehicleDriverRepository == null)
            {
                throw new ArgumentNullException("vehicleDriverRepository");
            }

            // Assign dependencies
            _brandRepository          = brandRepository;
            _infractionTypeRepository = infractionTypeRepository;
            _driverRepository         = driverRepository;
            _vehicleRepository        = vehicleRepository;
            _infractionRepository     = infractionRepository;
            _vehicleDriverRepository  = vehicleDriverRepository;
        }