Skip to content

Commit

Permalink
Use better way of detecting the Nullable underlying type.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanwin committed May 12, 2010
1 parent a4046e7 commit 44818c1
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -78,7 +78,7 @@ public virtual void SetValue(object instance, object value)
_memberReturnType.GetGenericTypeDefinition() == typeof(Nullable<>))
{
if(value!=null)
value = Convert.ChangeType(value, _memberReturnType.GetGenericArguments().First());
value = Convert.ChangeType(value, Nullable.GetUnderlyingType(valueType));
}
else if(code != TypeCode.Object)
value = Convert.ChangeType(value, _memberReturnType);
Expand Down

0 comments on commit 44818c1

Please sign in to comment.