...

/

Building Components Using Blazor WebAssembly

Building Components Using Blazor WebAssembly

Learn about configuring the server and client for Blazor WebAssembly.

Now, we will reuse the same functionality in the Blazor WebAssembly project to clearly see the key differences. Since we abstracted the local dependency service in the INorthwindService interface, we can reuse all the components and that interface, and the entity model classes. The only part that needs to be rewritten is implementing the NorthwindService class. Instead of directly calling the NorthwindContext class, it will call a customer Web API controller on the server side, as shown in the figure:

Press + to interact
 Comparing implementations using Blazor Server and Blazor WebAssembly
Comparing implementations using Blazor Server and Blazor WebAssembly

Configuring the server for Blazor WebAssembly

First, we need a web service that the client app can call to get and manage customers. If we complete Building and Consuming Web Services, we will have customer service in the Northwind.WebApi service project that we could use. However, let’s build a customer Web API controller in the Northwind.BlazorWasm.Server project:

Warning: Relative ...