How can I identify the dependencies between the two types only due to typeof composition using NDepend rules/API.
In the below example the type is dependent on UsedDependendType only through typeof(UsedDependendType), no other members are involved in the coupling.
class OnlyTypeOfDependencyBetweenTypes
{
public IEnumerable<Type> Initialize()
{
return new List<Type> {
typeof(UsedDependendType)
};
}
}
I am able to identify whether there are any members involved in the dependency between these types. But for confirming I need to know whether there is a call to typeof(UsedDependendType) is there or not.
Using NDepend API/CQL how can I identify the call typeof(UsedDependendType) in a method?
Regards Basanth
For now there is no way to segregate
typeof(TUsed)over other usages.You can try and maybe refine this query that list pairs of types
(t,tUsed)where there is no member involved in the dependency.