public RideControl(ILogger <RideControl> logger, IEventProducer eventProducer, IVisitorClient visitorClient, ILocationService locationService) { rideRepo = new LocationRepository <Ride>(locationService, new LocationConverter <Ride>((x) => new Ride(x))); this.logger = logger; this.eventProducer = eventProducer; this.visitorClient = visitorClient; locationService.CalculateLocationDistances(rideRepo.All()); }
/// <summary> /// Initializes a new instance of the <see cref="VisitorClientRepository"/> class. /// </summary> /// <param name="applicationSettings">The application setting.</param> public VisitorClientRepository(IApplicationSetting applicationSettings) { if (applicationSettings != null) { this.visitorClient = DIContainer.Instance.Resolve<IVisitorClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.VisitorServiceBaseAddress) }); this.uploadUrlClient = DIContainer.Instance.Resolve<IUploadUrlClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.VisitorServiceBaseAddress) }); this.visitorAccessCardClient = DIContainer.Instance.Resolve<IVisitorAccessCardsClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.VisitorServiceBaseAddress) }); this.departmentClient = DIContainer.Instance.Resolve<IDepartmentClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.VisitorServiceBaseAddress) }); this.visitPurposeClient = DIContainer.Instance.Resolve<IVisitPurposeClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.VisitorServiceBaseAddress) }); this.visitTypesClient = DIContainer.Instance.Resolve<IVisitTypesClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.VisitorServiceBaseAddress) }); } }