Example #1
0
        void ICacheStore.PurgeApplicationID(int appID)
        {
            var results = data
                          .Where(r => r.Key != null)
                          .Where(r => EntityID.GetApplicationID(r.Key) == appID);

            foreach (FileCacheRecord rec in results)
            {
                rec.RemoveLinkedFile();

                data.Remove(rec);
            }
        }
Example #2
0
        void ICacheStore.PurgeApplicationID(int appID)
        {
            var results = dc.ServerCache
                          .Where(r => r.Key != null)
                          .Select(r => r.Key)
                          .AsEnumerable()
                          .Where(k => EntityID.GetApplicationID(k.ToArray()) == appID);

            var records = dc.ServerCache
                          .Where(r => r.Key != null)
                          .Where(r => results.Contains(r.Key));

            foreach (DBCacheRecord rec in records)
            {
                rec.RemoveLinkedFile();
            }

            dc.ServerCache.DeleteAllOnSubmit(records);
            dc.SubmitChanges();
        }