public Guid AddCustomer(CustomerDTO client) { Customer dataModel = new Customer(); client.CopyTo(dataModel); _context.Customers.Add(dataModel); _context.SaveChanges(); return(dataModel.Id); }
public void UpdateCustomer(CustomerDTO client) { Customer dataModel = _context.Customers.FirstOrDefault(x => x.Id == client.Id); if (dataModel == null) { return; } client.CopyTo(dataModel); _context.SaveChanges(); return; }