dotnet / dotnet/EntityFramework.Docs

Document dehavior around default value handling, .NET type defaults and sentinel values

Open
#5,057 1 comment 1 reaction 0 assignees View on GitHub
area-change-tracking area-model-building
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

An extremely common issue is users getting confused about EF's behavior around default values: they e.g. set a default true value for a bool property, and are then surprised by not being to insert false.

Our documentation on [generated values](https://learn.microsoft.com/en-us/ef/core/modeling/generated-properties?tabs=data-annotations) doesn't explain how this all works, and although there are some bits and pieces in the change tracking section, we're missing a simple, basic section that users would find and understand. EF 8.0 also added the ability to configure the sentinel value, but apart from the [what's new section](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-8.0/whatsnew#sentinel-values-and-database-defaults) this has not been documented.

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.