Bug in Core.BusinessBase SetProperty?

Bug in Core.BusinessBase SetProperty?

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


Michael posted on Thursday, November 20, 2008

In version 3.5.2, passing in null for a string property is not coercing the new value to string.Empty. Is SetProperty:

if (newValue is string && newValue == null)

is evaluating as false, and skipping the Utilities.CoerceValue call. The problem is:

string s = null;
bool isString = s is string; // This is false


So, we really need to know if P is a string. This is working for me:

if (typeof(P) == typeof(string) && newValue == null)

Regards
Michael

RockfordLhotka replied on Thursday, November 20, 2008

Oh, that is nasty! Thanks for catching this!

Copyright (c) Marimer LLC