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;
                }
            }
        }
 /// <summary>
 /// Remove all change groups in current session which are in progress.
 /// For delta table, this includes status of Delta, DeltaPending.
 /// For migration instruction, this includes Pending or Inprogress.
 /// </summary>
 private void RemoveInProgressChangeGroupsInSession(Guid sessionId)
 {
     using (RuntimeEntityModel context = RuntimeEntityModel.CreateInstance())
     {
         TraceManager.TraceInformation(
             "Deleting cached data for session '{0}'", sessionId);
         context.DeleteSessionCachedData(sessionId);
     }
 }