public async Task <ApiResult <List <DynamicForm> > > Get([FromQuery] int skip = 0, [FromQuery] int take = 100)
        {
            var findFluent = _repository.Find <DynamicForm>(CollectionName, new BsonDocument());
            var totalCount = (int)await findFluent.CountDocumentsAsync();

            HttpContext.AddPaginationHeaders(skip, take, totalCount);

            return(await findFluent
                   .Skip(skip)
                   .Limit(take)
                   .ToListAsync());
        }
示例#2
0
        public async Task <ApiResult <List <Course> > > GetCoursesByCertificationId([FromRoute] string id, [FromQuery] int skip = 0, [FromQuery] int take = 100)
        {
            var findFluent = _repository.Find <Course>(CourseController.CollectionName, c => c.CertificationId == id);

            var totalCount = (int)await findFluent.CountDocumentsAsync();

            HttpContext.AddPaginationHeaders(skip, take, totalCount);

            return(await findFluent
                   .Skip(skip)
                   .Limit(take)
                   .ToListAsync());
        }