What conventions/idioms/patterns are you using configuring IOC Containers using the new Fluent Interfaces

后端 未结 4 1504
孤独总比滥情好
孤独总比滥情好 2021-02-06 11:13

I am in the middle of moving over a large body of code to Castle Trunk which includes the new fluent interface for configuring the container. Since the project has a huge windso

4条回答
  •  爱一瞬间的悲伤
    2021-02-06 12:07

    Take a deeper look at StructureMap 2.5. It offers several features to dramatically reduce the work to bootstrap the IOC container. It offers a convention over configuration technique (see the blog entries below)

    See the following recent blog posts from Jeremy Miller (author of StructureMap)

    Create your own Auto Registration Convention with StructureMap

            // Example from the blog post above
            var container = new Container(registry =>
            {
                registry.Scan(x =>
                {
                    x.TheCallingAssembly();
                    x.With();
                });
            });
    

    StructureMap 2.5.2 is Released

提交回复
热议问题