Microsoft Unity. How to specify a certain parameter in constructor?

后端 未结 5 1396
悲&欢浪女
悲&欢浪女 2020-12-23 09:36

I\'m using Microsoft Unity. I have an interface ICustomerService and its implementation CustomerService. I can register them for the Unity containe

5条回答
  •  盖世英雄少女心
    2020-12-23 10:36

    You can default the second parameter to the constructor (e.g., =null) or offer a single parameter constructor in addition to the two parameter constructor by overloading it.

提交回复
热议问题