public async Task <IActionResult> SearchAll(KursSearchDto dto) { try { dto.UserId = CurrentUserId; return(Ok(await Logic.SearchAll(dto))); } catch (Exception ex) { return(ExceptionResult(ex)); } }
public async Task <object> SearchAll(KursSearchDto dto) { var query = GetQueryable(x => (x.Name.Contains(dto.Name) || string.IsNullOrEmpty(dto.Name))) .OrderByDescending(x => x.DateUpdate) .Skip(dto.Count * dto.Page).Take(dto.Count); var result = await query .Select(x => new { x.Name, x.Value, Exchanger = x.Exchanger.Name, City = x.Exchanger.City.Name }).ToListAsync(); var total = await query.CountAsync(); return(new { total = total, result = result }); }
public async Task <object> SearchAll(KursSearchDto dto) { return(await Repo.SearchAll(dto)); }
public async Task <object> GetList(KursSearchDto dto) { return(await Repo.GetList(dto)); }