SqlServerDbContextOptionsBuilder.UseCompatibilityLevel(Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定 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
資料庫的相容性等級。
傳回
備註
更多資訊與範例請參閱使用 DbContextOptions 及 SQL Server 相容性文件。