I am new to both odata and c# and I cannot figure out how to translate URI query like the following:
http://services.odata.org/Northwind/Northwind.svc/Customers(10)/Orders?$expand=Order_Details
in c#, using the linq method syntax.
I tried this way:
var customer = context.Customers.Where( x => x.Id == 10 ).First();
foreach(var order in customer.Orders.Expand("Order_Details")){
//stuff
}
But customer.Orders does not have the "Expand" method. How do I deal with these queries where I have to expand a navigation property connected to a specific entity?
using System.Data.Services.Client;
. – CodeCastervar orders = context.Customers.Expand("Orders")
is correct, but this results in this query:http://services.odata.org/Nortwind/Northwind.svc/Customers?$expand=Orders
– Andrea Tucci