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); } }
internal void Add <TEntity>(IEnumerable <TEntity> entities) { if (DbContext.OpenQueryCache) { QueryCacheManager.FlushCollectionCache(); } if (DbContext.OpenTableCache) { TableCacheManager.AddCache(entities); } }
/// <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); } }
//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); } }
internal void Delete <TEntity>(Expression <Func <TEntity, bool> > filter) { if (DbContext.OpenQueryCache) { QueryCacheManager.FlushCollectionCache(); } if (DbContext.OpenTableCache) { TableCacheManager.DeleteCache(filter); } }