c# - How to read a value from odata object -


var response = await client.getasync("/dev/rateservices/edisclaimers/format").configureawait(false); var x = response.content.readasstringasync().result; 

i want read value of id when name = us.centralizedrefi.tier1_moreinfo_disclaimer below object(value of var x). how that?

{"@odata.context":"http://localhost/dev/rateservices/$metadata#edisclaimers","value":[{"id":1,"name":"standard.typicaltransactions","effectivedate":"2014-05-01","expirydate":null},{"id":2,"name":"standard.additionalfees","effectivedate":"2014-05-01","expirydate":null},{"id":3,"name":"standard.endorsementonlysupport","effectivedate":"2014-05-01","expirydate":null},{"id":4,"name":"standard.cpl","effectivedate":"2016-09-21","expirydate":null},{"id":5,"name":"limitedcoverage","effectivedate":"2015-11-01","expirydate":null},{"id":6,"name":"callforfeeendorsement","effectivedate":"2015-11-01","expirydate":null},{"id":7,"name":"userdefined","effectivedate":"2015-11-01","expirydate":null},{"id":8,"name":"busreq_gl-1310-cfpb","effectivedate":"2015-11-01","expirydate":null},{"id":9,"name":"us.centralizedrefi.tier1_moreinfo_disclaimer","effectivedate":"2015-11-01","expirydate":null}]}

you need use predicate $filter query option in end of query. if use equal operator filtering query option, query should :

http://localhost/dev/rateservices/edisclaimers?$filter=name  eq 'us.centralizedrefi.tier1_moreinfo_disclaimer' 

above query returns records matches above filtering option.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -