How does one pass a parameter to an OData controller in LinqPad? i.e. http://localhost/vroot/odata/Foo('bar')

StackOverflow https://stackoverflow.com/questions/23552856

  •  18-07-2023
  •  | 
  •  

Question

I have a WebAPI OData web service that can optionally take a parameter.

I am using LinqPad to issue requests like:

from t in Foo
select t

Which is converted to this OData request:

http://my.localhost.com/vroot/odata/Foo()

But I'd like to pass a parameter to Foo() and get the following OData request:

http://my.localhost.com/vroot/odata/Foo('Bar')

This call works perfectly in the web browser.

Is this possible in LinqPad? How is it done?

Was it helpful?

Solution

Try this:

from t in Foo
where t.Id=='Bar'
select t
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top