コード例 #1
0
        /// <summary>
        /// Loads the Property Settings.
        /// This method is called from the base classes constructor.
        /// </summary>
        public override void Initialize()
        {
            #region Base Properties

            KeyName = PropertySource.Name;
            //Description = PropertySource.Description;

            #region Data Type Related

            SystemType = TypeHelper.ResolveSystemType(PropertySource.SystemType(), PropertySource.AllowDBNull, true);
            //DefaultValue = PropertySource.DefaultValue;
            Size      = PropertySource.Size;
            Scale     = PropertySource.Scale;
            Precision = PropertySource.Precision;
            //FixedLength =
            //Unicode =

            IsNullable = PropertySource.AllowDBNull;

            #endregion

            #endregion

            #region Column Specific Properties

            DataType   = PropertySource.DataType;
            NativeType = PropertySource.NativeType;

            //IsUnique = PropertySource.IsUnique;
            //IsForeignKey = PropertySource.IsForeignKeyMember;
            IsRowVersion = PropertySource.IsColumnRowVersion();
            IsIdentity   = PropertySource.IsColumnIdentity();
            IsComputed   = PropertySource.IsColumnComputed();
            Unicode      = PropertySource.IsUnicode();
            FixedLength  = PropertySource.IsFixedLength();

            //  Views do not define any keys, but in cases where frameworks need to define a key like entity framework a key is defined as any non-nullable column.
            if (Configuration.Instance.GenerateViewKeys)
            {
                IsPrimaryKey = !IsNullable && !FixedLength;
            }

            PropertyType = ResolvePropertyType();

            #endregion
        }
コード例 #2
0
        /// <summary>
        /// Loads the Property Settings.
        /// This method is called from the base classes constructor.
        /// </summary>
        public override void Initialize()
        {
            #region Base Properties

            KeyName     = PropertySource.Name;
            Description = PropertySource.Description;

            #region Data Type Related

            SystemType = TypeHelper.ResolveSystemType(PropertySource.SystemType(), PropertySource.AllowDBNull, true);
            //DefaultValue = PropertySource.DefaultValue;
            Size      = PropertySource.Size;
            Scale     = PropertySource.Scale;
            Precision = PropertySource.Precision;
            //FixedLength =
            //Unicode =

            IsNullable = PropertySource.AllowDBNull;

            #endregion

            #endregion

            #region Column Specific Properties

            DataType = PropertySource.DataType;
            ExtendedProperties["DataType"] = PropertySource.NativeType;
            NativeType = PropertySource.NativeType;
            ExtendedProperties["NativeType"] = PropertySource.NativeType;

            //IsUnique = PropertySource.IsUnique;
            //IsPrimaryKey = PropertySource.IsPrimaryKeyMember;
            //IsForeignKey = PropertySource.IsForeignKeyMember;
            IsRowVersion = PropertySource.IsColumnRowVersion();
            IsIdentity   = PropertySource.IsColumnIdentity();
            IsComputed   = PropertySource.IsColumnComputed();
            Unicode      = PropertySource.IsUnicode();
            FixedLength  = PropertySource.IsFixedLength();

            PropertyType = ResolvePropertyType();

            #endregion
        }