示例#1
0
        public async Task <ContractV1> CreateContractAsync(string correlationId, ContractV1 contract)
        {
            contract.Id          = contract.Id ?? IdGenerator.NextLong();
            contract.Customer.Id = (await CreateCustomerAsync(correlationId, contract.Customer))?.Id;

            return(await _persistence.CreateAsync(correlationId, contract));
        }
        private async Task TestCreateContractsAsync()
        {
            // Create the first contract
            var contract = await _persistence.CreateAsync(null, CONTRACT1);

            AssertContracts(CONTRACT1, contract);

            // Create the second contract
            contract = await _persistence.CreateAsync(null, CONTRACT2);

            AssertContracts(CONTRACT2, contract);

            // Create the third contract
            contract = await _persistence.CreateAsync(null, CONTRACT3);

            AssertContracts(CONTRACT3, contract);
        }