DbContextModelAttribute Class

Definition

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

C#
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]
public sealed class DbContextModelAttribute : 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

Produkt Versioner
Entity Framework Core 9.0