EdmToClrConverter.AsClrValue Method (IEdmValue, Type)
Converts edmValue to a CLR value of the specified type.
Namespace: Microsoft.Data.Edm.EdmToClrConversion
Assembly: Microsoft.Data.Edm (in Microsoft.Data.Edm.dll)
Syntax
'Declaration
Public Function AsClrValue ( _
edmValue As IEdmValue, _
clrType As Type _
) As Object
'Usage
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
Parameters
- edmValue
Type: Microsoft.Data.Edm.Values.IEdmValue
The EDM value to be converted.
- clrType
Type: System.Type
The CLR type.
Return Value
Type: System.Object
A CLR value converted from edmValue.
Remarks
Supported values for T are:
CLR enum types.
CLR classes with default constructors and public properties with setters and collection properties of the following shapes:
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; } }
This method performs boxing and unboxing for value types. Use value-type specific methods such as AsClrString(IEdmValue) to avoid boxing and unboxing.