3.1: Data
Last updated
Last updated
In this model will we set up our Note.cs class.
The entity model represents how we will set up data in our database. The properties we add to this class will be added as columns in our SQL table. This class will also be used by the service layer to persist data and query the database. More on that later.
In the Solution Explorer, right click on ElevenNote.Data.
Select Add -> Class and name it Note.cs
.
Make this class public. This will make it accessible to other assemblies.
Add the properties inside of class:
Now, above each of the properties, we need to add data annotations - we'll see more info about data annotations in the next module.
Click on one of the annotations and click on CTRL .
to bring in the using statement for the annotations: