OData / OData/AspNetCoreOData

OData 8.0.6 and older Navigational Property in Complex Type as returned value on Post + Action not expanded or returned.

Open
#465 0 comments 1 reaction 2 assignees View on GitHub

@xuzhg is already working on this.

Since Feb 1, 2022.

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

Description

Example usage,

var extractSensitivityLabel = builder.EntityType<v2.SensitivityLabel>().Collection.Action("extractContentLabel");
            builder.ComplexType<v2.ContentLabel>().HasRequired(c => c.SensitivityLabel).HasAutoExpand();
            extractSensitivityLabel.Parameter<ContentInfo>("contentInfo").Required();
            extractSensitivityLabel.Returns<v2.ContentLabel>();

Debugging odata showed that WriteExpandedNavigationPropertiesAsync failed to write the property due to the fact that
CreateNavigationLink failed as the writeContext.NavigationSource == null in this case.
it was set as null as the segment.EntitySet == null.
If this is by design unsupported please document, as this works well when its a HttpGet request from a Function but then parsing body information has different issues.

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.