Пример #1
0
        internal TableSchemeData(TkDbContext context, ITableScheme scheme)
        {
            ICacheDependencyCreator creator = scheme as ICacheDependencyCreator;

            if (creator != null)
            {
                fDependency = creator.CreateCacheDependency();
            }
            if (fDependency == null)
            {
                fDependency = (new ActiveTimeCacheAttribute()).CreateObject();
            }
            KeyFieldInfos = new DictionaryList <IFieldInfo>();

            ProcessFields(context, scheme);
        }
Пример #2
0
        internal static ICacheDependency GetDependency(MemberInfo objType, object objInstance)
        {
            Attribute attribute = Attribute.GetCustomAttribute(
                objType, typeof(CacheDependencyAttribute));

            if (attribute == null)
            {
                ICacheDependencyCreator intf = objInstance as ICacheDependencyCreator;
                if (intf != null)
                {
                    return(intf.CreateCacheDependency());
                }
            }
            else
            {
                return(attribute.Convert <CacheDependencyAttribute>().CreateObject());
            }

            return(null);
        }