ValueProviderResultExtensions.ConvertTo 方法

定義

多載

ConvertTo(ValueProviderResult, Type)

嘗試將 中的 result 值轉換成指定的型別。

ConvertTo<T>(ValueProviderResult)

嘗試將 中的 result 值轉換成指定的型別。

ConvertTo(ValueProviderResult, Type)

嘗試將 中的 result 值轉換成指定的型別。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ ConvertTo(Microsoft::AspNetCore::Mvc::ModelBinding::ValueProviderResult result, Type ^ type);
public static object ConvertTo (this Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult result, Type type);
static member ConvertTo : Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult * Type -> obj
<Extension()>
Public Function ConvertTo (result As ValueProviderResult, type As Type) As Object

參數

type
Type

Type要轉換的 。

傳回

已轉換的值,如果無法轉換值,則為 的 type 預設值。

適用於

ConvertTo<T>(ValueProviderResult)

嘗試將 中的 result 值轉換成指定的型別。

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T ConvertTo(Microsoft::AspNetCore::Mvc::ModelBinding::ValueProviderResult result);
public static T ConvertTo<T> (this Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult result);
static member ConvertTo : Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult -> 'T
<Extension()>
Public Function ConvertTo(Of T) (result As ValueProviderResult) As T

類型參數

T

Type要轉換的 。

參數

傳回

T

已轉換的值,如果無法轉換值,則為 的 T 預設值。

適用於