Ejemplo n.º 1
0
 public Product GetProductByIdFromDataStore(string id)
 {
     using (HalloweenEntitiess data = new HalloweenEntitiess())
     {  //Get a product from Products of data where ProductID is matched with id parameter
         return(data.Products.FirstOrDefault(p => p.ProductID == id));
     }
 }
Ejemplo n.º 2
0
 //Implement GetAllProductsFromDataStore
 public List <Product> GetAllProductsFromDataStore()
 {
     using (HalloweenEntitiess data = new HalloweenEntitiess())
     {  //get all the products from the Collection Products order by name using HalloweenEntities
         return(data.Products.OrderBy(p => p.Name).ToList());
     }
 }