microsoft/migrating-data-edm-to-odata
> Migrates the obsolete Microsoft.Data.Edm (OData v1–v3 EDM types) to Microsoft.OData.Edm for OData v4. Use ONLY when Microsoft.Data.Edm has been flagged as obsolete or deprecated and must be replaced — not for version-bump scenarios where Microsoft.Data.Edm is still supported.
npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill migrating-data-edm-to-odata
Migrate projects from the OData v1–v3 EDM library (Microsoft.Data.Edm) to the OData v4 EDM library (Microsoft.OData.Edm). The primary change is a namespace rename, but several model interfaces gained new members and some types were renamed to align with the OData v4 specification.
> Related skills: migrating-data-odata-to-odata-core, migrating-data-services-client
<PackageReference Include="Microsoft.Data.Edm" Version="5.*" />
<PackageReference Include="Microsoft.OData.Edm" Version="{latest-stable-version}" />
Use tools or NuGet to find the latest stable version.
Migration Progress:
- [ ] Step 1: Detect Microsoft.Data.Edm usage
- [ ] Step 2: Update package references
- [ ] Step 3: Update namespace declarations
- [ ] Step 4: Handle API differences
- [ ] Step 5: Update validation calls
- [ ] Step 6: Build and verify
Scan the project for:
using Microsoft.Data.Edm; and sub-namespace imports (Microsoft.Data.Edm.Library, Microsoft.Data.Edm.Validation, etc.)IEdmModel, EdmCoreModel, IEdmEntityType, IEdmComplexTypeMicrosoft.Data.Edm in the project fileIf the project already references Microsoft.OData.Edm, no migration is needed.
In the project file, replace the old package reference with the new one (see "Package Reference Changes" above). If the project uses centralized package management (Directory.Packages.props), update the version there instead.
Replace all namespace references:
| Old Namespace | New Namespace |
|---------------|---------------|
| Microsoft.Data.Edm | Microsoft.OData.Edm |
| Microsoft.Data.Edm.Library | Microsoft.OData.Edm |
| Microsoft.Data.Edm.Validation | Microsoft.OData.Edm.Validation |
| Microsoft.Data.Edm.Csdl | Microsoft.OData.Edm.Csdl |
The Library sub-namespace was merged into the root Microsoft.OData.Edm namespace in v4.
| Old API (v1–v3) | New API (v4) | Action |
|------------------|--------------|--------|
| EdmMultiplicity enum | EdmMultiplicity (values renamed) | Update enum member references; EdmMultiplicity.Many is now consistent across all usage sites |
| IEdmEntityType.DeclaredKey | IEdmEntityType.DeclaredKey (returns IEnumerable<IEdmStructuralProperty>) | Verify key property type alignment — v4 uses structural properties exclusively |
| EdmCoreModel.Instance | EdmCoreModel.Instance (expanded primitive types) | Review usages; v4 includes additional primitive types like Edm.Date and Edm.TimeOfDay |
| IEdmModel.SchemaElements | IEdmModel.SchemaElements (additional element kinds) | Handle new element kinds such as EdmSchemaElementKind.TypeDefinition and EdmSchemaElementKind.Term |
| IEdmEntityContainer.FindEntitySet(string) | IEdmEntityContainer.FindEntitySet(string) (returns IEdmEntitySet with navigation bindings) | Adapt code that inspects entity set metadata to account for navigation property bindings |
The validation API changed:
// Old (v1-v3)
IEnumerable<EdmError> errors;
bool isValid = model.Validate(out errors);
// New (v4)
IEnumerable<EdmError> errors;
bool isValid = CsdlReader.TryParse(reader, out model, out errors);
// Or validate an existing model:
bool isValid = model.Validate(out errors);
The EdmError type moved to Microsoft.OData.Edm.Validation. Update any error inspection code accordingly.
dotnet build
Some types from Microsoft.Data.Edm.Library moved directly into Microsoft.OData.Edm. If a type is not found after updating namespaces, search for it in the root namespace rather than a sub-namespace.
OData v4 introduced Edm.Date, Edm.TimeOfDay, and Edm.Duration as distinct primitive types. Code that enumerates primitive types or switches on EdmPrimitiveTypeKind needs to handle these new values.
The v4 validation rules are stricter. Review validation errors carefully — they often indicate model constructs that were tolerated in v3 but are invalid under the OData v4 specification.
Take microsoft/migrating-data-edm-to-odata from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.