コード例 #1
0
        public StudentService(ISchoolsDatabaseSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _students = database.GetCollection <Student>(settings.StudentsCollectionName);
        }
コード例 #2
0
        public CourseService(ISchoolsDatabaseSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _courses = database.GetCollection <Course>(settings.CoursesCollectionName);
        }