Is it possible when looking at a class\' properties to detect if any of them is a reference type.
Take below as an example:
public class Client
{
All properties in your example return objects, as everything is an object in .NET; int
and bool
are objects. If you mean a reference type, as opposed to value types, then you can do the following:
foreach (PropertyInfo pi in typeof(Client).GetProperties()) {
if (pi.PropertyType.IsClass) {
// reference type
// DoMyFunkyStuff
}
}