structuremap4

ASP.Net MVC5 and StructureMap4 - Simplified Approach

只谈情不闲聊 提交于 2020-01-14 02:44:06
问题 While integrating StructureMap.MVC5 to an ASP.Net MVC5 web application, realized that it uses 3.1 version of SM and not 4+. Then tried taking the files included in this Nuget and changing it for SM4, but a lot of code was there and several incompatible calls across SM3.1 and SM4. With that, I ended up writing a simple IoC as below. Looking for advise on its shortfalls and what inefficiencies this have compared to the Nuget version linked here. Define Default Registry public class

How do you resolve instances of IInterceptionBehavior from the container when using StructureMap DynamicProxyInterceptor?

和自甴很熟 提交于 2019-12-08 03:30:11
问题 I'm migrating from Unity to StructureMap. I've made some use of Unity's InterceptionBehavior. I thought I could switch that to use StructureMap .InterceptWith and the DynamicProxyInterceptor but my interceptors have dependencies and I can't work out how to compose the interceptors using StructureMap. var container = new Container(x => { x.For<IMathService>().Use<MathService>() .InterceptWith(new DynamicProxyInterceptor<IMathService>(new IInterceptionBehavior[] { // I WANT TO COMPOSE THESE