示例#1
0
 public ShowsService(IMongoDbClientFactory clientFactory, IOptions <MongoDbOptions> mongoDbOptions,
                     ILogger <ShowsService> logger)
 {
     _client         = clientFactory.GetMongoDbClient();
     _mongoDbOptions = mongoDbOptions.Value;
     _logger         = logger;
 }
示例#2
0
        public DatabaseFactory(IOptions <DatabaseFactoryOptions> options, IMongoDbClientFactory clientFactory, ILogger <DatabaseFactory> logger)
        {
            _options = options.Value ?? throw new ArgumentNullException(nameof(options));
            _        = clientFactory ?? throw new ArgumentNullException(nameof(clientFactory));
            _logger  = logger ?? throw new ArgumentNullException(nameof(logger));

            _client = clientFactory.Create();
        }
        public MongoDbClientFactory(IMongoDbClientFactory <DefaultConnection> decoree)
        {
            if (decoree == null)
            {
                throw new ArgumentNullException(nameof(decoree));
            }

            _decoree = decoree;
        }
示例#4
0
 public LogRotatorStep(IMongoDbClientFactory <TConnection> db, ILogRotatorCommand logRotator)
 {
     _db         = db;
     _logRotator = logRotator;
 }
示例#5
0
 public PingMongoDbStep(IMongoDbClientFactory <TConnection> clientFactory, IPingCommand ping)
 {
     _ping          = ping;
     _clientFactory = clientFactory;
 }