Seemingly circular dependencies causing issues with Castle Windsor

后端 未结 3 1351
隐瞒了意图╮
隐瞒了意图╮ 2020-12-21 12:52

I have a IUserService (and other services) that I am registering in bulk in my ServiceInstaller.cs:

  container.Register(
                AllTypes.FromAssemb         


        
3条回答
  •  误落风尘
    2020-12-21 13:50

    here's your scenario as I understand it:

    public class UserService
    {
       UserService(AuthenticationService a){}
    }
    
    public class AuthenticationService 
    {
       AuthenticationService (UserService a){}
    }
    

    How would you create instances of both classes, creating at most single instance of each class?

提交回复
热议问题