Skip to content

Commit

Permalink
Update intro.md (#5869)
Browse files Browse the repository at this point in the history
`classnameID` (where `classname` is the name of the class, such as `Student`) as the primary key. In `classnameID`, `classname` is the name of the class, such as `Student` in
  • Loading branch information
Rick-Anderson authored Apr 4, 2018
1 parent 5c72ff3 commit 59c9061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aspnetcore/data/ef-rp/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Create a *Models* folder. In the *Models* folder, create a class file named *Stu

[!code-csharp[](intro/samples/cu/Models/Student.cs?name=snippet_Intro)]

The `ID` property becomes the primary key column of the database (DB) table that corresponds to this class. By default, EF Core interprets a property that's named `ID` or `classnameID` as the primary key.
The `ID` property becomes the primary key column of the database (DB) table that corresponds to this class. By default, EF Core interprets a property that's named `ID` or `classnameID` as the primary key. In `classnameID`, `classname` is the name of the class, such as `Student` in the preceding example.

The `Enrollments` property is a navigation property. Navigation properties link to other entities that are related to this entity. In this case, the `Enrollments` property of a `Student entity` holds all of the `Enrollment` entities that are related to that `Student`. For example, if a Student row in the DB has two related Enrollment rows, the `Enrollments` navigation property contains those two `Enrollment` entities. A related `Enrollment` row is a row that contains that student's primary key value in the `StudentID` column. For example, suppose the student with ID=1 has two rows in the `Enrollment` table. The `Enrollment` table has two rows with `StudentID` = 1. `StudentID` is a foreign key in the `Enrollment` table that specifies the student in the `Student` table.

Expand Down

0 comments on commit 59c9061

Please sign in to comment.