From the course: Building Angular and ASP.NET Web API Apps

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Define application models

Define application models

- [Instructor] In ASP.NET, a model is a class that represents a database table where each property in the class matches a column in the table. In our app, we are going to have two tables. We are going to have a Users table, which is going to be used to basically just store user-related data because we need that when the user signs up, when the user logs in. But we are going to also store incomes and expenses, and since the only thing that changes in here is the type, so if something is an income or is an expense, we are going to create a table named Transactions. So, because we are going to have two tables in our database, it means that we need to create two models in our app. For that, let us go to Visual Studio. We are going to put all the models in a separate folder. For that, go to the Solution Explorer, then in here, right-click in the project, so Expenses.API. Then, go to Add and create a folder. Let us name this folder the Models. In the Models, now right-click, then go to Add.…

Contents