Table of Contents

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

QueryKey

Parts

The ordered list of values that make up this key.

public IReadOnlyList<object> Parts { get; }

Property Value

IReadOnlyList<object>

Methods

Equals(QueryKey?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(QueryKey? other)

Parameters

other QueryKey

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

From(params object[])

Creates a QueryKey from the given parts.

public static QueryKey From(params object[] parts)

Parameters

parts object[]

The values that make up the key. Must not be null and must not contain null elements.

Returns

QueryKey

A new QueryKey composed of the given parts.

Exceptions

ArgumentNullException

Thrown when parts is null.

ArgumentException

Thrown when any element in parts is null.

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.