Try our conversational search powered by Generative AI!

Class ContentReferenceComparer

Provides ContentReference equality and comparer instances.

Inheritance
System.Object
ContentReferenceComparer
Implements
System.Collections.Generic.IEqualityComparer<ContentReference>
System.Collections.Generic.IComparer<ContentReference>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public abstract class ContentReferenceComparer : IEqualityComparer<ContentReference>, IComparer<ContentReference>

Constructors

ContentReferenceComparer()

Declaration
protected ContentReferenceComparer()

Fields

Complete

Comparer that compares all fields of two ContentReference instances.

Declaration
public static readonly ContentReferenceComparer Complete
Field Value
Type Description
ContentReferenceComparer

Default

Comparer that compares the identity, version and provider of two ContentReference instances.

Declaration
public static readonly ContentReferenceComparer Default
Field Value
Type Description
ContentReferenceComparer

IgnoreVersion

Comparer that compares the identity and provider of two ContentReference instances but ignores the version information provided by WorkID.

Declaration
public static readonly ContentReferenceComparer IgnoreVersion
Field Value
Type Description
ContentReferenceComparer

Methods

Compare(ContentReference, ContentReference)

Compares two ContentReference objects and returns a value indicating whether one is less than, equal to, or greater than the other.

Declaration
public abstract int Compare(ContentReference x, ContentReference y)
Parameters
Type Name Description
ContentReference x

The first ContentReference to compare.

ContentReference y

The second ContentReference to compare.

Returns
Type Description
System.Int32

A signed integer that indicates the relative values of x and y, as shown in the following table.Value Meaning Less than zerox is less than y.Zerox equals y.Greater than zerox is greater than y.

Equals(ContentReference, ContentReference)

Determines whether the two specified ContentReference objects are considered equal.

Declaration
public abstract bool Equals(ContentReference x, ContentReference y)
Parameters
Type Name Description
ContentReference x

The first ContentReference to compare.

ContentReference y

The second ContentReference to compare.

Returns
Type Description
System.Boolean

true if the specified ContentReference objects are equal; otherwise, false.

GetHashCode(ContentReference)

Returns a hash code for the specified ContentReference instance.

Declaration
public abstract int GetHashCode(ContentReference obj)
Parameters
Type Name Description
ContentReference obj

The ContentReference to get the hash code for.

Returns
Type Description
System.Int32

A hash code for the provided ContentReference instance, suitable for use in hashing algorithms and data structures like a hash table.

Implements

System.Collections.Generic.IEqualityComparer<T>
System.Collections.Generic.IComparer<T>

Extension Methods