public RepositoryContainer(ICosmosWatcherOption watcherOption, CosmosClient cosmosClient, ILoggerFactory loggerFactory, ILogger <RepositoryContainer> logger) { watcherOption.VerifyNotNull(nameof(watcherOption)).Verify(); cosmosClient.VerifyNotNull(nameof(cosmosClient)); loggerFactory.VerifyNotNull(nameof(loggerFactory)); logger.VerifyNotNull(nameof(logger)); _watcherOption = watcherOption; _cosmosClient = cosmosClient; _loggerFactory = loggerFactory; _logger = logger; }
public CosmosWatcherRepository(ICosmosWatcherOption watcherOption, ILoggerFactory loggerFactory) { watcherOption.VerifyNotNull(nameof(watcherOption)).Verify(); loggerFactory.VerifyNotNull(nameof(loggerFactory)); _watcherOption = watcherOption; _logger = loggerFactory.CreateLogger <CosmosWatcherRepository>(); _cosmosClient = new CosmosClient(watcherOption.GetResolvedConnectionString()); Database = new RepositoryDatabase(_cosmosClient, loggerFactory.CreateLogger <RepositoryDatabase>()); Container = new RepositoryContainer(watcherOption, _cosmosClient, loggerFactory, loggerFactory.CreateLogger <RepositoryContainer>()); }
public AgentController(ICosmosWatcherOption option, IWatcherRepository watcherRepository, ILogger <AgentController> logger) { option.VerifyNotNull(nameof(option)); watcherRepository.VerifyNotNull(nameof(watcherRepository)); logger.VerifyNotNull(nameof(logger)); _option = option; _watcherRepository = watcherRepository; _logger = logger; _agentContainer = _watcherRepository.Container.Get <AgentRecord>(); _targetContainer = _watcherRepository.Container.Get <TargetRecord>(); }