Beispiel #1
0
        /// <summary>
        ///     When alternating the Configuration you have to call this method to renew the property enumerations.
        ///     This also happens after the usage of the config attribute
        /// </summary>
        public void Refresh(bool withSubProperty)
        {
            if (withSubProperty)
            {
                foreach (var propertyInfoCach in Propertys)
                {
                    propertyInfoCach.Value.Refresh();
                }
            }

            ForModel = DbAttributeInfoCache <ForModelAttribute> .WrapperOrNull(Attributes);

            SelectFactory = DbAttributeInfoCache <SelectFactoryAttribute> .WrapperOrNull(Attributes);

            var preConfig = MethodProxyAttribute == null;

            MethodProxyAttribute = DbAttributeInfoCache <MethodProxyAttribute> .WrapperOrNull(Attributes);

            HasRelations = Attributes.Any(s => s.Attribute is ForeignKeyAttribute);

            RowVersionProperty = Propertys.FirstOrDefault(s => s.Value.RowVersionAttribute != null).Value;
            PrimaryKeyProperty = Propertys.FirstOrDefault(s => s.Value.PrimaryKeyAttribute != null).Value;

            CreateSchemaMapping();
        }