Table of Contents

EncloseToExpose Method

Definition

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

EncloseToExpose<T>(T, bool, string)

Encloses the specified inner so that it can be extended by both common and non-common extension methods.

public static Decorator<T> EncloseToExpose<T>(T inner, bool throwIfNull = true, string argumentName = null)

Parameters

inner T

The object to extend for non-common extension methods.

throwIfNull bool

true to throw an ArgumentNullException when inner is null; false to allow inner to be null. Default is true.

argumentName string

The name of the argument from which inner parameter was provided.

Returns

Decorator<T>

An instance of Decorator<T>.

Type Parameters

T

The type of the inner to wrap for non-common extension methods.

Remarks

This should be used to re-use non-common extension methods from native extension methods without double-validating arguments.

Exceptions

ArgumentNullException

inner cannot be null.