Suppose I have access to the type of a field using reflection:
FieldInfo item;
Type type = item.FieldType;
I want to know if type
is a generic List
or not, How can I do that? I need something like as follows, But it does not work:
if (type == typeof(List<>))
Aucun commentaire:
Enregistrer un commentaire