问题
Going by this answer, I know that an ASP.NET Core project must have a data model and a database schema, if it has a database.
For months, I thought the data model resided in a Context class that inherited from DbContext. But I've come cross a tutorial that says this class is where the Schema lives.
Where does the Data Model and Schema get declared for ASP.NET Core projects?
回答1:
It uses EF Core (an O/RM). It uses metadata mapping to define that database schema based on the domain model.
来源:https://stackoverflow.com/questions/50142503/in-what-files-are-the-data-model-and-schema-declared-in-asp-net-core-projects