public Entities.Products AddProduct(Entities.Products product) { using (var context = new Models.SalesDBContext(Options)) { context.Products.Add(product); context.SaveChanges(); } return(product); }
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); }