Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch-ups to the "relationships" documentation #4310

Merged
merged 1 commit into from
Apr 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions entity-framework/core/modeling/relationships/many-to-many.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ Nothing needs to be changed in the `UsingEntity` call, since the navigations to
-->
[!code-csharp[ManyToManyWithJoinClassConfig](../../../../samples/core/Modeling/Relationships/ManyToMany.cs?name=ManyToManyWithJoinClassConfig)]

The navigations can be configured explicitly for cases where the they cannot be determined by convention. For example:
The navigations can be configured explicitly for cases where they cannot be determined by convention. For example:

<!--
protected override void OnModelCreating(ModelBuilder modelBuilder)
Expand Down Expand Up @@ -442,7 +442,7 @@ Nothing needs to be changed in the `UsingEntity` call, since the navigations to
-->
[!code-csharp[ManyToManyWithNavsToAndFromJoinClassConfig](../../../../samples/core/Modeling/Relationships/ManyToMany.cs?name=ManyToManyWithNavsToAndFromJoinClassConfig)]

The navigations can be configured explicitly for cases where the they cannot be determined by convention. For example:
The navigations can be configured explicitly for cases where they cannot be determined by convention. For example:

<!--
protected override void OnModelCreating(ModelBuilder modelBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ When `[ForeignKey]` is placed on a navigation and the name provided does not mat

## DeleteBehaviorAttribute

[By convention](xref:core/modeling/relationships/conventions), EF uses the the `ClientSetNull` <xref:Microsoft.EntityFrameworkCore.DeleteBehavior> for optional relationships, and the `Cascade` behavior for required relationships. This can be changed by placing the <xref:Microsoft.EntityFrameworkCore.DeleteBehaviorAttribute> on one of the navigations of the relationship. For example:
[By convention](xref:core/modeling/relationships/conventions), EF uses the `ClientSetNull` <xref:Microsoft.EntityFrameworkCore.DeleteBehavior> for optional relationships, and the `Cascade` behavior for required relationships. This can be changed by placing the <xref:Microsoft.EntityFrameworkCore.DeleteBehaviorAttribute> on one of the navigations of the relationship. For example:

<!--
public class Blog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ So, for the relationship in this example:
This relationship is [discovered by convention](xref:core/modeling/relationships/conventions). That is:

- `Blog` is discovered as the principal in the relationship, and `Post` is discovered as the dependent.
- `Post.BlogId` is discovered as a foreign key of the dependent referencing the `Blog.Id` primary key of the the principal. The relationship is discovered as required because `Post.BlogId` is not nullable.
- `Post.BlogId` is discovered as a foreign key of the dependent referencing the `Blog.Id` primary key of the principal. The relationship is discovered as required because `Post.BlogId` is not nullable.
- `Blog.Posts` is discovered as the collection navigation.
- `Post.Blog` is discovered as the reference navigation.

Expand Down
2 changes: 1 addition & 1 deletion entity-framework/core/modeling/relationships/one-to-one.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ So, for the relationship in this example:
This relationship is [discovered by convention](xref:core/modeling/relationships/conventions). That is:

- `Blog` is discovered as the principal in the relationship, and `BlogHeader` is discovered as the dependent.
- `BlogHeader.BlogId` is discovered as a foreign key of the dependent referencing the `Blog.Id` primary key of the the principal. The relationship is discovered as required because `BlogHeader.BlogId` is not nullable.
- `BlogHeader.BlogId` is discovered as a foreign key of the dependent referencing the `Blog.Id` primary key of the principal. The relationship is discovered as required because `BlogHeader.BlogId` is not nullable.
- `Blog.BlogHeader` is discovered as a reference navigation.
- `BlogHeader.Blog` is discovered as a reference navigation.

Expand Down