简体   繁体   English

温莎城堡FirstInterface()。Configure(c => c.LifeStyle.PerWebRequest)

[英]Castle Windsor FirstInterface().Configure(c=> c.LifeStyle.PerWebRequest)

I am Looking at ProDiner Sample MVC project. 我正在看ProDiner示例MVC项目。 I updated the Castle Windsor reference to 3 from 2. 我将温莎城堡的引用从2更新为3。

public static void RegisterAllFromAssemblies(string a)
    {
        IoC.Container.Register(
            AllTypes.FromAssemblyNamed(a).Pick().WithService
            .FirstInterface().Configure(c=> c.LifeStyle.PerWebRequest));
    }

The c.LifeStyle.PerWebRequest has a red squiggly saying c.LifeStyle.PerWebRequest有一个红色的蠕动的说法

Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement    

How do I fix this issue? 如何解决此问题?

Some of those method calls are now marked as obsolete. 这些方法调用中的一些现在已标记为过时。 This is the latest way of using the api: 这是使用api的最新方法:

container.Register(
    Castle.MicroKernel.Registration.Classes.FromAssemblyNamed(a)
    .WithServiceFirstInterface()
    .LifestylePerWebRequest()
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM