Пример #1
0
 public bool IsUserOnline(string userId)
 {
     _logger.LogDebug("Trying to check if user :{userId) is online.", userId);
     if (string.IsNullOrWhiteSpace(userId))
     {
         throw new ArgumentNullException(nameof(userId));
     }
     try
     {
         OnlineUser onlineUser = _onlineUsersRepository.GetById(userId);
         return(onlineUser != null);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "Error occured during checking  if user :{userId) is online.", userId);
         throw;
     }
 }