forked from simplefx/Simple.OData
-
Notifications
You must be signed in to change notification settings - Fork 200
Retrieving a single row by key
object edited this page Feb 11, 2013
·
15 revisions
Every OData collection must define a key that consists of a single or multiple properties and can be used for entry lookup and addressing links between different OData collections.
var product = client .From("Products") .Key(1); Assert.Equal("Chai", product["ProductName"]);
Request URI: GET Products(1)
var customer = client .From("Customers") .Key("ALFKI"); Assert.Equal("ALFKI", customer["CustomerID"]);
Request URI: GET Customers(%27ALFKI%27)
var orderDetails = client .From("OrderDetails") .Get(10248, 11); Assert.Equal(10248, orderDetails["OrderID"]);
Request URI: GET OrderDetails(OrderID%3d1%2cProductID%3d1)
See also:
Retrieving data