コード例 #1
0
        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);
        }
コード例 #2
0
        private async Task CreateCustomer(Customer customer, CancellationToken cancellationToken)
        {
            _data.AddCustomer(customer);

            await _data.SaveChanges(cancellationToken);
        }