Search code examples
linqodatalinqpad

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


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?


Solution

  • Try this:

    from t in Foo
    where t.Id=='Bar'
    select t