DbContext Konstruktory
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přetížení
| Název | Description |
|---|---|
| DbContext() |
Inicializuje novou instanci DbContext třídy. Volá OnConfiguring(DbContextOptionsBuilder) se metoda pro konfiguraci databáze (a dalších možností), která se má pro tento kontext použít. |
| DbContext(DbContextOptions) |
Inicializuje novou instanci DbContext třídy pomocí zadaných možností. Metoda OnConfiguring(DbContextOptionsBuilder) bude stále volána, aby byla povolena další konfigurace možností. |
DbContext()
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
Inicializuje novou instanci DbContext třídy. Volá OnConfiguring(DbContextOptionsBuilder) se metoda pro konfiguraci databáze (a dalších možností), která se má pro tento kontext použít.
protected DbContext();
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("EF Core isn't fully compatible with NativeAOT, and running the application may generate unexpected runtime failures.")]
[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.")]
protected DbContext();
Protected Sub New ()
- Atributy
Poznámky
Další informace a příklady najdete v tématu Životnost, konfigurace a inicializace DbContext .
Platí pro
DbContext(DbContextOptions)
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
- Zdroj:
- DbContext.cs
Inicializuje novou instanci DbContext třídy pomocí zadaných možností. Metoda OnConfiguring(DbContextOptionsBuilder) bude stále volána, aby byla povolena další konfigurace možností.
public DbContext(Microsoft.EntityFrameworkCore.DbContextOptions options);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("EF Core isn't fully compatible with NativeAOT, and running the application may generate unexpected runtime failures.")]
[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.")]
public DbContext(Microsoft.EntityFrameworkCore.DbContextOptions options);
new Microsoft.EntityFrameworkCore.DbContext : Microsoft.EntityFrameworkCore.DbContextOptions -> Microsoft.EntityFrameworkCore.DbContext
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("EF Core isn't fully compatible with NativeAOT, and running the application may generate unexpected runtime failures.")>]
[<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.")>]
new Microsoft.EntityFrameworkCore.DbContext : Microsoft.EntityFrameworkCore.DbContextOptions -> Microsoft.EntityFrameworkCore.DbContext
Public Sub New (options As DbContextOptions)
Parametry
- options
- DbContextOptions
Možnosti pro tento kontext.
- Atributy
Poznámky
Další informace a příklady najdete v tématu Životnost, konfigurace a inicializaceDbContextOptions a Použití DbContextOptions .