Table of Contents

Class DbContextExtensions

Namespace
JsonApiDotNetCore.Repositories
Assembly
JsonApiDotNetCore.dll
[PublicAPI]
public static class DbContextExtensions
Inheritance
DbContextExtensions
Inherited Members

Methods

GetTrackedIdentifiable(DbContext, IIdentifiable)

Searches the change tracker for an entity that matches the type and ID of identifiable.

public static object? GetTrackedIdentifiable(this DbContext dbContext, IIdentifiable identifiable)

Parameters

dbContext DbContext
identifiable IIdentifiable

Returns

object

GetTrackedOrAttach(DbContext, IIdentifiable)

If not already tracked, attaches the specified resource to the change tracker in Unchanged state.

public static IIdentifiable GetTrackedOrAttach(this DbContext dbContext, IIdentifiable resource)

Parameters

dbContext DbContext
resource IIdentifiable

Returns

IIdentifiable

ResetChangeTracker(DbContext)

Detaches all entities from the change tracker.

public static void ResetChangeTracker(this DbContext dbContext)

Parameters

dbContext DbContext