Table of Contents

ThrowIfEqual Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Kernel.dll
Source
src/Cuemon.Kernel/Validator.cs

ThrowIfEqual<T>(T, T, string, IEqualityComparer<T>, string)

Validates and throws an ArgumentOutOfRangeException if the specified x object are equal to the y object.

public static void ThrowIfEqual<T>(T x, T y, string paramName, IEqualityComparer<T> comparer = null, string message = null)

Parameters

x T

The first object to compare.

y T

The second object to compare.

paramName string

The name of the parameter that caused the exception.

comparer IEqualityComparer<T>

The IEqualityComparer<T> implementation to use when comparing x and y.

message string

A message that describes the error.

Type Parameters

T

The type of objects to compare.

Exceptions

ArgumentOutOfRangeException

x and y are equal to one another.