public void SaveNewOrder(Order order) //, int customerId { using (var context = new GlassContext()) { context.OrderSet.Add(order); context.SaveChanges(); } }
public void SaveUpdatedGlass(Glass glass) { using (var context = new GlassContext()) { context.Entry(glass).State = EntityState.Modified; context.SaveChanges(); } }
public void SaveUpdatedOrder(Order order) { using (var context = new GlassContext()) { context.Entry(order).State = EntityState.Modified; context.SaveChanges(); } }
public void SaveNewCustomer(Customer customer) { using (var context = new GlassContext()) { context.CustomerSet.Add(customer); context.SaveChanges(); } }
public void SaveUpdatedCustomer(Customer customer) { using (var context = new GlassContext()) { context.Entry(customer).State = EntityState.Modified; context.SaveChanges(); } }
public void SaveNewGlass(Glass glass) { using (var context = new GlassContext()) { context.GlassSet.Add(glass); context.SaveChanges(); } }
//public Order GetOrderById(int id) //{ // using (var context = new GlassContext()) // { // Order order = context.OrderSet.Find(id); // Customer customer = GetCustomerById(order.CustomerId); // order.Customer = customer; // return order; // } //} public void DeleteOrder(int orderId) { using (var context = new GlassContext()) { var order = context.OrderSet.Find(orderId); context.Entry(order).State = EntityState.Deleted; context.SaveChanges(); } }
public void DeleteCustomer(int customerId) { using (var context = new GlassContext()) { var customer = context.CustomerSet.Find(customerId); context.Entry(customer).State = EntityState.Deleted; context.SaveChanges(); } }
public void DeleteGlass(int glassId) { using (var context = new GlassContext()) { var glass = context.GlassSet.Find(glassId); context.Entry(glass).State = EntityState.Deleted; context.SaveChanges(); } }