Table of Contents

ThrowIfSame Method

Definition

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

ThrowIfSame<T>(T, T, string, string)

Validates and throws an ArgumentOutOfRangeException if the specified x object are of the same instance as the y object.

public static void ThrowIfSame<T>(T x, T y, string paramName, 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.

message string

A message that describes the error.

Type Parameters

T

The type of objects to compare.

Exceptions

ArgumentOutOfRangeException

x and y are of the same instance.