Table of Contents

Interface IInjectableService

Namespace
Microsoft.EntityFrameworkCore.Internal
Assembly
Microsoft.EntityFrameworkCore.dll

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Implemented by service property types to notify services instances of lifecycle changes.

public interface IInjectableService

Methods

Attaching(DbContext, IEntityType, object)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Called when an entity that needs this is being attached to a DbContext.

void Attaching(DbContext context, IEntityType entityType, object entity)

Parameters

context DbContext

The DbContext instance.

entityType IEntityType

The IEntityType of the instance being attached.

entity object

The entity instance that is being attached.

Detaching(DbContext, object)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Called when the entity holding this service is being detached from a DbContext.

bool Detaching(DbContext context, object entity)

Parameters

context DbContext

The DbContext instance.

entity object

The entity instance that is being detached.

Returns

bool

true if the service property should be set to null.

Injected(DbContext, object, ParameterBindingInfo)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

void Injected(DbContext context, object entity, ParameterBindingInfo bindingInfo)

Parameters

context DbContext
entity object
bindingInfo ParameterBindingInfo