public bool Update(Customers originalCustomer, Customers updatedCustomer) { try { _ctx.Entry(originalCustomer).CurrentValues.SetValues(updatedCustomer); SaveAll(); } catch { return false; } return true; }
public int Insert(Customers customer) { try { _ctx.Customers.Add(customer); SaveAll(); return customer.Id; } catch { return -1; } }