public static void RegisterAllServices(this IServiceStore store) { store.RegisterSingleton<ILogger>(new DiagnosticLogger()); store.RegisterSingleton(CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["RedMonitoreo:AzureStorage"].ConnectionString)); store.RegisterSingleton<IStationSensorStatePersister>(c=> new StationSensorStatePersister(c.GetInstance<CloudStorageAccount>())); store.RegisterSingleton<IEnqueuer<StationSensorHourlyStateChanged>>(c=> new MessageEnqueuer<StationSensorHourlyStateChanged>(c.GetInstance<CloudStorageAccount>())); }
public GenericRepositoryFactory() { var simple = new SimpleServiceContainer(); _container = simple; _serviceStore = simple; }
public static void RegisterApplicationViewModels(this IServiceStore store, IServiceContainer container) { var appViewmodelsExposer = new MainViewModelExposer(); appViewmodelsExposer.UseViewModelsFactory(t => container.GetInstance(t) as ViewModelBase); // <== si no está registrado directamente usa el IoC para obtener una instancia del viewmodel store.RegisterSingleton <IViewModelExposer>(appViewmodelsExposer); RegisterViewModels(store); RegisterReports(store); }
private static void RegisterViewModels(IServiceStore store) { // Cuando se pida de exponer EnvioDocumentosAFilialViewModel se termina ejecutando este metodo //store.RegisterTransient(c => new MarcaViewModel( // c.GetInstance<IViewModelExposer>() // , c.GetInstance<IMarcaRepository>() // , c.GetInstance<IModeloRepository>())); //store.RegisterTransient(c => new MarcaViewModel()); store.RegisterTransient(c => new MarcaViewModel(c.GetInstance <IMarcaRepository>())); store.RegisterTransient(c => new ModeloViewModel()); }
public void ConstructorShouldThrowArgumentExceptionWhenNullParameterGiven( IServiceChecker serviceChecker, IServiceStore serviceStore, IOptions <BackgroundCheckerConfiguration> configuration, INotificationService notificationService, ILogger <BackgroundChecker> logger) { Assert.Throws <ArgumentNullException>(() => new BackgroundChecker(serviceChecker, serviceStore, configuration, notificationService, logger)); }
public GenericRepositoryFactory(IServiceContainer container, IServiceStore serviceStore) { if (container == null) { throw new ArgumentNullException(nameof(container)); } if (serviceStore == null) { throw new ArgumentNullException(nameof(serviceStore)); } this._container = container; this._serviceStore = serviceStore; }
private static void RegisterAllControllers(IServiceStore store) { store.RegisterTransient( c => new OtfsController(c.GetInstance <IStationFileStore>(), c.GetInstance <IEnqueuer <StationFileToProcess> >())); store.RegisterTransient(c => new StationsController(c.GetInstance <IStationsSensorsYearActivityPersister>())); store.RegisterTransient(c => new SensorsController( c.GetInstance <IStationsSensorsYearActivityPersister>() , c.GetInstance <IStationSensorDailyStatePersister>() , c.GetInstance <IStationSensorHourlyStatePersister>() , c.GetInstance <IStationSensorStatePersister>() , c.GetInstance <IStationSensorStateDeleter>() , c.GetInstance <IEnqueuer <StationSensorHourlyStateChanged> >(), c.GetInstance <IStationSensorStateAdder>() )); }
public StoreWrapper( IServiceStore serviceStore, IExtraStore extraStore, IManufacturerStore manufacturerStore, ISlipwayStore slipwayStore, IWaterStore waterStore, IPortStore portStore) { Services = serviceStore; Extras = extraStore; Manufacturers = manufacturerStore; Slipways = slipwayStore; Waters = waterStore; Ports = portStore; }
public BackgroundChecker(IServiceChecker serviceChecker, IServiceStore serviceStore, IOptions <BackgroundCheckerConfiguration> configuration, INotificationService notificationService, ILogger <BackgroundChecker> logger) { Guard.Against.Null(serviceChecker, nameof(serviceChecker)); Guard.Against.Null(serviceStore, nameof(serviceStore)); Guard.Against.Null(configuration, nameof(configuration)); Guard.Against.Null(notificationService, nameof(notificationService)); Guard.Against.Null(logger, nameof(logger)); _serviceChecker = serviceChecker; _serviceStore = serviceStore; _configuration = configuration.Value; _notificationService = notificationService; _logger = logger; }
public static void RegisterAllServices(this IServiceStore store) { store.RegisterSingleton <ILogger>(container => new DiagnosticLogger()); store.RegisterSingleton(CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["RedMonitoreo:AzureStorage"].ConnectionString)); store.RegisterSingleton <IStationFileStore>(c => new BlobStationFileStore(c.GetInstance <CloudStorageAccount>())); store.RegisterSingleton <IEnqueuer <StationFileToProcess> >(c => new ServiceBusEnqueuer <StationFileToProcess>( ConfigurationManager.ConnectionStrings["RedMonitoreo:ServiceBus:FilesToProcess"].ConnectionString , c.GetInstance <ILogger>())); store.RegisterSingleton <IEnqueuer <StationSensorHourlyStateChanged> >(c => new MessageEnqueuer <StationSensorHourlyStateChanged>(c.GetInstance <CloudStorageAccount>())); store.RegisterSingleton <IStationsSensorsYearActivityPersister>(c => new StationsSensorsYearActivityPersister(c.GetInstance <CloudStorageAccount>())); store.RegisterSingleton <IStationSensorDailyStatePersister>(c => new StationSensorDailyStatePersister(c.GetInstance <CloudStorageAccount>())); store.RegisterSingleton <IStationSensorHourlyStatePersister>(c => new StationSensorHourlyStatePersister(c.GetInstance <CloudStorageAccount>())); store.RegisterSingleton <IStationSensorStatePersister>(c => new StationSensorStatePersister(c.GetInstance <CloudStorageAccount>())); store.RegisterSingleton <IStationSensorStateDeleter>(c => new StationSensorStateDeleter(c.GetInstance <CloudStorageAccount>())); store.RegisterSingleton <IStationSensorStateAdder>(c => new StationSensorStateAdder(c.GetInstance <CloudStorageAccount>())); RegisterAllControllers(store); }
public static void RegisterJobs(this IServiceStore store) { store.RegisterTransient(c => new StationFileToProcessConsumer( c.GetInstance <IStationFileStore>() , c.GetInstance <IStationSensorStatePersister>() , c.GetInstance <IEnqueuer <StationSensorHourlyStateChanged> >() , c.GetInstance <ILogger>() )); store.RegisterTransient(c => new StationSensorHourlyStateChangedConsumer( c.GetInstance <IStationSensorStatePersister>() , c.GetInstance <IStationSensorHourlyStatePersister>() , c.GetInstance <IEnqueuer <StationSensorDayStateChanged> >() , c.GetInstance <ILogger>() )); store.RegisterTransient(c => new StationSensorDayStateChangedConsumer( c.GetInstance <IStationSensorHourlyStatePersister>() , c.GetInstance <IStationSensorDailyStatePersister>() , c.GetInstance <IStationsSensorsYearActivityPersister>() , c.GetInstance <ILogger>() )); }
public void Setup() { var builder = new WebHostBuilder() .ConfigureServices((_, services) => { services.AddServiceRegistry(options => { options.SelfRegistration.SelfRegister = true; options.SelfRegistration.ServiceId = "TestSelfService"; options.SelfRegistration.DisplayName = "My Test"; options.SelfRegistration.Endpoints = new[] { new Uri("http://selfservice.com") }; }).AddInMemoryStore(); services.AddDataProtection().PersistKeysToInMemory(); }) .Configure(app => { app.UseServiceRegistry(); _serviceStore = app.ApplicationServices.GetRequiredService <IServiceStore>(); }); _testServer = new TestServer(builder); _client = _testServer.CreateClient(); }
private static void RegisterReports(IServiceStore store) { store.RegisterTransient(c => new MarcaReportViewModel(c.GetInstance <IReportsProvider>())); }
public static void RegisterJobs(this IServiceStore store) { store.RegisterTransient(c=> new StreamSensorAverageConsumer( c.GetInstance<IStationSensorStatePersister>() , c.GetInstance<IEnqueuer<StationSensorHourlyStateChanged>>())); }
public ServiceController(IServiceStore serviceStore, IServiceChecker serviceChecker) { _serviceStore = serviceStore; _serviceChecker = serviceChecker; }
public ServiceController(ILogger <ServiceController> logger, IServiceStore serviceStore) { _logger = logger; _serviceStore = serviceStore; }
public ServiceRegistry(IServiceStore store, IRegistrationTokenProvider tokenProvider) { _store = store ?? throw new ArgumentNullException(nameof(store)); _tokenProvider = tokenProvider ?? throw new ArgumentNullException(nameof(tokenProvider)); }
public HomeController(IServiceStore serviceStore) { _serviceStore = serviceStore ?? throw new ArgumentNullException(nameof(serviceStore)); }
public ServiceManager(IUnitOfWork unitOfWork, IServiceStore serviceStore) { _unitOfWork = unitOfWork; _serviceStore = serviceStore; }
/// <summary> /// Initializes a new instance of the <see cref="CachingServiceStore{T}"/> class. /// </summary> /// <param name="inner">The inner store.</param> /// <param name="cache">The cache instance.</param> /// <param name="options">The options.</param> public CachingServiceStore(T inner, ICache <Service> cache, ServiceRegistryOptions options) { _inner = inner ?? throw new ArgumentNullException(nameof(inner)); _cache = cache ?? throw new ArgumentNullException(nameof(cache)); _options = options ?? throw new ArgumentNullException(nameof(options)); }