SoapIncludeAttribute(Type) 建構函式

定義

使用指定的型別,初始化 SoapIncludeAttribute 類別的新執行個體。

public:
 SoapIncludeAttribute(Type ^ type);
public SoapIncludeAttribute (Type type);
new System.Xml.Serialization.SoapIncludeAttribute : Type -> System.Xml.Serialization.SoapIncludeAttribute
Public Sub New (type As Type)

參數

type
Type

要包含的物件之型別。

範例

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

備註

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

適用於