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

后端 未结 1 1282
借酒劲吻你
借酒劲吻你 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<ICameraController>()
               .To<NikonCameraController>()
               .NamedLikeFactoryMethod((ICameraFactory f) => f.GetNikonCamera());
    
    0 讨论(0)
提交回复
热议问题