public async Task <Unit> Handle(CreateCustomerV1Command request, CancellationToken cancellationToken) { await VerifyCustomerNameIsUnique(request.Customer.FirstName, request.Customer.LastName); _data.AddCustomer(request.Customer); await _data.SaveChanges(); return(Unit.Value); }
private async Task CreateCustomer(Customer customer, CancellationToken cancellationToken) { _data.AddCustomer(customer); await _data.SaveChanges(cancellationToken); }