src/Mimp.SeeSharper.Reflection/ConstructorInfoExtensions.cs
/// <summary>
/// Return a compiled delegate to invoke the constructor with a array of the parameters.
/// </summary>
/// <typeparam name="TDelegate"></typeparam>
/// <param name="constructor"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentException">If the delegate hasn't one parameter with a array as type.</exception>
/// <exception cref="InvalidOperationException">If the return type of the delegate isn't castable to the constructor reflected type.</exception>
Return a compiled delegate to invoke the constructor with a array of the parameters.
Return a compiled delegate to invoke the constructor with a array of the parameters .
public static TDelegate GetParameterDelegate<TDelegate>(this ConstructorInfo constructor) where TDelegate : Delegate
        {
            if (constructor is null)
                throw new ArgumentNullException(nameof(constructor));
            return (TDelegate)constructor.GetParameterDelegate(typeof(TDelegate));
        }
public static TDelegate GetParameterDelegate < TDelegate > ( this ConstructorInfo constructor ) where TDelegate : Delegate { if ( constructor is null ) throw new ArgumentNullException ( nameof ( constructor ) ) ; return ( TDelegate ) constructor . GetParameterDelegate ( typeof ( TDelegate ) ) ; }
Return a compiled delegate to invoke the constructor with a array of the parameters.
Return a compiled delegate to invoke the constructor with a array of the parameters .
None
None
If the delegate hasn't one parameter with a array as type.
If the delegate hasn ' t one parameter with a array as type .
If the return type of the delegate isn't castable to the constructor reflected type.
If the return type of the delegate isn ' t castable to the constructor reflected type .
ConstructorInfo
this
constructor
None
typeparam
None