Пример #1
0
        public async Task <CustomerV1> CreateCustomerAsync(string correlationId, CustomerV1 customer)
        {
            customer.Id     = customer.Id ?? IdGenerator.NextLong();
            customer.Gender = customer.Gender ?? CustomerGenderV1.Unknown;

            return(await _persistence.CreateAsync(correlationId, customer));
        }
Пример #2
0
        private async Task TestCreateCustomersAsync()
        {
            // Create the first customer
            var customer = await _persistence.CreateAsync(null, CUSTOMER1);

            AssertCustomers(CUSTOMER1, customer);

            // Create the second customer
            customer = await _persistence.CreateAsync(null, CUSTOMER2);

            AssertCustomers(CUSTOMER2, customer);

            // Create the third customer
            customer = await _persistence.CreateAsync(null, CUSTOMER3);

            AssertCustomers(CUSTOMER3, customer);
        }