Language

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

データベースに使用する互換性レベル。

戻り値

注釈

詳細と例については、DbContextOptions の使用と互換性レベルに関するSQL Serverドキュメントを参照してください。

適用対象