OData / OData/AspNetCoreOData

Expansion failure, new since .Net 5 upgrade

Open
#248 18 comments 0 reactions 1 assignee View on GitHub

@xuzhg is already working on this.

Since Aug 3, 2021.

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

Description

So I have a custom Action on one of my Odata controllers where I post a set of data of type T and I get back a set of results of type Result

Essentially what we do is something like this ...

HTTP POST  odata/T/UpdateAll?$expand=Item($expand=References,Buckets,Companies,Lines)
Body: 
{
    "value": [  array of T ]
}

Pushed to this action method ...

[HttpPut]
[EnableQuery()]
public virtual async Task<IActionResult> UpdateAll([FromBody] ODataCollection<T> items, ODataQueryOptions<Result<T>> queryOptions)
      => ModelState.IsValid ? Ok(await Service.UpdateAllAsync(items.Value)) : BadRequest(ModelState);

The controller hands of the business logic work to a dependency and is then given back a IEnumerable<Result> to return to the caller.

The call above does this work then wants back "for each result" it's Item property then expand in to the items child "References,Buckets,Lines" properties.
This used to work fine under .Net Core but since our .Net 5 upgrade the expand is returning the items but not the second level expand.

Is there something I am missing here / some key difference in the way the Odata 8.0.1 package or .Net 5 implementation works that prevents this?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.