Adding the API Controllers
Learn how to add API controllers to our Blazor WebAssembly app.
We'll cover the following
We need to add an API controller for each of the new classes. We do this as follows:
Right-click the
ExpenseTracker.Server.Contollers
folder and select the “Add, Controller” option from the menu.Select the “API Controller with actions, using Entity Framework” option.
Click the “Add” button.
Set
Model
class toExpenseType (ExpenseTracker.Shared)
.Click the “Add data context” button to open the “Add Data Context” dialog:
Get hands-on with 1400+ tech skills courses.