Partager via


DbContextModelAttribute Class

Definition

Identifies the RuntimeModel implementation that should be used for a given context.

[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]
public sealed class DbContextModelAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)>]
type DbContextModelAttribute = class
    inherit Attribute
Public NotInheritable Class DbContextModelAttribute
Inherits Attribute
Inheritance
DbContextModelAttribute
Attributes

Remarks

This attribute will usually be generated with the compiled model and doesn't need to be specified in your code.

See Using DbContext pooling for more information and examples.

Constructors

DbContextModelAttribute(Type, Type)

Initializes a new instance of the DbContextAttribute class.

Properties

ContextType

Gets the associated context.

ModelType

Gets the compiled model.

Applies to