Ejemplo n.º 1
0
 /// <summary>
 /// Creates and returns the BankAccount regardless of business errors.
 /// </summary>
 public static async Task <BankAccount> GetOrCreateBankAccountAsync(
     this IBankAccountService service, AccountReference accountDetails)
 {
     try
     {
         return(await service.GetAccountAsync(accountDetails));
     }
     catch (BankAccountNullException)
     {
         return(await service.CreateAccountAsync(accountDetails));
     }
 }