Does Funq IoC Container support property injection?

*爱你&永不变心* 提交于 2019-12-06 02:05:34

问题


I'm looking for an IoC container to use in my Compact Framework application. Trying out Funq I noticed that I can't find a way to do Property Injection with it.

I've looked through the discussion on the project's site and the unit tests for it, but I can't find any example of Property Injection.

Does Funq support Property Injection?


回答1:


Well wouldn't that generally go something like this?

myContainer.Register<IUserRepository>(() =>
    {
        var myRepository = new SomeUserRepository();
        myRepository.SomeProperty = someValue;

        return myRepository;
    });


来源:https://stackoverflow.com/questions/3139209/does-funq-ioc-container-support-property-injection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!