public DbEntityCache(DbEntityCacheKeyMapping cacheKeyMapping) { this.CacheKeyMapping = cacheKeyMapping; string test = string.Empty; foreach (var item in CacheKeyMapping.EntityCacheKeys) { test += $"key:{item.Key.Name},value:{item.Value.Name};"; } Log.LogDebug("缓存构造函数", test); }
/// <summary> /// 数据实体类型配置信息 /// </summary> /// <returns></returns> public static DbEntityCacheKeyMapping DefaultEntityCacheKeyMapping() { var mapping = new DbEntityCacheKeyMapping(); // subclasses of JobEntity mapping.RegisterEntityCacheKey(typeof(MessageEntity), typeof(JobEntity)); mapping.RegisterEntityCacheKey(typeof (TimerEntity), typeof (JobEntity)); // subclasses of HistoricDetailEventEntity mapping.RegisterEntityCacheKey(typeof (HistoricFormPropertyEntity), typeof (HistoricDetailEventEntity)); mapping.RegisterEntityCacheKey(typeof(HistoricFormPropertyEventEntity), typeof(HistoricDetailEventEntity)); mapping.RegisterEntityCacheKey(typeof(HistoricVariableUpdateEventEntity), typeof(HistoricDetailEventEntity)); mapping.RegisterEntityCacheKey(typeof (HistoricVariableUpdateEventEntity),typeof (HistoricDetailEventEntity)); return mapping; }
public DbEntityCache() { CacheKeyMapping = DbEntityCacheKeyMapping.EmptyMapping(); Log.LogDebug("缓存无参构造函数", "DbEntityCacheKeyMapping.EmptyMapping"); }