Understanding Blazor
Blazor is a new framework available from .NET Core 3.1 onward to develop the frontend layer of the application. It's one of the alternatives to MVC and Razor Pages and the application model is very much close to SPA; however, instead of JavaScript, we can write the logic in C# and Razor syntax.
All the code that is written in Blazor is placed in something called a Razor component, which allows you to write the HTML as well the C# parts of the code to build any web page. A Razor component comes with an extension of .Razor
and is used to represent the application; be it the entire web page or a small dialog popup, everything is created as a component in Blazor applications. A typical Razor component looks like the one in the following code snippet:
@page '/counter' <h1>Counter</h1> <p>Current count: @currentCount</p> <button class='btn btn-primary' @onclick='IncrementCount'>Click me</button...