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
  •  | 
  •  

質問

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?

役に立ちましたか?

解決

Try this:

from t in Foo
where t.Id=='Bar'
select t
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top