Beispiel #1
0
 public Entities.Products AddProduct(Entities.Products product)
 {
     using (var context = new Models.SalesDBContext(Options))
     {
         context.Products.Add(product);
         context.SaveChanges();
     }
     return(product);
 }
Beispiel #2
0
        public Entities.Products GetProductByID(int ID)
        {
            Entities.Products product = null;

            using (var context = new Models.SalesDBContext(Options))
            {
                product = context.Products.FirstOrDefault(x => x.Id == ID);
            }
            return(product);
        }