Entity framework6

From managedcode/dotnet-skills · View interactive version

Entity framework6 is an AI agent skill from the GitHub repository managedcode/dotnet-skills. 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: un

How to use this skill

Skill file

Entity Framework 6

Trigger On

Workflow

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

```csharp

// 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)

```

  1. 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 |

  1. For maintenance work — keep EF6 stable:
  1. For migration work — validate each slice:
  1. 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

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

Validate

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.