EncloseToExpose Method
Definition
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
innerTThe object to extend for non-common extension methods.
throwIfNullbooltrueto throw an ArgumentNullException wheninneris null;falseto allowinnerto be null. Default istrue.argumentNamestringThe name of the argument from which
innerparameter was provided.
Returns
- Decorator<T>
An instance of Decorator<T>.
Type Parameters
TThe type of the
innerto 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
innercannot be null.