Bug or feature in 2.0 ?

Apr 28, 2011 at 3:13 PM
Edited Apr 28, 2011 at 3:15 PM

When creating the database with a column definition like:

        [Nullable, SqlDbType(Size = 100)]
        string adressLine2;
        [StringLengthValidator(AllowNulls = true, Min = 2, Max = 100, ErrorMessage = "An address line that contains only 2 characters is considered invalid.")]
        public string AddressLine2
        {
            get { return adressLine2; }
            set { Set(ref adressLine2, value, () => AddressLine2); }
        }

Results in a NOT NULL database column AddressLine2. I know the Nullable attribute is redundant in this case and removing it results in a NULL column so it's not a big issue.
With kind regards,

Marcel Numeijer.

Coordinator
Apr 30, 2011 at 4:16 PM

Hi Marcel, 

Is fixed now, 

            if (FieldInfoAttributes(type, fi).OfType<NotNullableAttribute>().Any())                return false;
            if (FieldInfoAttributes(type, fi).OfType<NullableAttribute>().Any())                return false; // --> true

Copy paste is evil...

It will be in the github version ASAP, in the meanwhile if you find a more severe bug tell me to send you a fresh compilation. 

Thanks!

 

Olmo