private void RemoveExpiredMessages() { int expiration = PortalConfig.MdsDeleteOlderMoreThan; if (expiration > 0) { SqlScript sqlScript = new SqlScript(); sqlScript.AppendLine("DELETE FROM [dbo].[cls_Email] WHERE Created < @ExpirationDate"); sqlScript.AddParameter("@ExpirationDate", DateTime.UtcNow.AddMinutes(-expiration)); sqlScript.Execute(); } }
private void RemoveExpiredMessages() { int expiration = PortalConfig.MdsDeleteOlderMoreThan; if (expiration > 0) { SqlScript sqlScript = new SqlScript(); sqlScript.AppendLine("DELETE FROM [dbo].[cls_IbnClientMessage] WHERE Created < @ExpirationDate"); sqlScript.AddParameter("@ExpirationDate", DateTime.UtcNow.AddMinutes(-expiration)); sqlScript.Execute(); } }