Mocker..::..GetDbContext<(Of <(<'TContext>)>)> Method (Func<(Of <(<'DbContextOptions<(Of <(<'TContext>)>)>, TContext>)>)>, DbContextOptions<(Of <(<'TContext>)>)>, DbConnection)

Gets the database context using a SqlLite DB or provided options and DbConnection.

Namespace:  FastMoq
Assembly:  FastMoq.Core (in FastMoq.Core.dll)

Syntax


public TContext GetDbContext<TContext>(
	Func<DbContextOptions<TContext>, TContext> newObjectFunc,
	DbContextOptions<TContext> options,
	DbConnection connection
)
where TContext : DbContext
Public Function GetDbContext(Of TContext As DbContext) ( _
	newObjectFunc As Func(Of DbContextOptions(Of TContext), TContext), _
	options As DbContextOptions(Of TContext), _
	connection As DbConnection _
) As TContext
public:
generic<typename TContext>
where TContext : DbContext
TContext GetDbContext(
	Func<DbContextOptions<TContext>^, TContext>^ newObjectFunc, 
	DbContextOptions<TContext>^ options, 
	DbConnection^ connection
)

Type Parameters

TContext
The type of the t context.

Parameters

newObjectFunc
Type: Func<(Of <(<'DbContextOptions<(Of <(<'TContext>)>)>, TContext>)>)>
The new object function.
options
Type: DbContextOptions<(Of <(<'TContext>)>)>
The options.
connection
Type: DbConnection
The connection.

Return Value

TContext.