示例#1
0
        public async Task <IActionResult> GetAccount(string userName)
        {
            try
            {
                _logger.LogTrace("Accounts controller GetAccount");

                var account = await _accounts.GetAccountByIdAsync(userName);

                if (account == null)
                {
                    return(NotFound());
                }

                return(Ok(account.ToAccountViewModel()));
            }
            catch (Exception)
            {
                return(StatusCode(500));
            }
        }
示例#2
0
 public async Task <Account> GetAccountByIdAsync(long accountId)
 {
     return(await _accountsRepository.GetAccountByIdAsync(accountId));
 }