public void TryCleanup(ConfigurationChangeTracker changeTracker) { using (RuntimeEntityModel context = RuntimeEntityModel.CreateInstance()) { switch (changeTracker.ImpactScope) { case ConfigurationChangeTracker.ConfigChangeImpactScope.Session: foreach (Guid sessionUniqueId in changeTracker.UpdatedSessionIds) { Trace.TraceInformation( "Deleting cached data for session '{0}'", sessionUniqueId.ToString()); context.DeleteSessionCachedData(sessionUniqueId); } break; case ConfigurationChangeTracker.ConfigChangeImpactScope.SessionGroup: Trace.TraceInformation( "Deleting cached data for session group '{0}'", changeTracker.UpdatedSessionGroupId.ToString()); context.DeleteSessionGroupCachedData(changeTracker.UpdatedSessionGroupId); break; default: Trace.TraceInformation( "ConfigurationChangeTracker did not detect any non-transient changes. No cached data will be deleted for session group '{0}'", changeTracker.UpdatedSessionGroupId.ToString()); break; } } }