SqlServerDbContextOptionsBuilder.UseCompatibilityLevel(Int32) 方法

定義

設定 EF Core 與資料庫互動時將使用的SQL Server相容性層級。 這可讓 EF Core 使用較舊的 (或更新版本的) SQL Server。 預設為 160 (SQL Server 2022) 。

public virtual Microsoft.EntityFrameworkCore.Infrastructure.SqlServerDbContextOptionsBuilder UseCompatibilityLevel (int compatibilityLevel);
abstract member UseCompatibilityLevel : int -> Microsoft.EntityFrameworkCore.Infrastructure.SqlServerDbContextOptionsBuilder
override this.UseCompatibilityLevel : int -> Microsoft.EntityFrameworkCore.Infrastructure.SqlServerDbContextOptionsBuilder
Public Overridable Function UseCompatibilityLevel (compatibilityLevel As Integer) As SqlServerDbContextOptionsBuilder

參數

compatibilityLevel
Int32

false 表示具有 Null 資源

傳回

備註

如需詳細資訊和範例,請參閱使用 DbCoNtextOptionsSQL Server相容性層級的檔

適用於