在Xamarin表单数据解析 [英] Parsing Data in Xamarin Forms

查看:151
本文介绍了在Xamarin表单数据解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得在集合的href的名字(CustomerDemographics,客户,员工,订单详细信息)来填充列表视图。我想知道如何解析在Xamarin平台或C#这些信息。
我对这个环境是新的。我有经验,如何分析与目标C机iOS JSON数据,但它是我第一次看到这种类型的数据。

I would like to get the names in collection href(CustomerDemographics, Customers, Employees, Order Details) to populate a listview. I would like to know how to parse these information in Xamarin platform or C#. I am quite new on this environment. I have experience how to parse json data in native ios with objective c, but it is the first time I see this type of data.

推荐答案

从附加的图像似乎要请求的OData服务的服务文件。即 HTTP://服务的主机/服务/ 端点。如果您想获得该藏品的内容,你应该在集合名称追加到服务文档URL的末尾,如:

From the attached image it seems that you're requesting the service document of the OData service. Namely the http://host/service/ endpoint of the service. If you would like to get the content of the collections, you should append the names of the collections to the end of the service document URL, such as:

GET http://host/service/Categories
GET http://hsot/service/CustomerDemographics

响应负载的格式取决于服务的OData的协议版本。如果你跟一个的OData V4服务(它实际上看起来很像要查询的罗斯文的OData V4示例服务:的 http://services.odata.org/v4/northwind/northwind.svc/ ),响应的有效载荷将在JSON格式,你可以用你熟悉的方式。解析响应

The format of the response payload depends on the protocol version of the OData service. If you are talking to a OData V4 service (it actually seems a lot like you are querying the Northwind OData V4 sample service: http://services.odata.org/v4/northwind/northwind.svc/), the response payload will be in JSON format and you can use the ways that you are familiar with to parse the response.

另外,我建议你去通过OData.org的基础教程,让你可以得到的OData请求更好地把握:的 http://www.odata.org/getting-started/basic-tutorial/

In addition, I would recommend you go through the basic tutorial on OData.org so that you can get a better grasp of OData requests: http://www.odata.org/getting-started/basic-tutorial/

这篇关于在Xamarin表单数据解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆