Skip to content

Documentation Regarding Default Values in Migrations is Vague #5073

@sullivan-clarke

Description

@sullivan-clarke

Type of issue

Missing information

Description

Hello,
I hope this feedback finds you well. I was working on a task for a company project that required updating a few fields for our server entities. Upon updating these fields, I ran a migration to update the database. In this case, one of the new fields needed a default value which I assigned in the migration itself, but I was unsure if the default value would only be exclusively set for new records, or both the new records and existing ones.

I went to the documentation linked below in hopes of finding an answer, but I was unable to. After looking at other sources and doing some testing, I was able to find an answer to my question. However, I believe this documentation can be improved by adding a specific section that states adding a default value for a migration applies to both new and existing records. I could have missed it in the documentation, and I apologize if I did, but adding this (or making it clearer) would improve this documentation and help others to quickly find a reputable answer for questions similar to mine.

These Microsoft documentations have always been my go-to and I am sure they are for many others as well. They are extremely helpful, especially for .NET and EF Core related questions. If you see fit, I think it is in best interest to add this section or at least make it clearer, helping maintain Microsoft's documentations reputation of dependability and factuality. I hope this feedback is beneficial.

Best,
Sullivan Clarke

Page URL

https://learn.microsoft.com/en-us/ef/core/modeling/generated-properties?tabs=data-annotations

Content source URL

https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/modeling/generated-properties.md

Document Version Independent Id

ec833af2-275e-981f-689f-8c65edfc00cd

Platform Id

5c115c64-0ad3-cab9-6c04-da4d5b85e9e1

Article author

@AndriySvyryd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions