public async Task <Core.Models.Account> Get(string id, AccountFieldsSelection selection)
        {
            try
            {
                _logger.Debug(
                    $"{nameof(IAccountApiClient)}.{nameof(IAccountApiClient.GetResource)}<{nameof(AccountDetailViewModel)}>(\"/api/accounts/{id.ToUpper()}\");");

                var response = await _accountApiClient.GetResource <AccountDetailViewModel>($"/api/accounts/{id.ToUpper()}");

                return(await GetAdditionalFields(response, selection));
            }
            catch (Exception e)
            {
                _logger.Error(e, $"Account with id {id} not found");
                return(null);
            }
        }
 public async Task <T> GetResource <T>(string uri) where T : IAccountResource
 {
     return(await _inner.GetResource <T>(uri));
 }
예제 #3
0
 public async Task <AccountDetailViewModel> GetAccount(string accountHref)
 {
     return(await _accountApiClient.GetResource <AccountDetailViewModel>(accountHref));
 }