public static bool IsMessageInCache(string message) { if (string.IsNullOrWhiteSpace(message)) { return(false); } string key = UtilityManager.GenerateMD5String(message); try { if (HttpRuntime.Cache[key] != null) { var msgExists = ( string )HttpRuntime.Cache[key]; if (msgExists.ToLower() == message.ToLower()) { LoggingHelper.DoTrace(7, "LoggingHelper. Duplicate message: " + message); return(true); } } } catch { } return(false); }
public static bool IsADuplicateRecentSessionMessage(string message) { string sessionKey = UtilityManager.GenerateMD5String(message); bool isDup = false; try { if (HttpContext.Current.Session != null) { string msgExists = HttpContext.Current.Session[sessionKey].ToString(); if (msgExists.ToLower() == message.ToLower()) { LoggingHelper.DoTrace(7, "LoggingHelper. Duplicate message: " + message); return(true); } } } catch { } return(isDup); }