示例#1
0
 public IList <PaintingDto> FindAll(PaintingFilterDto paintingFilterDto)
 {
     return(_modelContext.Set <Painting>()
            .Where(ExpressionBuilder.BuildWhere <Painting>(paintingFilterDto))
            .OrderBy(x => x.Title)
            .Select(x => new PaintingDto()
     {
         Id = x.Id,
         Title = x.Title,
         CoverPhotoResourceDto = x.Galleries.Where(y => (y is ProfileGallery)).Select(y => new PhotoResourceDto()
         {
             Id = y.CoverPhoto.Id, Path = y.CoverPhoto.Path, Name = y.CoverPhoto.Name
         }).FirstOrDefault()
     })
            .ToList());
 }
示例#2
0
 public IPagedList <PaintingDto> FindPaged(PaintingFilterDto paintingFilterDto)
 {
     return(_modelContext.Set <Painting>()
            .Where(ExpressionBuilder.BuildWhere <Painting>(paintingFilterDto))
            .OrderBy(x => x.Title)
            .Select(x => new PaintingDto()
     {
         Id = x.Id,
         Title = x.Title,
         Technique = x.Technique,
         Surface = x.Surface,
         Width = x.Width,
         Height = x.Height,
         CoverPhotoResourceDto = x.Galleries.Where(y => (y is ProfileGallery)).Select(y => new PhotoResourceDto()
         {
             Id = y.CoverPhoto.Id, Path = y.CoverPhoto.Path, Name = y.CoverPhoto.Name
         }).FirstOrDefault()
     })
            .ToPagedList(paintingFilterDto.Page, paintingFilterDto.PageSize));
 }
示例#3
0
 public ActionResult List(PaintingFilterDto paintingFilterDto)
 {
     return(PartialView(GetService().ReadAdministrationAll(paintingFilterDto)));
 }
示例#4
0
 public ActionResult PagedList(PaintingFilterDto paintingFilterDto)
 {
     ViewBag.FilterDto = paintingFilterDto;
     return(PartialView(WebConstants.VIEW_PAGED_LIST, GetService().ReadAdministrationPaged(paintingFilterDto)));
 }
 public IList <PaintingDto> ReadAdministrationAll(PaintingFilterDto paintingFilterDto)
 {
     return(_paintingDao.FindAll(paintingFilterDto));
 }
 public IPagedList <PaintingDto> ReadAdministrationPaged(PaintingFilterDto paintingFilterDto)
 {
     return(_paintingDao.FindPaged(paintingFilterDto));
 }