public IQueryable<Order> GetOrdersByCriteria(OrderSearchType searchType, int customerId) { IQueryable<Order> orders = null; switch (searchType) { case OrderSearchType.None: orders = rep.GetAll(); break; case OrderSearchType.ByCustomer: orders = rep.GetAll().Where(cu => cu.Customer.CustomerId == customerId); break; } return orders; }
public IQueryable <Order> GetOrdersByCriteria(OrderSearchType searchType, int customerId) { IQueryable <Order> orders = null; switch (searchType) { case OrderSearchType.None: orders = rep.GetAll(); break; case OrderSearchType.ByCustomer: orders = rep.GetAll().Where(cu => cu.Customer.CustomerId == customerId); break; } return(orders); }
private IList <OrderListDTO> getOrders(OrderSearchType searchType, int customerid) { try { GetOrdersRequest request = new GetOrdersRequest(); request.SearchType = searchType; request.CustomerId = customerid; GetOrdersResponse response = Service.GetOrdersByCriteria(request); return(response.Orders); } catch (Exception ex) { if (ExceptionPolicy.HandleException(ex, "PL Policy")) { throw; } return(new List <OrderListDTO>()); } }
private IList<OrderListDTO> getOrders(OrderSearchType searchType, int customerid) { try { GetOrdersRequest request = new GetOrdersRequest(); request.SearchType = searchType; request.CustomerId = customerid; GetOrdersResponse response = Service.GetOrdersByCriteria(request); return response.Orders; } catch (Exception ex) { if (ExceptionPolicy.HandleException(ex, "PL Policy")) throw; return new List<OrderListDTO>(); } }