ModelCacheKey ModelCacheKey Class

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.

Syntax

Declaration

public class ModelCacheKeyPublic Class ModelCacheKey

Inheritance Hierarchy

  • System.Object
    System.Object
  • ModelCacheKey
    ModelCacheKey

Inherited Members

ToString(),
ToString(),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Constructors summary

Initializes a new instance of the ModelCacheKey class.

Methods summary

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

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

Gets the hash code for the key.

Constructors

  • ModelCacheKey(DbContext)
    ModelCacheKey(DbContext)

    Initializes a new instance of the ModelCacheKey class.

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

    Parameters

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

    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.

  • 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.

Details

Assembly

Microsoft.EntityFrameworkCore.dll