public async Task <GetAccountResponseViewModel> Get(long accountId)
        {
            Account account = await _userManager.FindByIdAsync(accountId.ToString());

            if (account == null)
            {
                throw new IdentityException($"Account with id {accountId} was not found");
            }

            GetAccountResponseViewModel getAccountResponseViewModel = _mapper.Map <Account, GetAccountResponseViewModel>(account);

            await _notificationHub.Clients.All.SendAsync("clientSubscription", ($"{getAccountResponseViewModel.FirstName} {getAccountResponseViewModel.LastName} has signed in!"));

            return(getAccountResponseViewModel);
        }
Esempio n. 2
0
        public async Task <ActionResult <GetAccountResponseViewModel> > Get()
        {
            GetAccountResponseViewModel getAccountResponseViewModel = await _accountsService.Get(_account.Id);

            return(Ok(getAccountResponseViewModel));
        }