© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•9mo ago•
4 replies
LastExceed

✅ why does efcore maintain `ModelSnapshot.cs` on top of `{MIGRATION}.Designer.cs` ?

if i understand correctly, the former represents the "current" state, whereas the latter represents the state the DB should be in after the given migration was applied, and it is discouraged to manually edit either. but then doesn't that mean
ModelSnapshot.cs
ModelSnapshot.cs
is expected to always mirror the
.Designer.cs
.Designer.cs
of the latest migration? and if so, why bother generating a second file in the first place? can't efcore just look up the latest migration?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

error CS1061, error CS0105, CS0103
C#CC# / help
2y ago
Bunch of CS0246 and CS0234 errors.
C#CC# / help
2y ago
When editing A.resx, does VS use MSBuild to create A.Designer.cs? [Answered]
C#CC# / help
4y ago