Class QueryKey
- Namespace
- DotNetQuery.Core
- Assembly
- DotNetQuery.Core.dll
An immutable, equality-comparable key used to identify and share query cache entries. Create instances via From(params object[]) or use Default as a sentinel for the uninitialized state.
public sealed record QueryKey : IEquatable<QueryKey>
- Inheritance
-
QueryKey
- Implements
- Inherited Members
Properties
Default
A sentinel key representing the uninitialized state. Returned by Key before args have been pushed for the first time.
public static QueryKey Default { get; }
Property Value
Parts
The ordered list of values that make up this key.
public IReadOnlyList<object> Parts { get; }
Property Value
Methods
Equals(QueryKey?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(QueryKey? other)
Parameters
otherQueryKeyAn object to compare with this object.
Returns
From(params object[])
Creates a QueryKey from the given parts.
public static QueryKey From(params object[] parts)
Parameters
partsobject[]The values that make up the key. Must not be
nulland must not containnullelements.
Returns
Exceptions
- ArgumentNullException
Thrown when
partsisnull.- ArgumentException
Thrown when any element in
partsisnull.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.