예제 #1
0
 internal LengthColumnConfiguration(System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.LengthPropertyConfiguration configuration)
     : base((System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration)configuration)
 {
 }
예제 #2
0
        /// <summary>
        /// Configures the property to have the specified maximum length.
        /// </summary>
        /// <param name="value"> The maximum length for the property. Setting 'null' will remove any maximum length restriction from the property and a default length will be used for the database column. </param>
        /// <returns> The same LengthPropertyConfiguration instance so that multiple calls can be chained. </returns>
        public LengthPropertyConfiguration HasMaxLength(int?value)
        {
            this.Configuration.MaxLength   = value;
            this.Configuration.IsMaxLength = new bool?();
            System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.LengthPropertyConfiguration configuration = this.Configuration;
            bool?isFixedLength = this.Configuration.IsFixedLength;
            bool?nullable      = new bool?(isFixedLength.HasValue && isFixedLength.GetValueOrDefault());

            configuration.IsFixedLength = nullable;
            return(this);
        }