public static bool CheckCacheFlag <T>() where T : class { bool result = false; EntityProxy <T> entityProxy = EntityProxyManager.Instance.GetEntityProxy <T>(); OrmTableAttribute ormTableAttribute = entityProxy.GetCustomerAttribute <OrmTableAttribute>(); if (ormTableAttribute != null) { result = ormTableAttribute.CachedFlag; } return(result); }
public static string GetTableName(Type typeInfo) { string typeName = typeInfo.FullName; return(CacheManager.Instance.GetEntity <string, string>(Constants.BeeDataTableNameTypeCategory, typeName, TimeSpan.FromHours(4), (para) => { IEntityProxy entityProxy = EntityProxyManager.Instance.GetEntityProxyFromType(typeInfo); OrmTableAttribute ormTableAttribute = entityProxy.GetCustomerAttribute <OrmTableAttribute>(); string tableName = typeInfo.Name; if (ormTableAttribute != null) { if (!string.IsNullOrEmpty(ormTableAttribute.TableName)) { tableName = ormTableAttribute.TableName; } } return tableName; })); }