Today we are going to learn how to create razor pages and how to send run time value to the razor page using Signal R Create a new .NET core web application Add Signal R library by, Add Client-Side Library dialog in the project, for Provider select "unpkg" and select the latest version from the drop down For Library, enter @aspnet/signalr@1, Add a new folder to the project named as Hubs The chat hub class inherits from HUb class that manages connections and messaging The send message is called to send the message to all the clients. MyHub.cs file contains the following code using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.SignalR; //using System.Threading.Tasks; namespace SignalRSample.Hubs { public class MyHub : Hub { public async Task SendMessage(string user, string message) { ...
Comments
Post a Comment