IDatabase Interface

Definition

The main interaction point between a context and the database provider.

This interface is typically used by database providers (and other extensions). It is generally not used in application code.

public interface IDatabase
type IDatabase = interface
Public Interface IDatabase
Derived

Remarks

The service lifetime is Scoped. This means that each DbContext instance will use its own instance of this service. The implementation may depend on other services registered with any lifetime. The implementation does not need to be thread-safe.

See Implementation of database providers and extensions for more information and examples.

Methods

CompileAsyncQuery<TResult>(QueryModel)

Translates a query model into a function that can be executed to asynchronously get query results from the database.

CompileQuery<TResult>(Expression, Boolean)

Compiles the given query to generate a Func<T,TResult>.

CompileQuery<TResult>(QueryModel)

Translates a query model into a function that can be executed to get query results from the database.

SaveChanges(IList<IUpdateEntry>)

Persists changes from the supplied entries to the database.

SaveChanges(IReadOnlyList<IUpdateEntry>)

Persists changes from the supplied entries to the database.

SaveChangesAsync(IList<IUpdateEntry>, CancellationToken)

Asynchronously persists changes from the supplied entries to the database.

SaveChangesAsync(IReadOnlyList<IUpdateEntry>, CancellationToken)

Asynchronously persists changes from the supplied entries to the database.

Applies to