You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Append timestamp to scaffolded migration type names #36066
When a new migration is added, EF currently scaffolds a .NET type with the name of the migration. This leads to a variety of issues around the name being problematic in C#:
The type name happens to be the same as a .NET type. A very frequent case is when users do dotnet ef migrations add DateTime.
The C# compiler now raises warnings when a type name could conflict with a future keyword (i.e. all-lowercase name), see #35938.
Migration files already have their creation timestamp prefixed to the name, so that migrations are properly sorted on the filesystem. We can simply append the same timestamp to the type name inside: public class DateTime_20250512080000 {...}.
Activity
ef migrations add lc#35938 as a duplicate of this issueroji commentedon May 12, 2025
Tentatively proposing as a stretch goal in 10.
Use migration ID as scaffolded migration type name (#37841)