vendredi 20 octobre 2017

How to know if a Type exist in .Net Framework or It's Developer-Defined type (Programaticly)? [duplicate]

I am working with reflection. When I get some type's properties, I want to distinguish the properties that it's property type is in .NetFramework library or is defined by the developer.

For example I want a method that is called :

bool IsDotNetType(Type t)

and for example int, string, DateTime, List etc are .Net types, BUT Student is developer defined.

I have used IsPrimitive method, but it just works for int, bool, string, and when I pass it DateTime, it says that it is not primitive

Thanks.





Aucun commentaire:

Enregistrer un commentaire