Skip to content

UtilityExtensions.GetDbContext

Mike King edited this page Sep 30, 2025 · 2 revisions

UtilityExtensions.GetDbContext Method

Overloads
GetDbContext(this DatabaseFacade) Gets the Microsoft.EntityFrameworkCore.DbContext object that is used by the specified Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.
GetDbContext(this IQueryable) Gets the Microsoft.EntityFrameworkCore.DbContext object that is used by the specified System.Linq.IQueryable<>.

UtilityExtensions.GetDbContext(this DatabaseFacade) Method

Gets the Microsoft.EntityFrameworkCore.DbContext object that is used by the specified Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.

public static Microsoft.EntityFrameworkCore.DbContext GetDbContext(this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade database);

Parameters

database Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade

The Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.

Returns

Microsoft.EntityFrameworkCore.DbContext
Microsoft.EntityFrameworkCore.DbContext.

UtilityExtensions.GetDbContext(this IQueryable) Method

Gets the Microsoft.EntityFrameworkCore.DbContext object that is used by the specified System.Linq.IQueryable<>.

public static Microsoft.EntityFrameworkCore.DbContext GetDbContext(this System.Linq.IQueryable source);

Parameters

source System.Linq.IQueryable

The source query System.Linq.IQueryable<>.

Returns

Microsoft.EntityFrameworkCore.DbContext
Microsoft.EntityFrameworkCore.DbContext.

Clone this wiki locally