Ejemplo n.º 1
0
        public async Task LogoutAsync(LogoutAdto logoutAdto)
        {
            using (ITransaction transaction = _transactionManager.Create())
            {
                Identity identity = await _identityCommandRepository.GetByIdAsync(logoutAdto.IdentityId);

                if (identity == null)
                {
                    throw new BusinessApplicationException(ExceptionType.NotFound, "Identity does not exist");
                }

                await _logoutCommand.ExecuteAsync(identity);

                await _identityCommandRepository.UpdateAsync(identity);

                transaction.Commit();
            }
        }
 public Task LogoutAsync(LogoutAdto logoutAdto)
 {
     return(_securityApplicationService.SecureAsync(() => _identityApplicationService.LogoutAsync(logoutAdto),
                                                    IdentityAuthorisationContext.Create(logoutAdto.IdentityId, AuthorisationAction.Update)));
 }