SoapIncludeAttribute.Type 屬性

定義

取得或設定物件的型別,用於序列化或還原序列化物件時。

public:
 property Type ^ Type { Type ^ get(); void set(Type ^ value); };
public Type Type { get; set; }
member this.Type : Type with get, set
Public Property Type As Type

屬性值

要包含的物件之型別。

範例

下列範例會將 兩 SoapIncludeAttribute 次套用至 XML Web 服務方法。 方法會傳回類型 Vehicle (基類) 的物件。 SoapIncludeAttribute允許 方法傳回衍生自 類別的 Vehicle 類別實例。

備註

將 的 SoapIncludeAttribute 多個實例套用至傳回物件陣列、 ArrayList 包含 物件集合的 ,或可以傳回多個類型的 物件之欄位或屬性。 Type針對您想要欄位或屬性包含的每個類型設定 屬性。

適用於