A simple real-time chat app created using MVC/SignalR.
Does not work, see https://github.com/reddtoric/MySigRChat for a working chat app
This project is for learning purposes.
I followed Chat app using ASP.NET core SignalR with User identity
Video's src code
A few differences from the video:
- VS 2019
- Project name; SigRChat
Id
instead ofID
(in Models/Message.cs)Username
instead ofUserName
(in Models/Message.cs & all occurrences within project)UserId
instead ofUserID
(in Models/Message.cs)@ViewBag.CurrentUsername
instead of@ViewBag.CurrentUserName
(in Views/Home/Index.cshtml)Timestamp
instead ofwhen
(in Models/Message.cs & Views/Home/Index.cshtml & in JS files)- Obsolete:
VS suggested alternative:
{ route.MapHub<ChatHub>("/Home/Index"); });
endpoints.MapHub<ChatHub>("/Home/Index");
withinapp.UseEndpoints()
- Code snippet he skipped in Data/ApplicationDbContext.cs:
public DbSet<Message> Messages { get; set; }
- Code snippet he skipped in Models/Message.cs
{ Timestamp = DateTime.Now; }```
- changed font for typographic readability