Table of Contents

Class IdentifiableComparer

Namespace
JsonApiDotNetCore.Resources
Assembly
JsonApiDotNetCore.dll

Compares IIdentifiable instances with each other based on their type and StringId, falling back to LocalId when both StringIds are null.

[PublicAPI]
public sealed class IdentifiableComparer : IEqualityComparer<IIdentifiable>
Inheritance
IdentifiableComparer
Implements
Inherited Members

Fields

Instance

public static readonly IdentifiableComparer Instance

Field Value

IdentifiableComparer

Methods

Equals(IIdentifiable?, IIdentifiable?)

Determines whether the specified objects are equal.

public bool Equals(IIdentifiable? left, IIdentifiable? right)

Parameters

left IIdentifiable
right IIdentifiable

Returns

bool

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

GetHashCode(IIdentifiable)

Returns a hash code for the specified object.

public int GetHashCode(IIdentifiable obj)

Parameters

obj IIdentifiable

The object for which a hash code is to be returned.

Returns

int

A hash code for the specified object.

Exceptions

ArgumentNullException

The type of obj is a reference type and obj is null.