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