將 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; } }
此方法執行實值型別的 Boxing 和 Unboxing。 使用實值型別特定的方法 (例如 AsClrString(IEdmValue)) 以避免 Boxing 和 Unboxing。