-
Book Overview & Buying
-
Table Of Contents
Blazor WebAssembly by Example - Third Edition
By :
You can build a standalone Blazor WebAssembly client that works with an ASP.NET Core Web API in a multi-project solution that persists data in a SQL Server database using Entity Framework Core.
In this chapter, you learned why CORS is required when the client and API run as separate projects during development, how to configure a named CORS policy, and how to use the HttpClient service and its JSON helper methods to send GET, POST, PUT, and DELETE requests to a web API. Finally, you learned how to use Endpoint Explorer and .http files to test an API.
You created a solution that contains three projects: a Blazor WebAssembly client for the user interface, an ASP.NET Core Web API for endpoints and data access, and a shared class library for the TaskItem model used by both projects. Next, you created the API controller, configured the SQL Server connection string, and used Entity Framework Core migrations to create the database. You also used Visual Studio's .http files and Endpoints...