Пример #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints => { endpoints.MapControllers(); });

            app.UseEndpoints((routes) => { routes.MapHub <ApplicationHub>("/aap"); });

            ManagerHub.SetContect(app.ApplicationServices.GetService <IHubContext <ApplicationHub> >());
        }
 public string Get(string id)
 {
     ManagerHub.Send("Update", id);
     return($"Total of:{ManagerHub.ConnectedIds.Count} clients received: [{id}]");
 }