void IMiddlewareRegisterSetting.Use(global::Owin.IAppBuilder builder) { ITypePath typePath = GlobalContainer.GetService <ITypePath>(); List <TypePathItem> items = typePath.Items.Where(i => i.TargetType.IsSubclassOf(typeof(ServiceUnitPersistentConnection))).ToList(); foreach (TypePathItem item in items) { PathMapResult pathconvert = PathMapper.Convert( item.Path, "/{ServiceUnitName}/{Version}/{Role}/Socket/{Name}Socket", "/{ServiceUnitName}/{Version}/{Role}/socket/{Name}"); if (pathconvert.Success) { builder.MapSignalR(pathconvert.MappedPath, item.TargetType, new ConnectionConfiguration()); } } }