Database-first design derives C# entity classes from an existing database schema. The schema remains the source structure, while Entity Framework Core provides the data model used by the application. section 4.3.2 section 4.0
A practical EF Core workflow is:
- Install the EF Core packages and the dotnet-ef command-line tools. section 4.3.2
- Reverse-engineer the existing schema into C# entity classes with scaffolding. section 4.3.2
- Review the generated model and adjust it to application needs while keeping it aligned with database changes. section 4.3.2
> dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 6.0.11 > dotnet add package Microsoft.EntityFrameworkCore.Design --version 6.0.11
Install the SQL Server provider and EF Core design package before using database modeling features. section 4.3.2
> dotnet tool install --global dotnet-ef --version 6.0.11
Install the versioned dotnet-ef CLI globally, or omit the global switch to keep it project-specific. section 4.3.2
