Creating a real-time opinion poll in SignalR
In this recipe, we will build a real-time opinion poll system that demonstrates SignalR’s ability to broadcast data instantly to multiple connected clients. Our poll will track votes between two classic gaming consoles. Anonymous users will be able to cast their votes and see the results update in real time across all connected clients.
A key feature of this implementation is how it leverages SignalR’s connection management to track unique clients without requiring user registration. This allows us to prevent duplicate voting while maintaining anonymity.
Getting ready
We will be using SQLite in this recipe. If you would like to take a look at the data we will be collecting, please download https://sqlitebrowser.org/.
Make sure you have the latest version of the EF Core CLI tools installed:
dotnet tool update --global dotnet-ef
Or you can install it for the first time as follows:
dotnet tool install --global...