What is the easiest way to determine if a reflected property can be assigned a given value ?
The method signature of what I need is :
public static bool IsAssignable(PropertyInfo property, object value)
{
throw new NotImplementedException();
}
This method should work for value type and reference type and weither value is null or not.
Thanks for you help guys.
Manitra.
Thanks to Stefan’s and John responses, and the “Determine if a reflected property can be assigned null” question, here is the code I’ll use :
This works for all cases and in a pure loosely typed fashion.
Manitra.