コード例 #1
0
        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;
        }
コード例 #2
0
        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>());
        }
コード例 #3
0
        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>();
        }