/// <summary> /// Maps a <see cref="PersistentConnection"/> with the default dependency resolver to the specified path. /// </summary> /// <param name="routes">The route table.</param> /// <param name="name">The name of the route.</param> /// <param name="url">path of the route.</param> /// <param name="type">The type of <see cref="PersistentConnection"/>.</param> /// <param name="configuration">Configuration options.</param> /// <param name="build">An action to further configure the OWIN pipeline.</param> /// <returns>The registered route</returns> public static RouteBase MapConnection(this RouteCollection routes, string name, string url, Type type, ConnectionConfiguration configuration, Action <IAppBuilder> build) { InitializeProtectedData(configuration); return(routes.MapOwinPath(name, url, map => { build(map); map.MapConnection(String.Empty, type, configuration); })); }
/// <summary> /// Initializes the hub route using specified configuration. /// </summary> /// <param name="routes">The route table.</param> /// <param name="name">The name of the route.</param> /// <param name="path">The path of the hubs route.</param> /// <param name="configuration">Configuration options.</param> /// <param name="build"></param> /// <returns>The registered route.</returns> internal static RouteBase MapHubs(this RouteCollection routes, string name, string path, HubConfiguration configuration, Action <IAppBuilder> build) { var locator = new Lazy <IAssemblyLocator>(() => new BuildManagerAssemblyLocator()); configuration.Resolver.Register(typeof(IAssemblyLocator), () => locator.Value); InitializeProtectedData(configuration); return(routes.MapOwinPath(name, path, map => { build(map); map.MapHubs(String.Empty, configuration); })); }