Blazor WebAssembly Tutorial - Blazor WebAssembly API - Blazor WebAssembly CRUD

Coding Droplets
Coding Droplets
14.1 هزار بار بازدید - 2 سال پیش - Blazor Tutorial C# - Part
Blazor Tutorial C# - Part 10 is a Blazor WebAssembly Tutorial video. Also we explains about Blazor WebAssembly API by implementing APIs in Blazor Server Side and consuming those APIs from Blazor Client Side WebAssembly Application.

Learn Blazor with Coding Droplets. Below is the Blazor Tutorial Playlist Link:
Blazor Tutorial - Beginner to Advanced

WebAssembly Introduction:
WebAssembly Tutorial - What is WebAss...

Blazor is a web framework for building web UI components (Razor components) that can be hosted in different ways. Razor components can run server-side in ASP.NET Core (Blazor Server) versus client-side in the browser on a WebAssembly-based .NET runtime (Blazor WebAssembly, Blazor WASM). You can also host Razor components in native mobile and desktop apps that render to an embedded web view control (Blazor Hybrid). Regardless of the hosting model, the way you build Razor components is the same. The same Razor components can be used with any of the hosting models unchanged.

Blazor can run your client-side C# code directly in the browser, using WebAssembly. Because it's real . NET running on WebAssembly, you can re-use code and libraries from server-side parts of your application. Alternatively, Blazor can run your client logic on the server.

Blazor WebAssembly (WASM) apps run client-side in the browser on a WebAssembly-based .NET runtime. The Blazor app, its dependencies, and the .NET runtime are downloaded to the browser. The app is executed directly on the browser UI thread. UI updates and event handling occur within the same process. The app's assets are deployed as static files to a web server or service capable of serving static content to clients.

When the Blazor WebAssembly app is created for deployment without a backend ASP.NET Core app to serve its files, the app is called a standalone Blazor WebAssembly app. When the app is created for deployment with a backend app to serve its files, the app is called a hosted Blazor WebAssembly app.

Using hosted Blazor WebAssembly, you get a full-stack web development experience with .NET, including the ability to share code between the client and server apps, support for prerendering, and integration with MVC and Razor Pages. A hosted client app can interact with its backend server app over the network using a variety of messaging frameworks and protocols, such as web API, gRPC-web, and SignalR (Use ASP.NET Core SignalR with Blazor).

The blazor.webassembly.js script is provided by the framework and handles:
- Downloading the .NET runtime, the app, and the app's dependencies.
- Initialization of the runtime to run the app.

The Blazor WebAssembly (WASM) hosting model offers several benefits:
- There's no .NET server-side dependency after the app is downloaded from the server, so the app remains functional if the server goes offline.
- Client resources and capabilities are fully leveraged.
- Work is offloaded from the server to the client.
- An ASP.NET Core web server isn't required to host the app. Serverless deployment scenarios are possible, such as serving the app from a Content Delivery Network (CDN).

The Blazor WebAssembly hosting model has the following limitations:
- The app is restricted to the capabilities of the browser.
- Capable client hardware and software (for example, WebAssembly support) is required.
- Download size is larger, and apps take longer to load.

Blazor WebAssembly supports ahead-of-time (AOT) compilation, where you can compile your .NET code directly into WebAssembly. AOT compilation results in runtime performance improvements at the expense of a larger app size.

The same .NET WebAssembly build tools used for AOT compilation also relink the .NET WebAssembly runtime to trim unused runtime code resulting in a smaller app size and thus improved download speed.

Blazor WebAssembly includes support for trimming unused code from .NET Core framework libraries.The .NET compiler further precompresses a Blazor WebAssembly app for a smaller app payload.

Blazor WebAssembly apps can use native dependencies built to run on WebAssembly.

Blazor WebAssembly Consume Web API [Blazor WebAssembly with Web API]:
Using ASP.Net Core Hosted we are demonstrating the API calls in this video.

Video Chapters:
0:00 - Intro
1:44 - Project Creation
2:40 - ASP.Net Core Hosted
4:26 - Blazor WebAssembly App without ASP.Net Core Hosted
10:22 - Blazor WebAssembly App with ASP.Net Core Hosted
20:10 - API Implementation
25:10 - Consume API from Blazor WebAssembly App

#CodingDroplets #Blazor #BlazorWasm
2 سال پیش در تاریخ 1400/12/14 منتشر شده است.
14,154 بـار بازدید شده
... بیشتر