Why won't Ninject resolve protected properties in a base class?

后端 未结 2 1433
南方客
南方客 2021-01-18 16:02

Simple question I guess, but I\'ve spent an hour trying to get a base class for my controllers to have a few services injected via property injection. The properties were s

2条回答
  •  佛祖请我去吃肉
    2021-01-18 16:30

    Pretty sure the InjectNonPublic flag on the NinjectSettings allows you to configure it to do what you want - closest link I can find quickly

    Whether it's going to be supported for any significant length of time, I don't know - injecting privates is just a bad idea (along with Property Injection and associated scoundrels :P)

提交回复
热议问题