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
Methods
Equals(IIdentifiable?, IIdentifiable?)
Determines whether the specified objects are equal.
public bool Equals(IIdentifiable? left, IIdentifiable? right)
Parameters
leftIIdentifiablerightIIdentifiable
Returns
GetHashCode(IIdentifiable)
Returns a hash code for the specified object.
public int GetHashCode(IIdentifiable obj)
Parameters
objIIdentifiableThe object for which a hash code is to be returned.
Returns
- int
A hash code for the specified object.
Exceptions
- ArgumentNullException
The type of
objis a reference type andobjis null.