Share via


EdmToClrConverter Class

Definition

IEdmValue to CLR value converter.

public class EdmToClrConverter
type EdmToClrConverter = class
Public Class EdmToClrConverter
Inheritance
EdmToClrConverter

Constructors

EdmToClrConverter()

Initializes a new instance of the EdmToClrConverter class.

EdmToClrConverter(TryCreateObjectInstance, TryGetClrPropertyInfo, TryGetClrTypeName)

Initializes a new instance of the EdmToClrConverter class.

EdmToClrConverter(TryCreateObjectInstance)

Initializes a new instance of the EdmToClrConverter class.

Methods

AsClrValue(IEdmValue, Type)

Converts edmValue to a CLR value of the specified type. Supported values for clrType are: CLR primitive types such as String and Int32, CLR enum types, IEnumerable<T>, ICollection<T>, IList<T>, 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; } }.

AsClrValue<T>(IEdmValue)

Converts edmValue to a CLR value of the specified type. Supported values for T are: CLR primitive types such as String and Int32, CLR enum types, IEnumerable<T>, ICollection<T>, IList<T>, 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; } }.

RegisterConvertedObject(IEdmStructuredValue, Object)

Registers the clrObject corresponding to the edmValue. All subsequent conversions from this edmValue performed by this instance of EdmToClrConverter will return the specified clrObject. Registration is required to support graph consistency and loops during conversion process. This method should be called inside the TryCreateObjectInstance delegate if the delegate is calling back into EdmToClrConverter in order to populate properties of the clrObject.

Applies to