public async Task <int> Save(Supplier supplier) { if (supplier.Id == 0) { //Save SaveSupplier(supplier); } else { //update UpdateSupplier(supplier); } return(await context.SaveChangesAsync()); }
public async Task <int> Save(Customer customer) { if (customer.Id == 0) { //Save SaveCustomer(customer); } else { //update UpdateCustomer(customer); } return(await context.SaveChangesAsync()); }