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

I am looking at an example MVC ProDiner project. I updated the Castle Windsor link to 3 of 2.

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

There is a reddish phrase in c.LifeStyle.PerWebRequest

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

How to fix this problem?

+4
source share
1 answer

Some of these method calls are now marked as deprecated. This is the last way to use api:

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

Source: https://habr.com/ru/post/1432604/


All Articles