JsonRpcError.ErrorDetail.GetData 方法

定義

多載

GetData(Type)

取得 的值 Data ,並將任何可能的型別強制型別納入考慮。

GetData<T>()

取得 的值 Data ,並將任何可能的型別強制型別納入考慮。

GetData(Type)

取得 的值 Data ,並將任何可能的型別強制型別納入考慮。

public virtual object? GetData (Type dataType);
abstract member GetData : Type -> obj
override this.GetData : Type -> obj
Public Overridable Function GetData (dataType As Type) As Object

參數

dataType
Type

Type 還原序列化資料物件的 。

傳回

結果。

例外狀況

如果 dataType 為 null,則會擲回 。

備註

衍生型別可能會覆寫這個方法,以便還原序列化 Data ,使其可以指派給 dataType 。 預設實作不會轉換 Data 物件以符合 dataType ,但只會傳回現有的 物件。 衍生類型應為 *not* 擲回例外狀況。 這是最佳方法,並傳回 null 或其他值,最好是擲回,因為它可能會中斷現有的例外狀況處理路徑。

適用於

GetData<T>()

取得 的值 Data ,並將任何可能的型別強制型別納入考慮。

public T GetData<T> ();
member this.GetData : unit -> 'T
Public Function GetData(Of T) () As T

類型參數

T

Type 強制轉型為 的 Data

傳回

T

結果。

適用於