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

适用于