Created
April 11, 2015 08:16
-
-
Save dnasca/abec09c44d414fbcd2a9 to your computer and use it in GitHub Desktop.
Creating a Data layer - 1b.) Data Model Classes - Every Note can have a Reply
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| The second step in creating the data model class will be modeling the Reply. | |
| Each reply will have it's own Id, a body, created date, and a property that will point Entity to creating a foriegn key (TopicId) | |
| */ | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace Notes.Data | |
| { | |
| public class Reply | |
| { | |
| public int Id { get; set; } | |
| public string Body { get; set; } | |
| public DateTime Created { get; set; } | |
| //The way to get back to the topic that owns it. | |
| public int TopicId { get; set; } // Entity will see the Id and the name of another type, and create a foreign key index | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment