Building components using Blazor WebAssembly
Now we will build the same functionality using Blazor WebAssembly so that you can clearly see the key differences.
Since we abstracted the local dependency service in the INorthwindService
interface, we will be able to reuse all the components and that interface, as well as the entity model classes, and just rewrite the implementation of the NorthwindService
class and create a customer controller for its implementation to call for Blazor WebAssembly, as shown in the following diagram:
Figure 20.9: Comparing Blazor implementations using Server and WebAssembly
Configuring the server for Blazor WebAssembly
First, we need to build a service that the client app can call using HTTP:
Warning! All relative path references for projects and the database are two levels up, for example, "..\..\"
.
- In the Server project, open
NorthwindBlazorWasm.Server.csproj
, and add statements to reference...