使用方法
- 复制安装命令,在自己的智能体环境安装前先检查源码包。
- 从原始文档核对所需工具、凭据和支持的宿主。
- 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/dotnet/efcore --skill tooling开始前需了解
- 安装不包含模型订阅、API 额度或访问文件的权限。
- 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。
Tooling
The dotnet ef CLI and Visual Studio Package Manager Console commands for migrations, scaffolding, and compiled models.
dotnet-ef CLI (src/dotnet-ef/)
RootCommand parses global options. Subcommands implemented in src/ef/Commands/. Each invokes MSBuild to build, then shells out via dotnet exec ef.dll, which hosts OperationExecutor.
PMC (src/EFCore.Tools/)
PowerShell module: Add-Migration, Update-Database, Scaffold-DbContext, Optimize-DbContext, etc.
MSBuild Tasks (src/EFCore.Tasks/)
NuGet package Microsoft.EntityFrameworkCore.Tasks provides build/publish-time compiled model and precompiled query generation. Targets in buildTransitive/Microsoft.EntityFrameworkCore.Tasks.targets.
Command Option Ownership
Trace an option to the code that consumes it before changing command or operation contracts. The outer dotnet-ef launcher builds the project and forwards remaining command-line arguments to ef.dll; the inner command under src/ef/Commands/ parses command-specific options.
- Keep presentation-only behavior in the inner command. For example, suppressing the completion message from
MigrationsAddCommand.Execute()should guard itsReporter.WriteInformation()call and must not changeIOperationExecutor.AddMigration(). - Forward a value through
OperationExecutorBaseonly when the design-time operation inMicrosoft.EntityFrameworkCore.Designneeds it. - Treat PMC and
EFCore.Tasksas separate entry points. Change them only when the requested behavior applies to those surfaces too.
Testing
- CLI tests:
test/dotnet-ef.Tests/,test/ef.Tests/ - EFCore.Tasks has no dedicated test project — for task/target changes, create a test project and manually run
dotnet build/dotnet publishwithEFOptimizeContext=trueto verify
Validation
- For tool changes, create a test project and manually run affected commands to verify behavior
dotnet ef migrations scriptoutput matches expected DDL



