NamedLikeFactoryMethod in Ninject Extensions Factory working in non-compliance with documentation

后端 未结 1 1287
借酒劲吻你
借酒劲吻你 2021-01-26 02:40

I have a small issue with my simple example.

I have simple factory interface:

public interface ICameraFactory
{
  ICameraController GetNikonCamera();
  I         


        
1条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-26 03:20

    You can use:

    this.kernel.Bind()
               .To()
               .NamedLikeFactoryMethod((ICameraFactory f) => f.GetNikonCamera());
    

    0 讨论(0)
提交回复
热议问题