From the course: Building React and ASP.NET MVC 5 Applications

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Add data models for Entity Framework

Add data models for Entity Framework

From the course: Building React and ASP.NET MVC 5 Applications

Start my 1-month free trial

Add data models for Entity Framework

- [Narrator] For this project we need four models, customer, food item, water, and water details. The models are placed in this folder, models folder, The scaffolding has already created these models, but we need more than that. So, let's go ahead and create a model, it's basically a class, and name it customer. (keyboard typing) Okay, so, we need ID, email, and password. Let's type them in here. ID is an integer, ad let's also add the getter and setter. Public string, email, also getter and setter. Copy and paste, and one more. It will be password. Now, we also need another property for this class, which will be for confirm password. Now, this will not be in the database, so we will add the keyword not mapped. Let's go ahead and add the name space. For the table, this will be the key ID, also add the name space. So this class will create the table in the backend, database table, using Entity Framework. So the customer model is now created. We need three more models: Food item, order,…

Contents