public FindTipsResponse Find(FindTipsRequest request) { try { _tipQuery.WithOnlyActivated(true); _tipQuery.WithOnlyStatusActivated(request.OnlyStatusActivated); _tipQuery.WithOnlyStatusDeactivated(request.OnlyStatusDeactivated); _tipQuery.WithName(request.Name); _tipQuery.Sort(request.Sort, request.SortBy); var totalRecords = _tipQuery.TotalRecords(); _tipQuery.Paginate(request.StartPage, request.EndPage); var tips = _tipQuery.Execute(); return(new FindTipsResponse { Tips = TypeAdapter.Adapt <List <TipResponse> >(tips), TotalRecords = totalRecords }); } catch (DataAccessException) { throw new ApplicationException(); } }
public FindTipsResponse Get(FindTipsRequest request) { return(_tipService.Find(request)); }