LoadProperty() not setting null strings to string.Empty?

LoadProperty() not setting null strings to string.Empty?

Old forum URL: forums.lhotka.net/forums/t/11915.aspx


Brad Rem posted on Friday, March 29, 2013

I have a string property in a read only child:

        public static readonly PropertyInfo<string> FaxProperty = RegisterProperty<string>(c => c.Fax);
        public string Fax
        {
            get { return GetProperty(FaxProperty); }
            private set { LoadProperty(FaxProperty, value); }
        }

And if I set that property to null, it stays null.

Fax = null;

// getting Fax then returns null instead of string.empty

In other classes, where SetProperty() is used, null strings are converted to string.empty.

Is this be design or is it a bug or am I doing something wrong?

Copyright (c) Marimer LLC