Example #1
0
        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());
        }
Example #2
0
        public IQueryable <HsrOrderApp.BL.DomainModel.Order> GetAll()
        {
            var orders = from o in this.db.Orders
                         select OrderAdapter.AdaptOrder(o);

            return(orders);
        }
Example #3
0
        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());
            }
        }
Example #4
0
        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());
            }
        }