Hey, I'm trying to iterate over an Enumerable collection of mix of nullable types However I want to compare the nullable type with a intrinsic type such as string or decimal. i.e. Here is a snippet
<% foreach (PropertyInfo prop in this.Columns)
{ %>
<td>
<% var typeCode = Type.GetTypeCode(prop.PropertyType); %>
<%-- String Columns --%>
<% if (typeCode == TypeCode.String)
{ %> ....
prop.PropertyType is of type 'datetime?', however var typeCode is 'object'.So when i compare typeCode to TypeCode.String, it fails. Is there a way to resolve a nullable type to it's underlying type? , e.g resolve datetime? to datetime.