예제 #1
0
        public ListService(IToDoDatabaseSettings settings)
        {
            var client = new MongoClient(settings.ConnectionString);
            var db     = client.GetDatabase(settings.DatabaseName);

            lists = db.GetCollection <ToDoList>(settings.ListCollectionName);
        }
예제 #2
0
        public ToDoService(IToDoDatabaseSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _items = database.GetCollection <ToDoItem>(settings.ToDoCollectionsName);
        }
예제 #3
0
        public JobService(IToDoDatabaseSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _jobs = database.GetCollection <Job>(settings.JobsCollectionName);
        }
예제 #4
0
        public ToDoService(IToDoDatabaseSettings settings, ILogger <ToDoService> logger)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _toDoTasks = database.GetCollection <ToDoTask>(settings.CollectionName);
            _logger    = logger;
        }