Blazor promises to:
- Share server-side and client-side app logic written in .NET.
- Render the UI as HTML and CSS for wide browser support, including mobile browsers.
Blazor apps can be hosted in one of the following ways:
- Client-side in the browser on WebAssembly.
- Server-side in an ASP.NET Core app.
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
- No server-side dependency, it works stand alone in the browser like a static site
- Client takes on more responsibility and does all the work
- Restricted by the capabilities and features of the browser
- Client needs to support WebAssembly and capable hardware and software that supports WebAssembly
- The size of payload of the app is bigger and thereby it takes longer to load the app
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.
- This model is much smaller and the app loads faster
- This runs on the server and can take full advantage of existing tooling and debugging
- This model can use full .Net, can use any .Net Core compatible .Net APIs
- Potential latency since every interaction is a network call
- No Offline mode given the dependency on the server
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 DevelopmentRead More