/// <summary> /// Throws a System.ArgumentNullException with the specified message. The parameter name for /// the exception will be the value of ensureArg.ArgumentName. /// </summary> /// <typeparam name="T">The type parameter of the IEnsureArg instance.</typeparam> /// <param name="ensureArg">The IEnsureArg instance to throw an exception for.</param> /// <param name="exceptionMessage"> /// The message to use in the exception. If no exception message is supplied then /// ensureArg.ExceptionMessage will be used. /// </param> public static void ThrowArgumentNullException <T>(this IEnsureArg <T> ensureArg, string exceptionMessage) { throw new ArgumentNullException(ensureArg.ArgumentName, ensureArg.FormatArgumentNullExceptionMessage(exceptionMessage)); }