你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

MobileServiceContractResolver.CreateProperties 方法

定义

为给定类型的成员创建 Newtonsoft.Json.Serialization.JsonProperty 实例的集合。

protected override System.Collections.Generic.IList<Newtonsoft.Json.Serialization.JsonProperty> CreateProperties (Type type, Newtonsoft.Json.MemberSerialization memberSerialization);
override this.CreateProperties : Type * Newtonsoft.Json.MemberSerialization -> System.Collections.Generic.IList<Newtonsoft.Json.Serialization.JsonProperty>
Protected Overrides Function CreateProperties (type As Type, memberSerialization As MemberSerialization) As IList(Of JsonProperty)

参数

type
Type

要创建 Newtonsoft.Json.Serialization.JsonProperty 实例的集合的类型。

memberSerialization
Newtonsoft.Json.MemberSerialization

指定类型的成员序列化选项。

返回

IList<Newtonsoft.Json.Serialization.JsonProperty>

给定类型的成员的 Newtonsoft.Json.Serialization.JsonProperty 实例的集合。

注解

此方法被重写,以便处理类型的 id 属性。 因为多个属性名称(具有不同形式大小写的“id”)全都被视作 id 属性,所以,我们必须确保对于该类型有且只有一个 id 属性。 此外,在该 id 属性是默认值或 null 值并且应始终序列化为具有小写“id”名称的 JSON 时,应忽略该 id 属性。

此方法还检查 并应用 和 系统属性属性。

适用于