다음을 통해 공유


DbContext 생성자

정의

오버로드

DbContext()

DbContext 클래스의 새 인스턴스를 초기화합니다. 메서드는 OnConfiguring(DbContextOptionsBuilder) 이 컨텍스트에 사용할 데이터베이스(및 기타 옵션)를 구성하기 위해 호출됩니다.

DbContext(DbContextOptions)

지정된 옵션을 사용하여 클래스의 DbContext 새 instance 초기화합니다. 메서드는 OnConfiguring(DbContextOptionsBuilder) 옵션의 추가 구성을 허용하기 위해 계속 호출됩니다.

DbContext()

DbContext 클래스의 새 인스턴스를 초기화합니다. 메서드는 OnConfiguring(DbContextOptionsBuilder) 이 컨텍스트에 사용할 데이터베이스(및 기타 옵션)를 구성하기 위해 호출됩니다.

protected DbContext ();
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EF Core isn't fully compatible with trimming, and running the application may generate unexpected runtime failures. Some specific coding pattern are usually required to make trimming work properly, see https://aka.ms/efcore-docs-trimming for more details.")]
protected DbContext ();
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EF Core isn't fully compatible with trimming, and running the application may generate unexpected runtime failures. Some specific coding pattern are usually required to make trimming work properly, see https://aka.ms/efcore-docs-trimming for more details.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("EF Core isn't fully compatible with NativeAOT, and running the application may generate unexpected runtime failures.")]
protected DbContext ();
Protected Sub New ()
특성

설명

자세한 내용 과 예제는 DbContext 수명, 구성 및 초기화를 참조하세요.

적용 대상

DbContext(DbContextOptions)

지정된 옵션을 사용하여 클래스의 DbContext 새 instance 초기화합니다. 메서드는 OnConfiguring(DbContextOptionsBuilder) 옵션의 추가 구성을 허용하기 위해 계속 호출됩니다.

public DbContext (Microsoft.EntityFrameworkCore.DbContextOptions options);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EF Core isn't fully compatible with trimming, and running the application may generate unexpected runtime failures. Some specific coding pattern are usually required to make trimming work properly, see https://aka.ms/efcore-docs-trimming for more details.")]
public DbContext (Microsoft.EntityFrameworkCore.DbContextOptions options);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EF Core isn't fully compatible with trimming, and running the application may generate unexpected runtime failures. Some specific coding pattern are usually required to make trimming work properly, see https://aka.ms/efcore-docs-trimming for more details.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("EF Core isn't fully compatible with NativeAOT, and running the application may generate unexpected runtime failures.")]
public DbContext (Microsoft.EntityFrameworkCore.DbContextOptions options);
new Microsoft.EntityFrameworkCore.DbContext : Microsoft.EntityFrameworkCore.DbContextOptions -> Microsoft.EntityFrameworkCore.DbContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EF Core isn't fully compatible with trimming, and running the application may generate unexpected runtime failures. Some specific coding pattern are usually required to make trimming work properly, see https://aka.ms/efcore-docs-trimming for more details.")>]
new Microsoft.EntityFrameworkCore.DbContext : Microsoft.EntityFrameworkCore.DbContextOptions -> Microsoft.EntityFrameworkCore.DbContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EF Core isn't fully compatible with trimming, and running the application may generate unexpected runtime failures. Some specific coding pattern are usually required to make trimming work properly, see https://aka.ms/efcore-docs-trimming for more details.")>]
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("EF Core isn't fully compatible with NativeAOT, and running the application may generate unexpected runtime failures.")>]
new Microsoft.EntityFrameworkCore.DbContext : Microsoft.EntityFrameworkCore.DbContextOptions -> Microsoft.EntityFrameworkCore.DbContext
Public Sub New (options As DbContextOptions)

매개 변수

options
DbContextOptions

이 컨텍스트에 대한 옵션입니다.

특성

설명

자세한 내용 과 예제는 DbContext 수명, 구성 및 초기화DbContextOptions 사용을 참조하세요.

적용 대상