using System.Reflection; using LoggingDemo.BusinessLogic; using StructureMap; namespace LoggingDemo { public class Bootstrapper { private static bool hasStarted; public void BootstrapStructureMap() { ObjectFactory.Initialize(x => { x.PullConfigurationFromAppConfig = false; x.Scan(y => { y.Assembly(Assembly.GetAssembly(typeof (IMyBusinessLogic))); y.WithDefaultConventions(); }); } ); } public static void Restart() { if (hasStarted) { ObjectFactory.ResetDefaults(); } else { Bootstrap(); hasStarted = true; } } public static void Bootstrap() { new Bootstrapper().BootstrapStructureMap(); } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)