private static Type GetProviderType(IHorizontalCacheConfiguration hconfig) { if (hconfig == null) { return(null); } if (!hconfig.IsEnabled) { return(null); } return(hconfig.ProviderType); }
internal InCodeCacheConfiguration(IHorizontalCacheConfiguration cacheConfiguration) { _cacheConfiguration = cacheConfiguration; }
private static object CreateCacheProviderFromConfig(Type entityType, string dataStoreSetId, IHorizontalCacheConfiguration hconfig, object dao, IEnumerable <PropertyInfo> cachedProperties) { var cacheProviderType = GetProviderType(hconfig); if (cacheProviderType == null) { return(null); } var dataSourceEnumerator = typeof(IDataSourceEnumerator <>).MakeGenericType(entityType); if (!dataSourceEnumerator.IsAssignableFrom(dao.GetType())) { return(null); } var persistentCacheProviderType = cacheProviderType.MakeGenericType(entityType); return(Activator.CreateInstance(persistentCacheProviderType, dataStoreSetId, hconfig.GetAllParameters(), dao, cachedProperties)); }