-
Book Overview & Buying
-
Table Of Contents
Web Development with Blazor - Fourth Edition
By :
In the previous editions of this book, we built two versions of the blog, one for the Blazor server and one for Blazor WebAssembly. In this edition, the whole point is that we don't have to choose one over the other.
As previously mentioned, there are two projects, BlazorWebApp and BlazorWebApp.Client. In the client project, we add all the components we want to be able to run as WebAssembly. Here is the really cool part. If we are running it as InteractiveAuto or InteractiveWebAssembly, it will first render on the server, using the configuration found in the BlazorWebApp project. But the next time the site runs, it will load the WebAssembly version and use the configuration in the BlazorWebApp.Client project.
So, the same component can use a different dependency injection. In one case, it will use direct data access, and in the other, it will use the API client we created in the previous chapter.
As mentioned, the server...