DbContextAttribute Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Identifies the DbContext that a class belongs to. For example, this attribute is used to identify which context a migration applies to. It is also used to indicate the contexts used in an assembly for design-time tools.
[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class DbContextAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=true)]
public sealed class DbContextAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type DbContextAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=true)>]
type DbContextAttribute = class
inherit Attribute
Public NotInheritable Class DbContextAttribute
Inherits Attribute
- Inheritance
-
DbContextAttribute
- Attributes
See Managing database schemas with EF Core for more information and examples.
Db |
Initializes a new instance of the DbContextAttribute class. |
Context |
Gets the associated context. |
Product | Versions |
---|---|
Entity Framework Core | 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
Entity Framework feedback
Entity Framework is an open source project. Select a link to provide feedback: