Esempio n. 1
0
        public IQueryable <BL.DomainModel.Supplier> GetAll()
        {
            var suppliers = from c in this.db.SupplierSet.AsEnumerable()
                            select SupplierAdapter.AdaptSupplier(c);

            return(suppliers.AsQueryable());
        }
        public IQueryable <BL.DomainModel.Supplier> GetAll()
        {
            var suppliers = from p in this.db.Suppliers
                            select SupplierAdapter.AdaptSupplier(p);

            return(suppliers);
        }
Esempio n. 3
0
        public Supplier GetSupplierById(int supplierId)
        {
            var suppliers = from s in this.db.Suppliers.AsEnumerable()
                            where s.SupplierId == supplierId
                            select SupplierAdapter.AdaptSupplier(s);

            return(suppliers.Single());
        }
Esempio n. 4
0
        public IQueryable <Supplier> GetSuppliersByProductId(int id)
        {
            var suppliers = from sc in this.db.SupplierConditions.AsEnumerable()
                            where sc.ProductId == id
                            join s in this.db.Suppliers on sc.SupplierId equals s.SupplierId
                            select SupplierAdapter.AdaptSupplier(s);

            return(suppliers.AsQueryable());
        }
Esempio n. 5
0
        public IQueryable <Supplier> GetAllSuppliers()
        {
            var suppliers = from s in this.db.Suppliers.AsEnumerable()
                            select SupplierAdapter.AdaptSupplier(s);

            var queryable = suppliers.AsQueryable();

            return(queryable);
        }
Esempio n. 6
0
        public BL.DomainModel.Supplier GetById(int id)
        {
            try
            {
                var suppliers = from c in this.db.SupplierSet.AsEnumerable()
                                where c.SupplierId == id
                                select SupplierAdapter.AdaptSupplier(c);

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