public async Task ProcessFormAsync() { if (_addressId == null) { //Add Address but check for duplicate var existingAddresses = await _checkoutDataRepository.GetAllBillingAddressesAsync(); var matchingExistingAddress = Address.FindMatchingAddress(Address, existingAddresses); if (matchingExistingAddress != null) { Address = matchingExistingAddress; } else { await _checkoutDataRepository.SaveBillingAddressAsync(Address); } } else { //Updated existing address await _checkoutDataRepository.SaveBillingAddressAsync(Address); } }