Add support for dependency cycles detection for the code using dependency injection
Currently if code is made using dependency injection NDepend fails to detect cyclic dependencies. Sample code:
public interface Interface1
{
void Foo();
};
public interface Interface2
{
void Bar();
};
public class MyClass1 : Interface1
{
private Interface2 _interface2;
public MyClass1(Interface2 interface2)
{
_interface2 = interface2;
_interface2.Bar();
}
void Interface1.Foo()
{
}
}
public class MyClass2 : Interface2
{
private Interface1 _interface1;
public MyClass2(Interface1 interface1)
{
_interface1 = interface1;
_interface1.Foo();
}
public void Bar()
{
}
}
5
votes
Yahor
shared this idea