I want use reflection for get properties type. this is my code
var properties = type.GetProperties();
foreach (var propertyInfo in properties)
{
model.
Change your code to look for nullable type, in that case take PropertyType as the first generic argument:
var propertyType = propertyInfo.PropertyType;
if (propertyType.IsGenericType &&
propertyType.GetGenericTypeDefinition() == typeof(Nullable<>))
{
propertyType = propertyType.GetGenericArguments()[0];
}
model.ModelProperties.Add(new KeyValuePair
(propertyType.Name,propertyInfo.Name));