Beispiel #1
0
 internal void Update <TEntity>(TEntity entity, Expression <Func <TEntity, bool> > filter, IEnumerable <string> updateCloumns = null)
 {
     if (DbContext.OpenQueryCache)
     {
         QueryCacheManager.FlushCollectionCache();
     }
     if (DbContext.OpenTableCache)
     {
         TableCacheManager.UpdateCache(entity, filter, updateCloumns);
     }
 }
Beispiel #2
0
 internal void Add <TEntity>(IEnumerable <TEntity> entities)
 {
     if (DbContext.OpenQueryCache)
     {
         QueryCacheManager.FlushCollectionCache();
     }
     if (DbContext.OpenTableCache)
     {
         TableCacheManager.AddCache(entities);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Clear single table's all caching data
 /// </summary>
 public void FlushCurrentCollectionCache(string collectionName = null)
 {
     if (DbContext.OpenQueryCache)
     {
         QueryCacheManager.FlushCollectionCache(collectionName);
     }
     if (DbContext.OpenTableCache)
     {
         TableCacheManager.FlushCollectionCache(collectionName);
     }
 }
Beispiel #4
0
 //Same Logic:
 //1.Clear all cached records about the table in the query cache
 //2.Update the table record in the table cache
 internal void Add <TEntity>(TEntity entity)
 {
     if (DbContext.OpenQueryCache)
     {
         QueryCacheManager.FlushCollectionCache();
     }
     if (DbContext.OpenTableCache)
     {
         TableCacheManager.AddCache(entity);
     }
 }
Beispiel #5
0
 internal void Delete <TEntity>(Expression <Func <TEntity, bool> > filter)
 {
     if (DbContext.OpenQueryCache)
     {
         QueryCacheManager.FlushCollectionCache();
     }
     if (DbContext.OpenTableCache)
     {
         TableCacheManager.DeleteCache(filter);
     }
 }