本文整理汇总了C#中SimpleInjector.Container.EnableHttpRequestMessageTracking方法的典型用法代码示例。如果您正苦于以下问题:C# Container.EnableHttpRequestMessageTracking方法的具体用法?C# Container.EnableHttpRequestMessageTracking怎么用?C# Container.EnableHttpRequestMessageTracking使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleInjector.Container
的用法示例。
在下文中一共展示了Container.EnableHttpRequestMessageTracking方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Register
public static void Register(Container container)
{
container.Register(typeof (IQueryHandler<,>), new[] {typeof (IQueryHandler<,>).Assembly});
container.Register(typeof (ICommandHandler<,>), new[] {typeof (ICommandHandler<,>).Assembly});
container.RegisterCollection(typeof (IHyperMediaState), typeof (IHyperMediaState).Assembly);
container.Register<IBoardState, BoardState>();
container.Register<IBoardTaskState, BoardTaskState>();
container.Register<IBoardColumnState, BoardColumnState>();
container.Register<ISlugService, SlugService>();
container.Register<ICommandDispatcher, CommandDispatcher>();
container.Register<IQueryDispatcher, QueryDispatcher>();
container.Register<ILinkFactory, LinkFactory>();
container.Register<IHyperMediaFactory, HyperMediaFactory>();
container.Register<IMappingService, MappingService>();
container.RegisterWebApiRequest<IDataContext, DataContext>();
container.RegisterWebApiControllers(GlobalConfiguration.Configuration);
container.EnableHttpRequestMessageTracking(GlobalConfiguration.Configuration);
container.RegisterSingleton<IRequestMessageProvider>(new RequestMessageProvider(container));
container.Register<IValidator<Board>, BoardValidator>();
container.Register<IValidator<BoardColumn>, BoardColumnValidator>();
container.Register<IValidator<BoardTask>, BoardTaskValidator>();
container.Verify();
GlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container);
}
示例2: ConfigureWebApp
public static void ConfigureWebApp(HttpConfiguration config, Container container)
{
var json = config.Formatters.JsonFormatter;
json.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
container.RegisterWebApiControllers(config);
container.EnableHttpRequestMessageTracking(config);
}