SqliteDatabaseFacadeExtensions.IsSqlite(DatabaseFacade) Method

Definition

Returns true if the database provider currently in use is the SQLite provider.

public static bool IsSqlite (this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade database);
static member IsSqlite : Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade -> bool
<Extension()>
Public Function IsSqlite (database As DatabaseFacade) As Boolean

Parameters

database
DatabaseFacade

The facade from Database.

Returns

true if SQLite is being used; false otherwise.

Remarks

This method can only be used after the DbContext has been configured because it is only then that the provider is known. This means that this method cannot be used in OnConfiguring(DbContextOptionsBuilder) because this is where application code sets the provider to use as part of configuring the context.

See Accessing SQLite databases with EF Core for more information and examples.

Applies to