© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
9 replies
Bordin

SignalR

Hi, I am trying to create a Notification feature for my application and I figured it should be Real-time. Which is why i am trying to use SignalR but i don't quite understand it.
I made a notification hub
using Microsoft.AspNetCore.SignalR;
using System.Threading.Tasks;
namespace LebUpwork.Api.Hubs
{
    public class NotificationHub : Hub
    {
        public async Task SendNotification(string user, string message)
        {
            await Clients.All.SendAsync("ReceiveNotification", user, message);
        }
    }
}
using Microsoft.AspNetCore.SignalR;
using System.Threading.Tasks;
namespace LebUpwork.Api.Hubs
{
    public class NotificationHub : Hub
    {
        public async Task SendNotification(string user, string message)
        {
            await Clients.All.SendAsync("ReceiveNotification", user, message);
        }
    }
}

So, i really dont understand what a hub is and i have read and asked chatgpt but i can't figure it out. What's a user? what's a message? how does it know who the client is? i really dont understand anything

I added the hub in program.cs btw so that step is done. I just dont know how that is supposed to send notifications because apparently it shouldn't return anything.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

SignalR
C#CC# / help
11mo ago
✅ SignalR
C#CC# / help
13mo ago
Signalr
C#CC# / help
15mo ago
❔ SignalR
C#CC# / help
3y ago