Table of Contents

ThrowIfNotSame Method

Definition

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

ThrowIfNotSame<T>(T, T, string, string)

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

public static void ThrowIfNotSame<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 not of the same instance.