OData / OData/RESTier

[2.0] odata.bind Support

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

@robertmclaws is already working on this.

Since Jan 4, 2020.

Dominant language
C#
Stars
481
Forks
136
PR merge metrics
No merged PRs in 30d

Description

@odata.bind clauses are ignored by RESTier

Assemblies affected

1.0.0-rc1.20191003.1 https://github.com/OData/RESTier/tree/1.0.0-rc1.20191003.1
Also tried with newest Microsoft.AspNet.OData 7.3.0 https://github.com/OData/WebApi/releases/tag/7.3.0

Reproduce steps

Save multiple entities using Batch SaveChangesOptions.BatchWithSingleChangeset
One of collection properties of newly created entity instance should get references to on or more existing entities (many to many EF link) - look for @odata.bind in provided payload

Expected result

Many-to-many table should get new value to link newly created entity and already existing entity

Actual result

Table stays empty

Additional details

Payload:
`POST http://SERVER/odata/v4/$batch HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
Content-Type: multipart/mixed; boundary=batch_8bd8b4e9-fd81-4102-aad6-79dd3c1a85cf
Accept: multipart/mixed
Accept-Charset: UTF-8
User-Agent: Microsoft.OData.Client/7.6.2
Host: SERVER
Content-Length: 4732
Expect: 100-continue

--batch_8bd8b4e9-fd81-4102-aad6-79dd3c1a85cf
Content-Type: multipart/mixed; boundary=changeset_5f353196-c528-4bf4-b30f-f41ab5722c9b

--changeset_5f353196-c528-4bf4-b30f-f41ab5722c9b
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 2

POST http://SERVER/odata/v4/CalculationSetups HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
Content-Type: application/json;odata.metadata=minimal
Accept: application/json;odata.metadata=minimal
Accept-Charset: UTF-8
User-Agent: Microsoft.OData.Client/7.6.2

{"@odata.type":"#Domain.Calculation.CalculationSetupConfiguration","Comment":null,"ProjectId":292,"Id":-2147483647,"Uid":"c369eaf3-1590-48b4-8d57-cde6f5296717"}
--changeset_5f353196-c528-4bf4-b30f-f41ab5722c9b
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 3

POST http://SERVER/odata/v4/CalculationBlocks HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
Content-Type: application/json;odata.metadata=minimal
Accept: application/json;odata.metadata=minimal
Accept-Charset: UTF-8
User-Agent: Microsoft.OData.Client/7.6.2

{"@odata.type":"#Domain.Calculation.Blocks.CalculationBlock","Id":-2147483646,"IsResultWriter":true,"Name":"Facultative 1","SetupId":-2147483647,"Uid":"38c53828-103e-489e-af6a-b29432f53242"}
--changeset_5f353196-c528-4bf4-b30f-f41ab5722c9b
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 7

POST http://SERVER/odata/v4/CalculationBlocks HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
Content-Type: application/json;odata.metadata=minimal
Accept: application/json;odata.metadata=minimal
Accept-Charset: UTF-8
User-Agent: Microsoft.OData.Client/7.6.2

{"@odata.type":"#Domain.Calculation.Blocks.DataAggregatorBlock","Id":-2147483642,"IsResultWriter":true,"Name":"Sum 1","SetupId":-2147483647,"Uid":"ad46b835-ce77-4014-a19b-721a91f641ce","AggregationCriteria@odata.bind":["http://SERVER/odata/v4/DataAttributeRoles(1)"]}
--changeset_5f353196-c528-4bf4-b30f-f41ab5722c9b--
--batch_8bd8b4e9-fd81-4102-aad6-79dd3c1a85cf--
`

Contributor guide

Open the contributing guide

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.