本文整理匯總了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);
}