本文整理汇总了C#中IBuilder.UseSignalR方法的典型用法代码示例。如果您正苦于以下问题:C# IBuilder.UseSignalR方法的具体用法?C# IBuilder.UseSignalR怎么用?C# IBuilder.UseSignalR使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBuilder
的用法示例。
在下文中一共展示了IBuilder.UseSignalR方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configure
public void Configure(IBuilder app, ILibraryManager libManager, IApplicationShutdown shutdown)
{
var web = libManager.GetLibraryInformation("Runt.Web");
Console.WriteLine("Path: " + web.Path);
Console.WriteLine("Name: " + web.Name);
var fileSystem = new PhysicalFileSystem(Path.GetDirectoryName(web.Path));
app.UseServices(services =>
{
services.AddSignalR();
services.AddSingleton<IEditor, Editor>();
});
app.UseSignalR("/io", typeof(RuntConnection), new ConnectionConfiguration
{
EnableJSONP = false
});
app.UseDefaultFiles(new DefaultFilesOptions
{
FileSystem = fileSystem
});
app.UseStaticFiles(new StaticFileOptions
{
FileSystem = fileSystem,
ContentTypeProvider = contentTypeProvider,
ServeUnknownFileTypes = true
});
app.UseDirectoryBrowser(new DirectoryBrowserOptions
{
FileSystem = fileSystem
});
}
示例2: Configure
public void Configure(IBuilder app)
{
/* Error page middleware displays a nice formatted HTML page for any unhandled exceptions in the request pipeline.
* Note: ErrorPageOptions.ShowAll to be used only at development time. Not recommended for production.
*/
app.UseErrorPage(ErrorPageOptions.ShowAll);
app.UseServices(services =>
{
//Add all MVC related services to IoC.
services.AddMvc();
//Add all SignalR related services to IoC.
services.AddSignalR();
});
//Configure SignalR
app.UseSignalR();
//Serves static files in the application.
app.UseFileServer();
//Configure WebFx
app.UseMvc(routes =>
{
routes.MapRoute(
null,
"{controller}/{action}",
new { controller = "Home", action = "Index" });
routes.MapRoute(
null,
"api/{controller}/{action}",
new { controller = "Home", action = "Index" });
routes.MapRoute(
null,
"api/{controller}",
new { controller = "Home" });
});
}