<EntityType Name="Country">
<Key>
<PropertyRef Name="Code"/>
</Key>
<Property Name="Code" Type="Edm.String" MaxLength="2" Nullable="false"/>
<Property Name="Name" Type="Edm.String"/>
</EntityType>
"Country": {
"$Kind": "EntityType",
"$Key": [
"Code"
],
"Code": {
"$MaxLength": 2
},
"Name": {
"$Nullable": true
}
}
"Country":{"$Kind":"EntityType","$Key":["Code"],"Code":{"$MaxLength":2},"Name":{"$Nullable":true}}
$batch
was tricky to create and hard to read; now there is a JSON format for batch requests and responses which is simply an array of request or response objects:{
"requests": [
{
"id": "0",
"method": "get",
"url": "/service/Customers('ALFKI')"
},
{
"id": "1",
"atomicityGroup": "group1",
"dependsOn": ["0" ],
"method": "patch",
"url": "/service/Customers('ALFKI')",
"headers": {
"Prefer": "return=minimal"
},
"body": <JSON representation of changes to Customer ALFKI>
},
{
"id": "2",
"atomicityGroup": "group1",
"method": "post",
"url": "/service/Customers",
"body": <JSON representation of a new Customer entity>
},
{
"id": "3",
"dependsOn": [ "group1" ],
"method": "get",
"url": "/service/Products"
}
]
}
atomicityGroup
and dependsOn
.PATCH
an entity graph by sending a nested tree of stuff to add or change, and if the PATCH
target doesn't exist yet, it is simply created, thus Deep Upsert.PATCH
an entity set with an array of many new/changed entities, and of course this can be an array of Deep Upsert structures.UPDATE WHERE
and DELETE WHERE
now have their OData counterparts:PATCH /service/Products/$filter=@bar/$each?@bar=Color eq 'beige-brown'
Content-Type: application/json
{
"Color": "taupe"
}
DELETE /service/Products/$filter=@foo/$each?@foo=Age gt 3
GET Sales?$compute=Revenue sub Costs as Profit,Profit divby Revenue as Margin
GET People?$filter=FirstName in ('Fred','George','Harry')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
6 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 |