/// <summary>
        /// Deletes refresh token from DB
        /// </summary>
        /// <param name="userId">User Id</param>
        /// <param name="refreshToken">Refresh token to delete</param>
        /// <returns>Deleting was succesful</returns>
        private async Task <bool> DeleteRefreshToken(int userId, string refreshToken)
        {
            var tokenInDb = await _context.RefreshTokens
                            .FirstOrDefaultAsync(t => t.UserId == userId && string.Equals(refreshToken, t.Token));

            if (tokenInDb == null)
            {
                return(false);
            }

            try
            {
                _context.Remove(tokenInDb);
                await _context.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                return(false);
            }
        }
        /// <summary>
        /// Clears portal by Id from Db
        /// </summary>
        /// <returns>Deleted portal</returns>
        public async Task <Portal> ClearDeletedByIdAsync(Guid Id)
        {
            _logger.LogInformation("Requested to clear portal by Id from Db");

            var portal = await _context.Portals.FindAsync(Id);

            if (portal != null && portal.Status == PortalStatus.Deleted)
            {
                try
                {
                    _context.Remove(portal);
                    await _context.SaveChangesAsync();
                }
                catch (Exception ex)
                {
                    _logger.LogError(ex.Message);
                    return(null);
                }
                _logger.LogInformation("Portal by Id in Db cleared from portals with status Deleted.");
                return(portal);
            }
            _logger.LogInformation("Portal founded by Id, but status was not Deleted. Portal was not cleared from Db");
            return(null);
        }