Agent Skillsmanagedcode/dotnet-skills › entity-framework6

entity-framework6

GitHub

提供Entity Framework 6应用的维护与迁移指导,涵盖EDMX、ObjectContext等遗留模式审查,以及EF Core迁移决策。

catalog/Frameworks/Entity-Framework-6/skills/entity-framework6/SKILL.md managedcode/dotnet-skills

Trigger Scenarios

在EF6代码库上进行工作 决定保留EF6或迁移至EF Core 审查EDX或遗留数据访问层

Install

npx skills add managedcode/dotnet-skills --skill entity-framework6 -g -y
More Options

Non-standard path

npx skills add https://github.com/managedcode/dotnet-skills/tree/main/catalog/Frameworks/Entity-Framework-6/skills/entity-framework6 -g -y

Use without installing

npx skills use managedcode/dotnet-skills@entity-framework6

指定 Agent (Claude Code)

npx skills add managedcode/dotnet-skills --skill entity-framework6 -a claude-code -g -y

安装 repo 全部 skill

npx skills add managedcode/dotnet-skills --all -g -y

预览 repo 内 skill

npx skills add managedcode/dotnet-skills --list

SKILL.md

Frontmatter
{
    "name": "entity-framework6",
    "description": "Maintain or migrate EF6-based applications with realistic guidance on what to keep, what to modernize, and when EF Core is or is not the right next step. USE FOR: EF6 codebases; runtime versus ORM migration decisions; EDMX, code-first, ObjectContext, and legacy data-access review. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.",
    "compatibility": "Requires EF6 or a transition plan from EF6 to EF Core or modern .NET."
}

Entity Framework 6

Trigger On

  • working in an EF6 codebase on .NET Framework or modern .NET
  • deciding whether to keep EF6, move to modern .NET runtime, or port to EF Core
  • reviewing EDMX, code-first, or legacy ASP.NET/WPF/WinForms data access
  • planning a data layer migration strategy

Workflow

  1. Audit current EF6 usage before planning any migration. Identify which features the codebase depends on:

    // Common EF6-specific patterns to inventory:
    // - EDMX designer models (check for *.edmx files)
    // - ObjectContext vs DbContext usage
    // - Lazy loading with virtual navigation properties
    // - Database.SqlQuery<T>() for raw SQL
    // - Stored procedure mappings in model
    // - Spatial types (DbGeography, DbGeometry)
    
  2. Decide runtime vs ORM migration separately:

    Path When to use
    Keep EF6 on .NET Framework Legacy app with no runtime pressure
    EF6 on modern .NET Runtime upgrade needed, ORM migration too risky
    EF6 → EF Core Clean data layer, no EDMX, minimal stored-procedure mapping
  3. For maintenance work — keep EF6 stable:

    • use repository + unit of work patterns to isolate data access (see references/patterns.md)
    • prefer DbContext over ObjectContext for new code
    • use AsNoTracking() for read-only queries
    • configure concurrency tokens with [ConcurrencyCheck] or IsRowVersion()
  4. For migration work — validate each slice:

    • map EF6 features to EF Core equivalents (see references/migration.md)
    • migrate one bounded context at a time, not the entire data layer
    • run integration tests against the real database provider, not InMemory
    • verify: dotnet ef migrations add succeeds, queries produce equivalent results, lazy loading behavior matches expectations
  5. Do not promise EF Core features to EF6 codebases — EF6 is stable and supported but not on the innovation path. Keep expectations realistic.

Current Upstream Notes

  • The August 2026 EF Core vs EF6 comparison keeps the ORM migration decision separate from runtime modernization. EF6 remains supported but is not actively developed, and it can remain the right ORM when EDMX, ObjectContext, or complex legacy mappings dominate the risk.
  • EF Core v10.0.11 servicing does not make EF Core a drop-in replacement or change EF6 guidance by itself; move only when the project has a bounded migration slice and database-backed equivalence tests.
flowchart LR
  A["Audit EF6 usage"] --> B{"EDMX or complex mappings?"}
  B -->|Yes| C["High migration cost — consider keeping EF6"]
  B -->|No| D["Evaluate EF Core migration"]
  D --> E["Migrate one context at a time"]
  E --> F["Integration test against real DB"]
  C --> G["Modernize runtime only"]
  F --> H["Validate query equivalence"]
  G --> H

Deliver

  • realistic EF6 maintenance or migration guidance based on actual codebase audit
  • clear separation between runtime upgrade and ORM upgrade work
  • bounded migration slices with concrete validation checkpoints
  • reduced risk for legacy data access changes

Validate

  • EF6 feature inventory is complete before migration planning starts
  • migration assumptions are backed by real feature usage, not guesses
  • EF6-only features (EDMX, spatial types, ObjectContext patterns) are identified early
  • integration tests run against the real database provider, not mocks or InMemory
  • the proposed path avoids unnecessary churn in stable data access code

References

  • references/migration.md - decision framework, migration approaches, EF6-to-EF Core feature mapping, and common pitfalls
  • references/patterns.md - repository and unit of work patterns, query optimization, concurrency handling, auditing, and testing strategies for EF6 codebases

Version History

  • 0559476 Current 2026-08-19 23:31
  • 7ab7f03 2026-07-25 05:21

Same Skill Collection

catalog/Frameworks/gRPC/skills/grpc/SKILL.md
catalog/Frameworks/Official-Astro/skills/astro-developer/SKILL.md
catalog/Frameworks/Official-DotNet-ASPNetCore/skills/configuring-opentelemetry-dotnet/SKILL.md
catalog/Frameworks/Official-DotNet-ASPNetCore/skills/dotnet-webapi/SKILL.md
catalog/Frameworks/Official-DotNet-ASPNetCore/skills/minimal-api-file-upload/SKILL.md
catalog/Frameworks/Orleans/skills/orleans/SKILL.md
catalog/Frameworks/ThreeJS-WebGPU-TSL/skills/webgpu-threejs-tsl/SKILL.md
catalog/Libraries/Official-DotNet-Data/skills/optimizing-ef-core-queries/SKILL.md
catalog/Platform/Official-DotNet-Advanced/skills/csharp-scripts/SKILL.md
catalog/Platform/Official-DotNet-Advanced/skills/nuget-trusted-publishing/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/create-blazor-project/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/fetch-and-send-data/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/support-prerendering/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/use-js-interop/SKILL.md
catalog/Platform/Official-DotNet-Experimental/skills/exp-mock-usage-analysis/SKILL.md
catalog/Platform/Official-DotNet-Experimental/skills/exp-simd-vectorization/SKILL.md
catalog/Platform/Official-DotNet-Test-Migration/skills/migrate-xunit-to-mstest/SKILL.md
catalog/Platform/Official-DotNet-Test-Migration/skills/migrate-xunit-to-xunit-v3/SKILL.md
catalog/Platform/Official-DotNet-Upgrade/skills/dotnet-aot-compat/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/code-testing-extensions/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/filter-syntax/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/find-untested-sources/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/platform-detection/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/scaffold-dotnet-test-project/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/test-gap-analysis/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/testability-obstacle/SKILL.md
catalog/Testing/Playwright/skills/playwright-visual-testing/SKILL.md
catalog/Testing/xUnit/skills/xunit/SKILL.md
catalog/Tools/Code-Analysis/skills/code-analysis/SKILL.md
catalog/Tools/HTMLHint/skills/htmlhint/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/analyzing-dotnet-performance/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/clr-activation-debugging/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/dotnet-trace-collect/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/dump-collect/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/binlog-failure-analysis/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/copy-to-output-directory/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/msbuild-server/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/resolve-project-references/SKILL.md
catalog/Tools/ReportGenerator/skills/reportgenerator/SKILL.md
catalog/Tools/ReSharper-CLT/skills/resharper-clt/SKILL.md
catalog/Tools/Roslynator/skills/roslynator/SKILL.md
catalog/Tools/Stylelint/skills/stylelint/SKILL.md
external-sources/upstreams/webgpu-claude-skill/skills/webgpu-threejs-tsl/SKILL.md
catalog/Frameworks/ASP.NET-Core/skills/aspnet-core/SKILL.md
catalog/Frameworks/Aspire/skills/aspire/SKILL.md
catalog/Frameworks/Azure-Functions/skills/azure-functions/SKILL.md
catalog/Frameworks/Blazor/skills/blazor/SKILL.md
catalog/Frameworks/Entity-Framework-Core/skills/entity-framework-core/SKILL.md
catalog/Frameworks/MAUI/skills/maui/SKILL.md

Metadata

Files
0
Version
0559476
Hash
050c3d22
Indexed
2026-07-25 05:21

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 05:45
浙ICP备14020137号-1 $방문자$