Beispiel #1
0
        public IQueryable <HsrOrderApp.BL.DomainModel.Customer> GetAll()
        {
            var customers = from c in this.db.CustomerSet.Include("Orders").AsEnumerable()
                            select CustomerAdapter.AdaptCustomer(c);

            return(customers.AsQueryable());
        }
        public IQueryable <HsrOrderApp.BL.DomainModel.Customer> GetAll()
        {
            var customers = from c in this.db.Customers
                            select CustomerAdapter.AdaptCustomer(c);

            return(customers);
        }
Beispiel #3
0
        public HsrOrderApp.BL.DomainModel.Customer GetById(int id)
        {
            try
            {
                var customers = from c in this.db.CustomerSet.Include("Addresses").AsEnumerable()
                                where c.CustomerId == id
                                select CustomerAdapter.AdaptCustomer(c);

                return(customers.First());
            }
            catch (ArgumentNullException ex)
            {
                if (ExceptionPolicy.HandleException(ex, "DA Policy"))
                {
                    throw;
                }
                return(new MissingCustomer());
            }
        }