static void Main(string[] args) { // configure ioc var builder = new ContainerBuilder(); IocConfiguration.Configure(builder); var container = builder.Build(); var menu = new ApplicationMenu(); DocumentType?option = null; // handle the menu loop until a non-selection is entered while ((option = menu.DocumentSelectionLoop()) != null) { // using Service location to get us started with the document type selection var stateEngine = container.Resolve <Func <DocumentType, StateEngine> >()(option.Value); menu.ActionLoop(stateEngine); } }
static void Main(string[] args) { // configure ioc var builder = new ContainerBuilder(); IocConfiguration.Configure(builder); var container = builder.Build(); var menu = new ApplicationMenu(); DocumentType? option = null; // handle the menu loop until a non-selection is entered while((option = menu.DocumentSelectionLoop())!= null) { // using Service location to get us started with the document type selection var stateEngine = container.Resolve<Func<DocumentType, StateEngine>>()(option.Value); menu.ActionLoop(stateEngine); } }