public object Any(Sales request) { var resp = new Dto <List <Sale> >(); var handler = new SaleHandler(Db, CurrentSession); resp.Result = handler.List(request.Skip, request.Take).Map(Sale.From); return(resp); }
public object Any(SaleTypeahead request) { var resp = new Dto <List <Sale> >(); var saleHandler = new SaleHandler(Db, CurrentSession); var searchHandler = new SearchHandler(Db, CurrentSession); if (request.Query.IsNullOrEmpty()) { resp.Result = saleHandler.List(0, int.MaxValue).Map(Sale.From); } else { resp.Result = searchHandler.SaleTypeahead(request.Query).Map(Sale.From); } return(resp); }