From the course: Learning ASP.NET Core: MVC, Razor Pages, Web APIs & Other Foundations

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Challenge: Create a SignalR application

Challenge: Create a SignalR application

(bright, upbeat music) - [Instructor] It's now your turn to practice adding real time functionality to an app with SignalR. In this challenge, you'll create the start of a very basic sales dashboard. Users will have the ability to post the amount of new sales, and the largest sales will be pushed from the server to all clients and displayed in their browser. Start by creating a new Razor Pages application you'll use to send and receive real-time sales data. Add a new class to the project named SalesHub that will inherit from the built-in hub class. Add a method to the sales hub class named PostNewSale that will receive all new sales data and alert all clients if a new sale is greater than $1,000. On the site's homepage, add UI elements to allow users to submit new sales amounts and display the large sales received from the server. In order to make it all work, you know you'll need to add some JavaScript code. Add code to send new sales to the server and receive and display large…

Contents