Aracılığıyla paylaş


DbContext Oluşturucular

Tanım

Aşırı Yüklemeler

DbContext()

DbContext sınıfının yeni bir örneğini başlatır. Bu OnConfiguring(DbContextOptionsBuilder) bağlam için kullanılacak veritabanını (ve diğer seçenekleri) yapılandırmak için yöntemi çağrılır.

DbContext(DbContextOptions)

Belirtilen seçenekleri kullanarak sınıfının yeni bir örneğini DbContext başlatır. Seçeneklerin OnConfiguring(DbContextOptionsBuilder) daha fazla yapılandırılmasına izin vermek için yöntemi çağrılmaya devam eder.

DbContext()

DbContext sınıfının yeni bir örneğini başlatır. Bu OnConfiguring(DbContextOptionsBuilder) bağlam için kullanılacak veritabanını (ve diğer seçenekleri) yapılandırmak için yöntemi çağrılır.

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 ()
Öznitelikler

Açıklamalar

Daha fazla bilgi ve örnek için bkz. DbContext yaşam süresi, yapılandırma ve başlatma .

Şunlara uygulanır

DbContext(DbContextOptions)

Belirtilen seçenekleri kullanarak sınıfının yeni bir örneğini DbContext başlatır. Seçeneklerin OnConfiguring(DbContextOptionsBuilder) daha fazla yapılandırılmasına izin vermek için yöntemi çağrılmaya devam eder.

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)

Parametreler

options
DbContextOptions

Bu bağlamın seçenekleri.

Öznitelikler

Açıklamalar

Daha fazla bilgi ve örnek için bkz. DbContext yaşam süresi, yapılandırma ve başlatma ve DbContextOptions kullanma .

Şunlara uygulanır