public IQueryable <HsrOrderApp.BL.DomainModel.Order> GetAll() { var orders = from o in this.db.OrderSet.Include("Customer").AsEnumerable() select OrderAdapter.AdaptOrder(o); return(orders.AsQueryable()); }
public IQueryable <HsrOrderApp.BL.DomainModel.Order> GetAll() { var orders = from o in this.db.Orders select OrderAdapter.AdaptOrder(o); return(orders); }
public HsrOrderApp.BL.DomainModel.Order GetById(int id) { try { var orders = from o in this.db.Orders where o.OrderId == id select OrderAdapter.AdaptOrder(o); return(orders.First()); } catch (Exception ex) { //if (ExceptionPolicy.HandleException(ex, "MissingEntity")) throw; return(new MissingOrder()); } }
public HsrOrderApp.BL.DomainModel.Order GetById(int id) { try { var orders = from o in this.db.OrderSet.Include("Customer").Include("OrderDetails.Product").AsEnumerable() where o.OrderId == id select OrderAdapter.AdaptOrder(o); return(orders.First()); } catch (ArgumentNullException ex) { if (ExceptionPolicy.HandleException(ex, "DA Policy")) { throw; } return(new MissingOrder()); } }