Introducing Razor Components and SignalR

We have so far seen a number of changes that have been introduced in ASP.NET Core 3 compared to previous versions of the framework, including the early-phase offerings of .NET Core. These have been mentioned in previous chapters through the use of our demo application, but it's now time to introduce what will be described by many as quite a significant introduction to ASP.NET Core 3: server-side Blazor, formerly known as Razor components.

In one section in Chapter 5Basic Concepts of ASP.NET Core 3: Part 2, we explored at client-side development using JavaScript. For many developers who are used to the strong typing and other syntax benefits that come with working on Microsoft tech stacks, Blazor comes to the rescue. Blazor is an alternative to JavaScript.

Blazor integrates with .NET Core as server-side Blazor, and WebAssembly as client-side Blazor, and makes it possible to actually run C# directly on the browser and fully replace JavaScript.

WebAssembly (abbreviated to Wasm), as defined on its official page, https://webassembly.org/, is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable target for the compilation of high-level languages such as C/C++/Rust (and, in our case, C#), enabling deployment on the web for client and server applications.

Client-side Blazor works exclusively from the client-side. Currently, in preview, there is a prospect of it being shipped with later versions of ASP.NET Core.

Server-side Blazor at this point relies on existing technology, SignalR. A brief introduction is worthwhile, and we will duly cover what you need to know about it in a later section.

You will learn how to build a simple Blazor application, and how it differs from normal ASP.NET Core 3. You will learn about the components that constitute a basic Blazor page. We finish the chapter by explaining logging and telemetry to help with debugging in production environments. You will learn about different options you have in logging important information for your application and you will learn how to configure your applications for logging using a file logger. 

You will learn how to configure your application so you can run it in different hosting environments, be it in development, staging, or production.

The following topics will be covered in this chapter:

  • Client-side development using C# Razor components
  • Working with SignalR
  • Using logging and telemetry for monitoring and supervision purposes
  • Building once and running on multiple environments
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.156.22