ModelCacheKey ModelCacheKey Class

Definition

A key that uniquely identifies the model for a given context. This is used to store and lookup a cached model for a given context. This default implementation uses the context type as they key, thus assuming that all contexts of a given type have the same model.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public class ModelCacheKey
Public Class ModelCacheKey
Inheritance
System.ObjectSystem.Object
ModelCacheKeyModelCacheKey

Constructors

ModelCacheKey(DbContext) ModelCacheKey(DbContext)

Initializes a new instance of the ModelCacheKey class.

public ModelCacheKey(DbContext context)
Public Sub New(context As DbContext)
Parameters
context
DbContext DbContext

The context instance that this key is for.

Methods

Equals(ModelCacheKey) Equals(ModelCacheKey)

Determines if this key is equivalent to a given key (i.e. if they are for the same context type).

protected virtual bool Equals(ModelCacheKey other)
Protected Overridable Function Equals(other As ModelCacheKey) As Boolean
Parameters
other
ModelCacheKey ModelCacheKey

The key to compare this key to.

Returns
System.Boolean System.Boolean

True if the key is for the same context type, otherwise false.

Equals(Object) Equals(Object)

Determines if this key is equivalent to a given object (i.e. if they are keys for the same context type).

public override bool Equals(object obj)
Public Overrides Function Equals(obj As Object) As Boolean
Parameters
obj
System.Object System.Object

The object to compare this key to.

Returns
System.Boolean System.Boolean

True if the object is a ModelCacheKey and is for the same context type, otherwise false.

Overrides
System.Object.Equals(System.Object)System.Object.Equals(System.Object)

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

GetHashCode() GetHashCode()

Gets the hash code for the key.

public override int GetHashCode()
Public Overrides Function GetHashCode As Integer
Returns
System.Int32 System.Int32

The hash code for the key.

Overrides
System.Object.GetHashCode()System.Object.GetHashCode()

GetType() GetType()

Inherited from System.Object

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ToString() ToString()

Inherited from System.Object