本文整理汇总了C#中IContainer.WhatDoIHave方法的典型用法代码示例。如果您正苦于以下问题:C# IContainer.WhatDoIHave方法的具体用法?C# IContainer.WhatDoIHave怎么用?C# IContainer.WhatDoIHave使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IContainer
的用法示例。
在下文中一共展示了IContainer.WhatDoIHave方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application_Start
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
LoggingUtils.InitializeLogging(true);
Log.Info("Manufacturing API Starting");
Log.Debug("Loading Configuration...");
Bootstrapper
.With.StructureMap()
.And.ServiceLocator()
.LookForTypesIn.ReferencedAssemblies().Including
.Assembly(Assembly.GetAssembly(typeof(ApiContainer)))
.Start();
_container = (IContainer)Bootstrapper.Container;
GlobalConfiguration.Configuration.DependencyResolver = new StructureMapDependencyResolver(_container);
GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat;
GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc;
//This is just for intellisense when stepping through...
var what = _container.WhatDoIHave();
//Ensure our IoC is happy
_container.AssertConfigurationIsValid();
Log.Debug("IoC configuration is valid");
Log.Info("API Started");
}
示例2: Main
private static void Main(string[] args)
{
LoggingUtils.InitializeLogging(true);
Console.WriteLine("Loading Configuration...");
Bootstrapper.With.StructureMap()
.And.ServiceLocator()
.LookForTypesIn.ReferencedAssemblies()
.Including.Assembly(Assembly.GetAssembly(typeof(FrameworkContainer)))
.AndAssembly(Assembly.GetAssembly(typeof(DataCollectorContainer)))
.AndAssembly(Assembly.GetAssembly(typeof(DataPusherContainer)))
.AndAssembly(Assembly.GetAssembly(typeof(WorkerRole)))
.AndAssembly(Assembly.GetAssembly(typeof(FaclityDataProcessorContainer)))
//.With.StartupTasks()
.Start();
_container = (IContainer)Bootstrapper.Container;
//This is just for intellisense when stepping through...
var what = _container.WhatDoIHave();
//Ensure our IoC is happy
//_container.AssertConfigurationIsValid();
Log.Debug("IoC configuration is valid");
DisplayMenu();
}