Validate ASP.NET Core SignalR refactoring

Completed

In this unit, you'll validate that the refactoring was a success by running the code with the applied changes. Now that you're on the signalr branch and you've learned what the various refactorings include, you should expect the app to function as it did before.

Important

You might have noticed that there were additional changes introduced in the signalr branch. These changes are beyond the scope of the module, and they're to help further emulate an ordering system.

Run the application

Now that you're familiar with what code was refactored, and you're on the signalr branch, you'll build and run the application again to verify that it's functionally equivalent. From the .NET CLI, use the dotnet run command:

dotnet run --project ./BlazingPizza.Server/BlazingPizza.Server.csproj

This application is intended for learning purposes. When you're authenticated, you can register any email address. While you're actively developing the app, you can complete the registration process by selecting a link to confirm your account, without having to validate the email address. For more information, see Blazor workshop: Register a user and log in.

Place a pizza order

After you've logged in, you can place an order for pizza. Select a pizza, choose the toppings, and add them to the order. As an example, consider the following image:

Screenshot of the Blazing Pizza window for adding extra toppings to a pizza order.

After you add extra toppings to your order, place it by selecting the Order button.

Screenshot of the Blazing Pizza window for placing order.

Immediately after you've created the order, the app redirects to the order status page. This page displays the various order status details sequentially, from Preparing to Out for delivery and, finally, Delivered. While the order is Out for delivery, the live map updates by incrementally emulating the delivery driver's location.

Consider the following series of images, which display on the live map a progression from the starting location to the ending location:

Preparing order Screenshot of the Blazing Pizza 'My Orders' window with an order status of 'Preparing'.

Out for delivery 1 Screenshot of the 'My Orders' window with an order status of 'Out for delivery'. The live map shows that the driver is just leaving.

Out for delivery 2 Screenshot of the 'My Orders' window with an order status of 'Out for delivery'. The live map shows that the driver has gone about a quarter of the way.

Out for delivery 3 Screenshot of the 'My Orders' window with an order status of 'Out for delivery'. The live map shows that the driver has gone about halfway.

Out for delivery 4 Screenshot of the 'My Orders' window with an order status of 'Out for delivery'. The live map shows that the driver has gone about three quarters of the way.

Out for delivery 5 Screenshot of the 'My Orders' window with an order status of 'Out for delivery'. The live map shows that the driver has arrived at the destination.

Finally, the order status page reflects the Delivered order status:

Screenshot of the 'My Orders' window with an order status of 'Delivered'. The live map shows that the driver has arrived at the delivery location.

Stop the application

The console should output various logs, letting you know that the app has successfully built and that it's serving content at https://localhost:5001/. To stop the application, close the browser and, from the command line session, select Ctrl+C.

Refactor knowledge check

1.

What statement is most accurate about the OrderStatusHub class?

2.

Why was SignalR a preferred alternative to client-side polling?

3.

With a SignalR connection, which of the following statements is true?

4.

As part of the refactor, what parts of the code had to change?