samedi 8 août 2020

How to check if ParameterInfo.ParameterType is a List type?

So I have this problem - I check like so:

                    var pt = param.ParameterType;
                    var inn = (pt == null);
                    var il = pt is IList;
                    var ig = pt.IsGenericType;
                    var igp = pt.IsAssignableFrom(typeof(List<>));

Yet I get that ParameterInfo.ParameterType is not a list even when debugger says so: enter image description here

So how to check if ParameterInfo.ParameterType is a List type?





Aucun commentaire:

Enregistrer un commentaire