Last active
August 29, 2015 14:00
-
-
Save Pondidum/11462998 to your computer and use it in GitHub Desktop.
Structuremap Factory Configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class InternalRegistry : Registry | |
| { | |
| public InternalRegistry() | |
| { | |
| Scan(s => | |
| { | |
| s.TheCallingAssembly(); | |
| s.WithDefaultConventions(); | |
| s.AddAllTypesOf<IViewRenderer>(); | |
| }); | |
| For<ViewRendererFactory>() | |
| .Use(x => new ViewRendererFactory(x.GetAllInstances<IViewRenderer>())); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ViewRendererFactory | |
| { | |
| private readonly IEnumerable<IViewRenderer> _renderers; | |
| public ViewRendererFactory(IEnumerable<IViewRenderer> renderers) | |
| { | |
| _renderers = renderers; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment