예제 #1
0
        public async Task CreateBillingInformation(BillingInformation billingInformation)
        {
            var addAddress = _context.Addresses.Add(new AddressMap(billingInformation.BillingAddress));
            await _context.SaveChangesAsync();

            var addBillingInformation = new BillingInformationMap(billingInformation);

            addBillingInformation.ReferenceBillingAddressId = addAddress.Entity.AddressId;

            _context.BillingInformations.Add(addBillingInformation);
            await _context.SaveChangesAsync();
        }
예제 #2
0
        public async Task CreateBillingInformation(BillingInformation billingInformation)
        {
            var insertAddress = new AddressMap(billingInformation.BillingAddress);

            insertAddress.AddressId = Guid.NewGuid().ToString();

            await _addressCollection.InsertOneAsync(insertAddress);

            var insertBillingInformation = new BillingInformationMap(billingInformation);

            insertBillingInformation.BillingInformationId      = Guid.NewGuid().ToString();
            insertBillingInformation.ReferenceBillingAddressId = insertAddress.AddressId;

            await _billingInformationCollection.InsertOneAsync(insertBillingInformation);
        }