Exemplo n.º 1
0
        public ArticleService(IMongoClient client, INewsStoreDatabaseSettings settings, TagService tagService, AuthorService authorService)
        {
            _tagService    = tagService;
            _authorService = authorService;

            var database = client.GetDatabase(settings.DatabaseName);

            _articles = database.GetCollection <Article>(settings.ArticleCollectionName);
        }
Exemplo n.º 2
0
        public TagService(IMongoClient client, INewsStoreDatabaseSettings settings)
        {
            var database = client.GetDatabase(settings.DatabaseName);

            _tags = database.GetCollection <Tag>(settings.TagCollectionName);
        }
 public ConfigureMongodbService(IMongoClient client, ILogger <ConfigureMongodbService> logger, INewsStoreDatabaseSettings settings)
 => (_client, _logger, _settings) = (client, logger, settings);
Exemplo n.º 4
0
        public AuthorService(IMongoClient client, INewsStoreDatabaseSettings settings)
        {
            var database = client.GetDatabase(settings.DatabaseName);

            _authors = database.GetCollection <Author>(settings.AuthorCollectionName);
        }