public async Task <IActionResult> GetAccount([FromRoute] int id, CancellationToken cancellationToken = default) { try { var spec = new GetAccountSpecification(id); var account = await _accountAppService.GetAccount(spec, cancellationToken); return(Ok(account)); } catch (Exception ex) { return(StatusCode(500, ex)); } }
public async Task <AccountDTO> GetAccount(GetAccountSpecification spec, CancellationToken cancellationToken = default) { var account = await _accountRepository.GetOneAsync(spec, cancellationToken); return(account.ToDTO()); }