将 edmValue 转换为指定类型的 CLR 值。
命名空间: Microsoft.Data.Edm.EdmToClrConversion
程序集: Microsoft.Data.Edm(在 Microsoft.Data.Edm.dll 中)
语法
声明
Public Function AsClrValue ( _
edmValue As IEdmValue, _
clrType As Type _
) As Object
用法
Dim instance As EdmToClrConverter
Dim edmValue As IEdmValue
Dim clrType As Type
Dim returnValue As Object
returnValue = instance.AsClrValue(edmValue, _
clrType)
public Object AsClrValue(
IEdmValue edmValue,
Type clrType
)
public:
Object^ AsClrValue(
IEdmValue^ edmValue,
Type^ clrType
)
member AsClrValue :
edmValue:IEdmValue *
clrType:Type -> Object
public function AsClrValue(
edmValue : IEdmValue,
clrType : Type
) : Object
参数
- edmValue
类型:Microsoft.Data.Edm.Values.IEdmValue
要转换的 EDM 值。
- clrType
类型:System.Type
CLR 类型。
返回值
类型:System.Object
从 edmValue 转换的 CLR 值。
注释
T 的受支持的值为:
CLR 枚举类型。
具有默认构造函数的 CLR 类以及具有 setter 和以下形状的集合属性的公共属性:
IEnumerable<T> EnumerableProperty { get; set; }
ICollection<T> CollectionProperty { get; set; }
IList<T> ListProperty { get; set; }
ICollection<T> CollectionProperty { get { return this.nonNullCollection; } }
IList<T> ListProperty { get { return this.nonNullList; } }
此方法执行值类型的装箱和取消装箱操作。 使用特定于值类型的方法(如 AsClrString(IEdmValue))以避免装箱和取消装箱。