using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Internal; using System; using System.Collections.Generic; using System.Text; namespace AsbCloudInfrastructure.Services.Cache { public class CacheDb { private Dictionary> cache = new Dictionary>(); public ICacheTable GetCachedTable(DbContext context) where TEntity : class { var entityType = typeof(TEntity); if (!cache.ContainsKey(entityType)) cache[entityType] = new List(8); var tableCache = new CacheTable(context, (List)cache[entityType]); return tableCache; } } }