我有一个 Web 服务 API(带有一个称为 piperuns 的 OData 端点,使用 ODataController),它接受一个可选的查询字符串(称为 projectNumber),例如:
http://localhost:59636/piperuns?projectNumber=1
我有一个基于 Simple.OData.Client 的客户端,我无法弄清楚如何传递这个可选的查询字符串...我使用的是动态语法,并且可以使用以下语法获取管道运行(不带查询参数):
ODataFeedAnnotations annotations = new ODataFeedAnnotations();
ODataClient client = new ODataClient("http://localhost:59636/");
var x = ODataDynamic.Expression;
IEnumerable<dynamic> pipeRunsNext = await(Task<IEnumerable<Simple.OData.Client.ODataEntry>>)client
.For(x.piperuns)
.FindEntriesAsync(annotations.NextPageLink, annotations);
但是如果需要,我还没有找到有关如何包含可选查询字符串参数的任何信息?
谢谢!