Delen via


IMaterializationInterceptor.CreatedInstance Method

Definition

Called immediately after EF has created an instance of an entity. That is, after the constructor has been called, but before any properties values not set by the constructor have been set.

public virtual object CreatedInstance (Microsoft.EntityFrameworkCore.Diagnostics.MaterializationInterceptionData materializationData, object entity);
abstract member CreatedInstance : Microsoft.EntityFrameworkCore.Diagnostics.MaterializationInterceptionData * obj -> obj
override this.CreatedInstance : Microsoft.EntityFrameworkCore.Diagnostics.MaterializationInterceptionData * obj -> obj
Public Overridable Function CreatedInstance (materializationData As MaterializationInterceptionData, entity As Object) As Object

Parameters

materializationData
MaterializationInterceptionData

Contextual information about the materialization happening.

entity
Object

The entity instance that has been created. This value is typically used as the return value for the implementation of this method.

Returns

The entity instance that EF will use. An implementation of this method for any interceptor that is not attempting to change the instance used must return the entity value passed in.

Applies to