DbContextId Struct
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.
A unique identifier for the context instance and pool lease, if any.
[System.Runtime.CompilerServices.IsReadOnly]
public readonly struct DbContextId
public readonly struct DbContextId
[<System.Runtime.CompilerServices.IsReadOnly>]
type DbContextId = struct
type DbContextId = struct
Public Structure DbContextId
- Inheritance
-
DbContextId
- Attributes
This identifier is primarily intended as a correlation ID for logging and debugging such that it is easy to identify that multiple events are using the same or different context instances.
See DbContext lifetime, configuration, and initialization for more information and examples.
Db |
Creates a new DbContextId with the given InstanceId and lease number. |
Instance |
A unique identifier for the DbContext being used. |
Lease |
A number that is incremented each time this particular DbContext instance is leased from the context pool. |
Equals(Db |
Compares this ID to another ID to see if they represent the same leased context. |
Equals(Object) |
Compares this ID to another ID to see if they represent the same leased context. |
Get |
A hash code for this ID. |
To |
Returns the instance ID and lease number. |
Equality(Db |
Compares one ID to another ID to see if they represent the same leased context. |
Inequality(Db |
Compares one ID to another ID to see if they represent different leased contexts. |
Product | Versions |
---|---|
Entity Framework Core | 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: