public BlogPostService(IBlogPostsDatabaseSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _blogPosts = database.GetCollection <BlogPost>(settings.BlogPostsCollectionName);
        }
Beispiel #2
0
        public AdminController(IBlogPostsDatabaseSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _posts = database.GetCollection <Post>(settings.BlogPostsCollectionName);
        }