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()); }
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()); }