'Autofac Circular Component Dependency Detected' Error

后端 未结 2 770
慢半拍i
慢半拍i 2020-12-10 19:03

I am new to IoC and am using Autofac in my current project.

I have the following 2 classes:

public class UserService : IUserService
{
    private rea         


        
2条回答
  •  感动是毒
    2020-12-10 20:06

    Autofac has documentation on how to handle circular dependencies that might help here. You can get it to work if you follow the guidance there (which boils down to: make one of the dependencies a property rather than a constructor dependency).

提交回复
热议问题