Search⌘ K
AI Features

Adding the Classes

Explore how to add the ExpenseType and Expense classes to your Blazor WebAssembly expense tracker. Learn to implement data annotations for validation on properties like date, vendor, expense type, and amount, ensuring a robust form structure.

We'll cover the following...

We need to add both an ExpenseType class and an Expense class. We do this as follows:

  1. Right-click the ExpenseTracker.Shared folder and select the “Add, Class” option from the menu.

  2. Name the new class ExpenseType.

  3. Click the “Add” button. ...