Я исследую свойства объекта посредством отражения и продолжаю обработку типа данных каждого свойства. Вот мой (уменьшенный) источник:
private void ExamineObject(object o)
{
Type type = default(Type);
Type propertyType = default(Type);
PropertyInfo[] propertyInfo = null;
type = o.GetType();
propertyInfo = type.GetProperties(BindingFlags.GetProperty |
BindingFlags.Public |
BindingFlags.NonPublic |
BindingFlags.Instance);
// Loop over all properties
for (int propertyInfoIndex = 0; propertyInfoIndex <= propertyInfo.Length - 1; propertyInfoIndex++)
{
propertyType = propertyInfo[propertyInfoIndex].PropertyType;
}
}
Моя проблема в том, что мне недавно нужно обрабатывать свойства с возможностью NULL, но я не знаю, как получить тип свойства nullable.