Пример #1
0
 public Product GetProductByIdFromDataStore(string id)
 {
     using (HalowenEntities data = new HalowenEntities())
     {  //Get a product from Products of data where ProductID is matched with id parameter
         return(data.Products.Where(product => product.ProductID == id).FirstOrDefault());
     }
 }
Пример #2
0
 //Implement GetAllProductsFromDataStore
 public List <Product> GetAllProductsFromDataStore()
 {
     using (HalowenEntities data = new HalowenEntities())
     {  //get all the products from the Collection Products order by name using HalloweenEntities
         return(data.Products.ToList());
     }
 }