SqliteDatabaseFacadeExtensions.IsSqlite(DatabaseFacade) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
如果目前使用的資料庫提供者是 SQLite 提供者,則回傳 true 。
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
參數
- database
- DatabaseFacade
該外牆來自 Database。
傳回
true 如果正在使用 SQLite; false 否則,
備註
此方法只能在設定 DbContext 完成後使用,因為只有此時提供者才會被確認。 這表示此方法無法用於 , OnConfiguring(DbContextOptionsBuilder) 因為應用程式代碼在此設定提供者作為上下文配置的一部分。
更多資訊與範例請參見「 使用 EF Core 存取 SQLite 資料庫 」。