简体   繁体   中英

Get the odata query parameter in c#

I have a below query of select filter in odata.

localhost:1034/odata/Pharmacy?$select=MemberAge,ClaimNumber

I want to access the MemberAge and ClaimNumber parameter in c# without split function .

How can I access the value?

The first thing to say is that if you use the WebAPI OData libraries and return an IQueryable , then you don't need to access the select values as the library deals with all of that.

If you really do need to parse this separately to that, then the ODataQueryOptions class in the System.Web.OData.Query namespace is what parses it within the library and you can use that.

If you aren't using the library at all - and I would strongly advise against that - then you are on your own and you will have to split it yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM