Example #1
0
        public IEnumerable<Customer> getAll()
        {
            using (var db = new HattiEntities())
            {
                List<Customer> listCustomer = new List<Customer>();
                var query = from p in db.Customers select p;

                foreach(var item in query)
                    listCustomer.Add(item);
                
                return listCustomer.AsEnumerable<Customer>();
            }
            
        }
Example #2
0
        public IEnumerable<Product> getAll()
        {
            using (var db = new HattiEntities())
            {
                List<Product> listProduct = new List<Product>();
                var query = from p in db.Products select p;

                foreach(var item in query)
                    listProduct.Add(item);
                
                return listProduct.AsEnumerable<Product>();
            }
            
        }