是否Funq IOC容器支持财产注射?容器、财产、Funq、IOC

由网友(耍酷是爷的资本)分享简介:我在寻找一个IoC容器我Compact Framework的应用程序中使用。试行Funq我注意到,我无法找到一个方法来做到物业注射用它。 I'm looking for an IoC container to use in my Compact Framework application. Trying out Fu...

我在寻找一个IoC容器我Compact Framework的应用程序中使用。试行Funq我注意到,我无法找到一个方法来做到物业注射用它。

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.

是否Funq支持地产注入?

Does Funq support Property Injection?

推荐答案

嗯那不是一般要这样呢?

Well wouldn't that generally go something like this?

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

        return myRepository;
    });
阅读全文

相关推荐

最新文章