In general, the answer to the question "how to break circular links when performing dependency injection": "use property injection".
class Foo { public Foo() {}
With Funq, I think it will be a way to register this dependency.
container.Register<IBar>(c => { var foo = new Foo(); var bar = new Bar(foo); foo.Bar = bar; return bar; });
Also, I agree with Tim Rogers comment. When you have circular addiction, perhaps there is a problem in your design and you should take a look at it. This is not always wrong, but it often happens. However, the code you show is very abstract, and we cannot give you any feedback.
source share