Exemplo n.º 1
0
        public IActionResult Get([FromQuery] BlogFilterDto filter)
        {
            var db = new BlogDummyData();

            var list = db.Blogs.ApplyFilter(filter);

            return(Ok(list));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Finds paged blogs.
 /// </summary>
 /// <param name="blogFilterDto">The filtering DTO</param>
 /// <returns>The Blog DTO page</returns>
 internal IPagedList <BlogDto> FindPaged(BlogFilterDto blogFilterDto)
 {
     return(_modelContext.Set <Blog>()
            .OrderBy(x => x.Name)
            .Select(x => new BlogDto()
     {
         Id = x.Id, CreatedDate = x.CreatedDate, Name = x.Name
     })
            .ToPagedList(blogFilterDto.Page, blogFilterDto.PageSize));
 }
        public IActionResult Get([FromQuery] BlogFilterDto filter)
        {
            var db = new BlogDummyData();

            var query = db.Blogs.OrderByDescending(o => o.PublishDate);

            var list = filter.ApplyFilterTo(query).ToList();

            return(Ok(list));
        }
Exemplo n.º 4
0
 public IPagedList <BlogDto> ReadAdministrationPaged(BlogFilterDto blogFilterDto)
 {
     return(_blogDao.FindPaged(blogFilterDto));
 }
Exemplo n.º 5
0
 public ActionResult PagedList(BlogFilterDto blogFilterDto)
 {
     ViewBag.FilterDto = blogFilterDto;
     return(PartialView(WebConstants.VIEW_PAGED_LIST, GetService().ReadAdministrationPaged(blogFilterDto)));
 }