public static ICobMvc AddConsul(this ICobMvc web, Action <ConsulClientConfiguration> option) { web.ConfigureServices(services => { services.AddSingleton <IServiceRegistration, ConsulServiceRegistration>(p => new ConsulServiceRegistration(option)); //services.AddSingleton<ICobConfiguration, ConsulConfiguration>(); }); return(web); }
/// <summary> /// 添加WebSockets支持 /// </summary> /// <param name="web"></param> /// <returns></returns> public static ICobMvc AddCobWebSockets(this ICobMvc web) { web.ConfigureServices(services => { services.AddSingleton <ICobRequest, WebSocketCobRequest>(); services.AddSingleton <ServerWebSocketPool>(); //services.AddSingleton<ClientWebSocketPool>(); services.AddSingleton <ClientWebSocketPoolFactory>(); }); return(web); }