Skip to content

Commit

Permalink
Merge pull request #97 from rhires/patch-2
Browse files Browse the repository at this point in the history
Fix minor typo
  • Loading branch information
natemcmaster committed Dec 21, 2015
2 parents a511bf5 + 0eb0cf1 commit a34c06a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/modeling/relationships.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ One to one relationships have a reference navigation property on both sides. The

When configuring the relationship with the Fluent API, you use the ``HasOne`` and ``WithOne`` methods.

When configuring the foreign key you need to specify the dependent entity type - notice the generic parameter provided to ``HasForeignKey`` in the listing below. In a one-to-many relationship it is clear that the entity with the reference navigation is the dependent and the one with the collection is the principal. But this is not so in a on-to-one relationship - hence the need to explicitly define it.
When configuring the foreign key you need to specify the dependent entity type - notice the generic parameter provided to ``HasForeignKey`` in the listing below. In a one-to-many relationship it is clear that the entity with the reference navigation is the dependent and the one with the collection is the principal. But this is not so in a one-to-one relationship - hence the need to explicitly define it.

.. literalinclude:: configuring/sample/EFModeling.Configuring.FluentAPI/Samples/Relationships/OneToOne.cs
:language: c#
Expand Down

0 comments on commit a34c06a

Please sign in to comment.