Used to configure a property with length facets for an entity type or complex type.
Inheritance: System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration
Ejemplo n.º 1
0
 protected LengthPropertyConfiguration(LengthPropertyConfiguration source)
     : base((PrimitivePropertyConfiguration)source)
 {
     Check.NotNull <LengthPropertyConfiguration>(source, nameof(source));
     this.IsFixedLength = source.IsFixedLength;
     this.MaxLength     = source.MaxLength;
     this.IsMaxLength   = source.IsMaxLength;
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="T:System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.LengthPropertyConfiguration" />
        ///     class with the same settings as another configuration.
        /// </summary>
        /// <param name="source">The configuration to copy settings from.</param>
        protected LengthPropertyConfiguration(LengthPropertyConfiguration source)
            : base(source)
        {
            Check.NotNull(source, "source");

            IsFixedLength = source.IsFixedLength;
            MaxLength     = source.MaxLength;
            IsMaxLength   = source.IsMaxLength;
        }
        // <summary>
        // Initializes a new instance of the <see cref="T:System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.LengthPropertyConfiguration" /> 
        // class with the same settings as another configuration.
        // </summary>
        // <param name="source">The configuration to copy settings from.</param>
        protected LengthPropertyConfiguration(LengthPropertyConfiguration source)
            : base(source)
        {
            Check.NotNull(source, "source");

            IsFixedLength = source.IsFixedLength;
            MaxLength = source.MaxLength;
            IsMaxLength = source.IsMaxLength;
        }
        protected LengthPropertyConfiguration(LengthPropertyConfiguration source)
            : base(source)
        {
            //Contract.Requires(source != null);

            IsFixedLength = source.IsFixedLength;
            MaxLength = source.MaxLength;
            IsMaxLength = source.IsMaxLength;
        }
Ejemplo n.º 5
0
        internal override void CopyFrom(PrimitivePropertyConfiguration other)
        {
            base.CopyFrom(other);
            LengthPropertyConfiguration propertyConfiguration = other as LengthPropertyConfiguration;

            if (propertyConfiguration == null)
            {
                return;
            }
            this.IsFixedLength = propertyConfiguration.IsFixedLength;
            this.MaxLength     = propertyConfiguration.MaxLength;
            this.IsMaxLength   = propertyConfiguration.IsMaxLength;
        }
        private LengthPropertyConfiguration Cloning_a_length_property_configuration_clones_its_property_information(
            LengthPropertyConfiguration configuration)
        {
            configuration.IsFixedLength = true;
            configuration.IsMaxLength   = true;
            configuration.MaxLength     = 77;

            var clone = (LengthPropertyConfiguration)
                        Cloning_a_primitive_property_configuration_clones_its_property_information_implementation(configuration);

            Assert.True(clone.IsFixedLength.Value);
            Assert.True(clone.IsMaxLength.Value);
            Assert.Equal(77, clone.MaxLength);

            return(clone);
        }
Ejemplo n.º 7
0
        internal override bool IsCompatible(
            PrimitivePropertyConfiguration other,
            bool inCSpace,
            out string errorMessage)
        {
            LengthPropertyConfiguration other1 = other as LengthPropertyConfiguration;
            bool flag1 = base.IsCompatible(other, inCSpace, out errorMessage);
            int  num1;

            if (other1 != null)
            {
                num1 = this.IsCompatible <bool, LengthPropertyConfiguration>((Expression <Func <LengthPropertyConfiguration, bool?> >)(c => c.IsFixedLength), other1, ref errorMessage) ? 1 : 0;
            }
            else
            {
                num1 = 1;
            }
            bool flag2 = num1 != 0;
            int  num2;

            if (other1 != null)
            {
                num2 = this.IsCompatible <bool, LengthPropertyConfiguration>((Expression <Func <LengthPropertyConfiguration, bool?> >)(c => c.IsMaxLength), other1, ref errorMessage) ? 1 : 0;
            }
            else
            {
                num2 = 1;
            }
            bool flag3 = num2 != 0;
            int  num3;

            if (other1 != null)
            {
                num3 = this.IsCompatible <int, LengthPropertyConfiguration>((Expression <Func <LengthPropertyConfiguration, int?> >)(c => c.MaxLength), other1, ref errorMessage) ? 1 : 0;
            }
            else
            {
                num3 = 1;
            }
            bool flag4 = num3 != 0;

            if (flag1 && flag2 && flag3)
            {
                return(flag4);
            }
            return(false);
        }
Ejemplo n.º 8
0
        internal override void MakeCompatibleWith(PrimitivePropertyConfiguration other, bool inCSpace)
        {
            base.MakeCompatibleWith(other, inCSpace);
            LengthPropertyConfiguration propertyConfiguration = other as LengthPropertyConfiguration;

            if (propertyConfiguration == null)
            {
                return;
            }
            if (propertyConfiguration.IsFixedLength.HasValue)
            {
                this.IsFixedLength = new bool?();
            }
            if (propertyConfiguration.MaxLength.HasValue)
            {
                this.MaxLength = new int?();
            }
            if (!propertyConfiguration.IsMaxLength.HasValue)
            {
                return;
            }
            this.IsMaxLength = new bool?();
        }
Ejemplo n.º 9
0
        internal override void FillFrom(PrimitivePropertyConfiguration other, bool inCSpace)
        {
            base.FillFrom(other, inCSpace);
            LengthPropertyConfiguration propertyConfiguration = other as LengthPropertyConfiguration;

            if (propertyConfiguration == null)
            {
                return;
            }
            if (!this.IsFixedLength.HasValue)
            {
                this.IsFixedLength = propertyConfiguration.IsFixedLength;
            }
            if (!this.MaxLength.HasValue)
            {
                this.MaxLength = propertyConfiguration.MaxLength;
            }
            if (this.IsMaxLength.HasValue)
            {
                return;
            }
            this.IsMaxLength = propertyConfiguration.IsMaxLength;
        }
 internal LengthColumnConfiguration(Properties.Primitive.LengthPropertyConfiguration configuration)
     : base(configuration)
 {
 }