DataServiceProviderMethods.TypeAs<T> 方法

检查给定的类型是否可以从所提供的对象实例的资源类型进行分配。

命名空间:  System.Data.Services.Providers
程序集:  Microsoft.Data.Services(在 Microsoft.Data.Services.dll 中)

语法

声明
Public Shared Function TypeAs(Of T) ( _
    value As Object, _
    type As ResourceType _
) As T
用法
Dim value As Object
Dim type As ResourceType
Dim returnValue As T

returnValue = DataServiceProviderMethods.TypeAs(value, _
    type)
public static T TypeAs<T>(
    Object value,
    ResourceType type
)
public:
generic<typename T>
static T TypeAs(
    Object^ value, 
    ResourceType^ type
)
static member TypeAs : 
        value:Object * 
        type:ResourceType -> 'T 
JScript 不支持一般类型和方法。

类型参数

  • T
    value 的类型。

参数

返回值

类型:T
当 value 的类型不是指定的 type 时,返回 null 值;否则,返回所提供的 value。

请参阅

参考

DataServiceProviderMethods 类

System.Data.Services.Providers 命名空间