Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0] odata.bind Support #663

Open
vvdev opened this issue Jan 3, 2020 · 1 comment
Open

[2.0] odata.bind Support #663

vvdev opened this issue Jan 3, 2020 · 1 comment
Assignees
Milestone

Comments

@vvdev
Copy link

vvdev commented Jan 3, 2020

@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","[email protected]":["http://SERVER/odata/v4/DataAttributeRoles(1)"]}
--changeset_5f353196-c528-4bf4-b30f-f41ab5722c9b--
--batch_8bd8b4e9-fd81-4102-aad6-79dd3c1a85cf--
`

@vincedan
Copy link

vincedan commented Jan 4, 2020

please read #610

@robertmclaws robertmclaws self-assigned this Jan 4, 2020
@robertmclaws robertmclaws changed the title @odata.bind doesn't work [2.0] odata.bind Support Dec 5, 2023
@robertmclaws robertmclaws added this to the 2.0 milestone Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants