dynamics crm 2011 - How to perform an ODATA expand in LinqPad -
i'm using linqpad connect odata services on local crm organization , don't know how perform "joins" or traverse relationships using linqpad.
here url
organizationdata.svc/new_locationset?$select=new_state_new_location/new_region$expand=new_state_new_location
which works fine in browser. here i'm doing in linqpad:
from l in new_locationset s in l.new_state_new_location select s.new_region
but i'm getting error:
an expression of type 'linqpad.user.new_state' not allowed in subsequent clause in query expression source type 'system.data.services.client.dataservicequery<linqpad.user.new_location>'. type inference failed in call 'selectmany'.
any ideas? i've found linqpad odata documentation extremely lacking...
you need project out want expand, e.g.:
from p in products select new {p.name, categoryname = p.category.name}
or
products.select(p => new { p.name, categoryname = p.category.name})
will yield
http://services.odata.org/(s(readwrite))/odata/odata.svc/products()?$expand=category&$select=name,category/name
in linqpad's request log tab.
Comments
Post a Comment