is is a special compiled construct in C # - you cannot put a variable as a type, you must write the actual type name.
If you want to check the exact type, use this:
if(entry.Value.GetType() == dataType)
If you want to check if it is inherited, you can use this:
if (entry.Value != null && dataType.IsAssignableFrom(entry.Value.GetType()))
source share