示例#1
0
        <DbPropertyInfoCache, DbAttributeInfoCache, DbMethodInfoCache, DbConstructorInfoCache, DbMethodArgument> Init(
            Type type, bool anon = false)
        {
            var item = base.Init(type, anon);

            //.ToDictionary(s => s.Key);
            Propertys = new Dictionary <string, DbPropertyInfoCache>(Propertys
                                                                     .Where(f => f.Value.Attributes.All(e => !(e.Attribute is IgnoreReflectionAttribute)))
                                                                     .ToDictionary(s => s.Key, f => f.Value));
            Mehtods =
                new HashSet <DbMethodInfoCache>(
                    Mehtods.Where(f => f.Attributes.All(d => !(d.Attribute is IgnoreReflectionAttribute))));
            Constructors =
                new HashSet <DbConstructorInfoCache>(
                    Constructors.Where(f => f.Attributes.All(e => !(e.Attribute is IgnoreReflectionAttribute))));
            foreach (var dbPropertyInfoCach in Propertys)
            {
                dbPropertyInfoCach.Value.DeclaringClass = this;
            }
            foreach (var dbPropertyInfoCach in Mehtods)
            {
                dbPropertyInfoCach.DeclaringClass = this;
            }
            foreach (var dbPropertyInfoCach in Constructors)
            {
                dbPropertyInfoCach.DeclaringClass = this;
            }

            Refresh(true);
            return(item);
        }