public void Update(IRepositoryLocator locator, CustomerDto operation) { UpdateValidate(locator, operation); FirstName = operation.FirstName; LastName = operation.LastName; Telephone = operation.Telephone; locator.Update(this); }
public static Customer Create(IRepositoryLocator locator, CustomerDto operation) { var instance = new Customer { FirstName = operation.FirstName, LastName = operation.LastName, Telephone = operation.Telephone }; locator.Save(instance); return instance; }
private void UpdateValidate(IRepositoryLocator locator, CustomerDto operation) { return; }
public CustomerDto UpdateCustomerCommand(IRepositoryLocator locator, CustomerDto dto) { var instance = locator.GetById<Customer>(dto.CustomerId); instance.Update(locator, dto); return CustomerToDto(instance); }
public CustomerDto UpdateCustomer(CustomerDto dto) { return ExecuteCommand(locator => UpdateCustomerCommand(locator, dto)); }
public CustomerDto CreateNewCustomerCommand(IRepositoryLocator locator, CustomerDto dto) { var customer = Customer.Create(locator, dto); return CustomerToDto(customer); }
public CustomerDto CreateNewCustomer(CustomerDto dto) { return ExecuteCommand(locator => CreateNewCustomerCommand(locator, dto)); }