本文整理汇总了C#中IApplicationBuilder.UseBolt方法的典型用法代码示例。如果您正苦于以下问题:C# IApplicationBuilder.UseBolt方法的具体用法?C# IApplicationBuilder.UseBolt怎么用?C# IApplicationBuilder.UseBolt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IApplicationBuilder
的用法示例。
在下文中一共展示了IApplicationBuilder.UseBolt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configure
public void Configure(IApplicationBuilder app)
{
app.ApplicationServices.GetRequiredService<ILoggerFactory>().AddConsole(LogLevel.Information);
app.UseBolt(
b =>
{
b.Use<ITestContract, TestContractImplementation>();
});
}
示例2: Configure
protected override void Configure(IApplicationBuilder appBuilder)
{
appBuilder.UseBolt(h =>
{
h.Use<IFiltersContract, FiltersContract>();
});
}
示例3: Configure
protected override void Configure(IApplicationBuilder appBuilder)
{
appBuilder.UseBolt(
b =>
{
// we are using IDummy inteface on server and IDummyAsync on client, calls should be properly mapped
MockInstanceProvider instanceProvider = new MockInstanceProvider { CurrentInstance = Contract.Object };
b.Use<IDummy>(instanceProvider);
});
}
示例4: Configure
protected override void Configure(IApplicationBuilder appBuilder)
{
appBuilder.UseBolt(h =>
{
h.Use<ITestContract>(InstanceProvider);
});
}
示例5: Configure
protected override void Configure(IApplicationBuilder appBuilder)
{
appBuilder.UseBolt(h => h.Use<IStreamingService>(InstanceProvider, c =>
{
c.Use<HandleErrorMiddleware>();
c.Use<StreamingMiddleware>();
c.Use<SerializationMiddleware>();
c.Use<InstanceProviderMiddleware>();
c.Use<ActionInvokerMiddleware>();
}));
}
示例6: Configure
protected override void Configure(IApplicationBuilder appBuilder)
{
appBuilder.UseBolt(h =>
{
Factory = new MemorySessionFactory(h.Configuration.Options);
IContractInvoker contract = h.UseSession<ITestContractStateFull, TestContractStateFull>(Factory);
InstanceProvider = (SessionInstanceProvider)contract.InstanceProvider;
});
}
示例7: Configure
protected override void Configure(IApplicationBuilder appBuilder)
{
DistributedCache = new Mock<IDistributedCache>(MockBehavior.Strict);
DistributedSessionStore store = new DistributedSessionStore(
DistributedCache.Object,
appBuilder.ApplicationServices.GetRequiredService<ILoggerFactory>());
appBuilder.UseBolt(
h =>
{
h.UseDistributedSession<IDummyContract, DummyContract>(store);
});
}