OData / OData/AspNetCoreOData

Issue migrating from WebApi OData V6 related to navigation properties in complex types

Open
#724 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Migrating from Microsoft.AspNet.OData v5.x + Microsoft.OData.Core v6.x (ASP.NET) to Microsoft.AspNetCore.OData v7+ (ASP.NET Core) causes the following issue:

We have types like these:

public class A
{
    public string Id { get; set; }
}

public class B
{
    List<A> ListOfA { get; set; }
}

In ASP.NET OData treats type A as a complex type, but in ASP.NET Core it treats A as an entity and, as can be seen in EDM metadata, type B now has NavigationProperty instead of Property. This is a breaking change for us because this affects clients since they have to deal with a different property now and, more importantly, it does not get expanded.

Is this a known breaking change? Is it somehow possible to opt in to the old behavior?
We need to avoid breaking existing clients, can we use any extensibility points to keep the old behavior by default?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the A/B model example in the issue and inspect the generated ASP.NET Core OData EDM metadata, comparing the navigation property with the prior complex-type property behavior. Done means determining whether an opt-in or extensibility point can preserve the old metadata and expansion behavior without breaking existing clients.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.