public static void SaveCustomerMaster(MasterCustomer objMasterCustomer) { using (var dbInvoice = new IncubXpertInvoicingDb()) { dbInvoice.MasterCustomers.AddOrUpdate(objMasterCustomer); dbInvoice.SaveChanges(); } }
public static void DeleteCustomer(int Id) { using (var dbInvoice = new IncubXpertInvoicingDb()) { var query = from s in dbInvoice.MasterCustomers where s.Id == Id select s; var result = query.FirstOrDefault(); if (result != null) { dbInvoice.MasterCustomers.Remove(result); dbInvoice.SaveChanges(); } } }