Question

Is there a way to check if a type is implementing a generic type with certain generic parameters using NDepend?

The implemented interface property returns the generic type, but without specific generic parameters. So IList for example, instead I want to no if a certain type implements IList.

Était-ce utile?

La solution

You can write a query like:

from t in Types where t.Implement("System.Collections.Generic.IList<T>")
select t

but you cannot write a query like:

from t in Types where t.Implement("System.Collections.Generic.IList<System.Int32>") 
select t

So the answer is no to Is there a way to check if a type is implementing a generic type with certain generic parameters using NDepend?

This situation might evolve in the future, feel free to add request to the NDepend User Voice page.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top