-
Book Overview & Buying
-
Table Of Contents
Web Development with Blazor - Fourth Edition
By :
There are two data classes we need to create:
The API data classes describe our business domain, not how we store the data. In our case, these will be almost identical. These API-facing data classes are typically referred to as Data Transfer Objects (DTOs) and are shared between the server and the client. This is one of the powers of having the same language in both frontend and backend. In contrast, in a JS framework, we would have to create copies of the data objects: once in C# for the backend and again in TypeScript or JavaScript for the frontend. As we will see later in the book, sharing the same logic and, more importantly, the validation logic has its upsides.
We will place the database classes in the BlazorWebApp project because we only need to communicate with the database when running on the server. Then we need another project to share between the client and server. The BlazorWebApp.Client...