2. Build Data Model
Build Data Model and Database
Let’s create an ADO.NET Entity Data Model named MealSuggestion. This is a simple structure of your database for dishes information.
Please refer to the Model First page of Microsoft for detailed instructions on how to create a model using EF.
Your model named Dish should have one entity with these fields.
- Id: integer property that is the primary key
- Name: string property for the name of a dish
- Breakfast: bool property indicating if a dish is for breakfast or not

Add Dishes
You can add some data for the Dishes table after creating the database and model. This will make testing in the next chapter (Build ManageDishes Window) easier because you will visually see the data populated instead of an empty data grid when you successfully connect the database to this app.
You can write a SQL script and run it or:
- Add a connection to your new database through the Server Explorer tab of Visual Studio.
- Connect and navigate to Tables>Dishes in the connection.
- Right-click on the Dishes table and find the Show Table Data option. You can add some data using that tab.
Media Attributions
- Dish entity