OData / OData/AspNetCoreOData

Patch and related entities

Open
#371 2 comments 0 reactions 1 assignee View on GitHub

@Sreejithpin is already working on this.

Since Nov 16, 2021.

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

Description

Models

    public class TestA
    {
        public int Id { get; set; }
        public int Value { get; set; }
        public TestB B { get; set; }
    }

    public class TestB
    {
        public int Id { get; set; }
        public string Value { get; set; }
    }

When creating a TestA entity by doing:
POST {"@odata.type":"#Test.TestA","Value":4, "B@odata.bind":"http://localhost:52773/api/TestBs(1)"}
the controller receives a TestA-object with A.B instantiated and B.Id set to 1.

When updating a TestA entity by doing:
PATCH {"@odata.type":"#Test.TestA","Value":5, "B@odata.bind":"http://localhost:52773/api/TestBs(2)"}
the delta received in the controller doesn't contain the Id of B.

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.