語言

DbContextModelAttribute 類別

定義

識別 RuntimeModel 應在特定情境下使用的實作方式。

[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]
[System.Runtime.CompilerServices.Nullable(0)]
public sealed class DbContextModelAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)>]
[<System.Runtime.CompilerServices.Nullable(0)>]
type DbContextModelAttribute = class
    inherit Attribute
Public NotInheritable Class DbContextModelAttribute
Inherits Attribute
繼承
DbContextModelAttribute
屬性

備註

這個屬性通常會用編譯後的模型產生,不需要在程式碼中指定。

更多資訊與範例請參見 使用 DbContext pooling 。

建構函式

名稱 Description
DbContextModelAttribute(Type, Type)

初始化 DbContextAttribute 類別的新執行個體。

屬性

名稱 Description
ContextType

能理解相關的背景。

ModelType

取得編譯好的模型。

ProviderName

取得用於編譯模型的資料庫提供者名稱。

適用於