public Result List(SeoPageAdminFilterDto dto) { var result = _actionFactory.Action(dto.Action)?.Apply(dto.Ids) ?? new Result(); if (!result.Success) { return(result); } var query = _seoPageRepository.AsNoTracking; query = new SeoPageAdminFilter(query, dto).FilteredQuery(); query = new SeoPageAdminListOrder(query, dto).OrderByQuery(); result.SetPaging(dto?.Page ?? 1, dto?.Size ?? 10, query.Count()); result.Data = query .Select(s => new { s.Id, s.Name }) .Skip((result.Paging.Page - 1) * result.Paging.Size) .Take(result.Paging.Size); return(result); }
public IHttpActionResult Get([FromUri] SeoPageAdminFilterDto dto) { return(Result(_seoPageRepository.List(dto))); }