Blazor is a new web framework that changes what is possible when building web apps with .NET. Blazor is a clientside web UI framework based on C# instead of JavaScript and with Blazor, you can write your client-side logic and UI components all in C#. The resulting application can be compiled into .NET assemblies and then run directly in the browser using a new open web standard called WebAssembly. Alternatively, Blazor can run your .NET UI components on the server and handle all UI interactions fluidly over a real-time connection with the browser. When run on the server, Blazor enables full-stack web development with .NET. Blazor builds on the foundations of .NET Core to providea modern and high performance web development experience.
Blazor promises to:
As a .Net Developer, you would probably prefer to write C# all the time instead of doing a bunch of context-switching between JavaScript and C#. Blazor gives us this opportunity. On top of that, you will be able to share code between backend and frontend given one of the hosting models
Blazor apps can be hosted in one of the following ways:
Learn to build a Blazor Server Application on top of a RESTful API for a book store’s database using ASP.NET Core 3.1 API, Entity Framework, the Repository Pattern End to End ASP.NET Core 3.1 API and Blazor Development
Blazor WebAssembly apps execute directly in the browser on a WebAssembly-based .NET runtime. In this mode, Blazor apps function similarly to front-end JavaScript frameworks like Angular or React.
In this hosting model approach, we have two different processes: one that tends to components and one that tends to UI updates. In this model, the components are run on the Server and not client-side like the former hosting model. So for changes to reach the Server and thereby the components, there needs to be a real-time connection. This is accomplished through WebSockets and SignalR. It is pretty much built-in and no additional configuration is required.
Learn how to build a RESTful API and a Blazor client side application using ASP.NET Core 3.1 API, Entity Framework, the Repository Pattern in End to End ASP.NET Core 3.1 API and Blazor Development