Delen via


TryCreateObjectInstance Delegate

Definition

Represents a delegate for creating an instance of CLR type based on IEdmValue and Type. The delegate can be used to create CLR instances of polymorphic types.

public delegate bool TryCreateObjectInstance(IEdmStructuredValue edmValue, Type clrType, EdmToClrConverter converter, out object objectInstance, out bool objectInstanceInitialized);
type TryCreateObjectInstance = delegate of IEdmStructuredValue * Type * EdmToClrConverter * obj * bool -> bool
Public Delegate Function TryCreateObjectInstance(edmValue As IEdmStructuredValue, clrType As Type, converter As EdmToClrConverter, ByRef objectInstance As Object, ByRef objectInstanceInitialized As Boolean) As Boolean 

Parameters

edmValue
IEdmStructuredValue

The IEdmStructuredValue for which the objectInstance needs to be created.

clrType
Type

The expected CLR type of the object instance. In case of polymorphic properties and collections this may be a base type.

converter
EdmToClrConverter

The converter instance calling this delegate.

objectInstance
Object

The output parameter returning a CLR object instance created for the edmValue.

objectInstanceInitialized
Boolean

The output parameter returning true if all properties of the created objectInstance are initialized. False if properties of the created instance should be initialized using the default EdmToClrConverter logic.

Return Value

True if the delegate produced a desired objectInstance. If delegate returns false, the default EdmToClrConverter logic will be applied to create and populate a CLR object instance.

Applies to