Bongani  Ngema

Bongani Ngema

1615793760

Blazor: Switching Server and WebAssembly At Runtime

ASP.NET Core Blazor is a web framework designed to run client-side in the browser on a WebAssembly-based .NET runtime (Blazor WebAssembly) or server-side in ASP.NET Core (Blazor Server), but these two models  cannot be used at the same time. More information about hosting models is available  in the documentation.

This article describes how to

  • run Server and WebAssembly simultaneously in one application,
  • switch from Server to WebAssembly in runtime without reloading the application,
  • implement universal Cookie-based authentication mechanism,
  • sync Server and WebAssembly state using gRPC.

Introduction: why we need it

Both hosting models have their pros and cons:

Blazor Server pros:

  • Small size of resources to download (~250 KB).
  • Fast loading.
  • Responsive UI.

Blazor Server cons:

  • Since DOM changes are calculated on the server, a responsive UI needs a reliable and fast connection to the server.
  • If the connection is broken, the application in the browser will stop working.
  • If the server is restarted, the browser application will stop working and the interface state will be lost.
  • Difficult to scale, as the client will only work with the server that stores its state.

#blazor #webassembly #grpc #aspnetcore

What is GEEK

Buddha Community

Blazor: Switching Server and WebAssembly At Runtime

CRUD App Using Blazor And Entity Framework Core in ASP.NET Core

https://youtu.be/5xG9J6OqdV8

#blazor #blazor tutorial #blazor in c# #blazor crud #blazor webassembly #blazor with asp.net core

CRUD App Using Blazor And Entity Framework Core in ASP.NET Core

https://youtu.be/5xG9J6OqdV8

#blazor #blazor in c# #blazor tutorial #blazor webassembly #blazor crud #blazor with asp.net core

Blazor : Calling REST API ASP NET Core Blazor | WEB API

#blazor #blazor tutorial #blazor curd #blazor in c# #blazor webassembly

Call POST API ASP NET Core Blazor | Blazor CRUD using API Part-1

#blazor #blazor tutorial #blazor curd #blazor in c# #blazor webassembly

CRUD App Using Blazor And Entity Framework Core in ASP.NET Core

#blazor #blazor tutorial #blazor curd #blazor in c# #blazor webassembly