public void ClearAllCache() { ICacheDataProvider CacheRepository; List <string> keys = new List <string>(); if (Consts.DataCachingTechnology == DataCacheTechnology.MEMORYOBJECT) { CacheRepository = new CacheDataProvider(); keys = CacheRepository.Clear(); } else { CacheRepository = new AppFabricCacheProviderSystemRegions(Consts.ProductName); Dictionary <string, List <string> > cache = GetVauctionRegions(); string tp = DataCacheType.REFERENCE.ToString(); keys.AddRange((CacheRepository as AppFabricCacheProviderSystemRegions).Clear(tp, cache[tp])); tp = DataCacheType.RESOURCE.ToString(); keys.AddRange((CacheRepository as AppFabricCacheProviderSystemRegions).Clear(tp, cache[tp])); tp = DataCacheType.ACTIVITY.ToString(); keys.AddRange((CacheRepository as AppFabricCacheProviderSystemRegions).Clear(tp, cache[tp])); } StringBuilder sb = new StringBuilder(); sb.AppendLine("[ALL CACHE CLEARED: " + System.DateTime.Now.ToString() + "]"); keys.ForEach(k => sb.AppendLine(k)); Logger.LogInfo(sb.ToString()); }
public void ClearAllCache() { ICacheDataProvider CacheRepository; List <string> keys = new List <string>(); if (Consts.DataCachingTechnology == DataCacheTechnology.MEMORYOBJECT) { CacheRepository = new CacheDataProvider(); keys = CacheRepository.Clear(); } else { CacheRepository = new AppFabricCacheProviderSystemRegions(Consts.ProductName); keys.AddRange((CacheRepository as AppFabricCacheProviderSystemRegions).Clear(DataCacheType.REFERENCE.ToString(), new List <string> { "CATEGORIES", "EVENTS", "TAGS" })); keys.AddRange((CacheRepository as AppFabricCacheProviderSystemRegions).Clear(DataCacheType.RESOURCE.ToString(), new List <string> { "EVENTS", "AUCTIONS", "IMAGES", "AUCTIONLISTS" })); keys.AddRange((CacheRepository as AppFabricCacheProviderSystemRegions).Clear(DataCacheType.ACTIVITY.ToString(), new List <string> { "WATCHLISTS", "EVENTREGISTRATIONS", "BIDS", "INVOICES" })); } StringBuilder sb = new StringBuilder(); sb.AppendLine("[ALL CACHE CLEARED: " + System.DateTime.Now + "]"); keys.ForEach(k => sb.AppendLine(k)); Logger.LogInfo(sb.ToString()); }
public List <IDeletedCachedRecord> GetDeletedRecordsByTable(string tableName, byte[] timeStamp, bool canUseCacheIfPossible = true) { var result = (IQueryable <DeletedCachedRecord>)CacheDataProvider.MakeQueryableForFetchingOnlyChangedDataFromDB(All(canUseCacheIfPossible).Where(rec => rec.TableName == tableName), new CacheInfo() { MaxTimeStamp = timeStamp, EnableToFetchOnlyChangedDataFromDB = true }, !canUseCacheIfPossible); return(result.ToList <IDeletedCachedRecord>()); }
public void ClearARP(int id) { ICacheDataProvider cacheRepository; if (Consts.DataCachingTechnology == DataCacheTechnology.MEMORYOBJECT) { cacheRepository = new CacheDataProvider(); } else { cacheRepository = new AppFabricCacheProviderSystemRegions(Consts.ProductName); } DataCacheObject dco = new DataCacheObject(DataCacheType.RESOURCE, DataCacheRegions.AUCTIONS, "GETAUCTIONDETAILRESULTPAST", new object[] { id }); cacheRepository.Remove(dco); Logger.LogInfo("[Cache removed: " + DataCacheType.RESOURCE + "_" + DataCacheRegions.AUCTIONS + "_GETAUCTIONDETAILRESULTPAST" + "_" + id + "]"); }
public void ClearAuctionListRegion() { ICacheDataProvider CacheRepository; if (Consts.DataCachingTechnology == DataCacheTechnology.MEMORYOBJECT) { CacheRepository = new CacheDataProvider(); } else { CacheRepository = new AppFabricCacheProviderSystemRegions(Consts.ProductName); } List <string> keys = CacheRepository.Clear(DataCacheType.RESOURCE.ToString(), "AUCTIONLISTS"); StringBuilder sb = new StringBuilder(); sb.AppendLine("[(ClearAuctionListRegion) CACHE CLEARED: " + System.DateTime.Now.ToString() + "]"); keys.ForEach(k => sb.AppendLine(k)); Logger.LogInfo(sb.ToString()); }