dotnet / dotnet/EntityFramework.Docs

Mention an Example of Optional Relationship

Open
#2,752 0 comments 0 reactions 1 assignee Claimed by @AndriySvyryd View on GitHub
area-model-building
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

In the section on Required and Optional Relationships where you show the IsRequired() method, it might help newbies to explain the different effect of required and optional by stating something like "required would mean that a post can't exist without a blog and optional would mean that a post can exist on its own, without being tied to a blog." Also that this only affects EF COre persistence, not your business logic.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 24b2b50e-35f8-9e0b-8ce5-840e1ea816e6
* Version Independent ID: 9e0e6e2c-48fa-76c3-3bd9-813a6df22645
* Content: [Relationships - EF Core](https://docs.microsoft.com/en-us/ef/core/modeling/relationships?tabs=fluent-api%2Cfluent-api-simple-key%2Csimple-key#required-and-optional-relationships)
* Content Source: [entity-framework/core/modeling/relationships.md](https://github.com/dotnet/EntityFramework.Docs/blob/master/entity-framework/core/modeling/relationships.md)
* Product: **entity-framework**
* Technology: **entity-framework-core**
* GitHub Login: @AndriySvyryd
* Microsoft Alias: **avickers**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.