src/Mimp.SeeSharper.Reflection/TypeExtensions.Constructor.cs
/// <summary>
/// Return a compiled delegate to invoke a constructor - that match <paramref name="types"/> - with a array of parameters.
/// </summary>
/// <typeparam name="TDelegate"></typeparam>
/// <param name="type"></param>
/// <param name="types"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="InvalidOperationException">
/// If no matching constructor exists.
/// If delegate types isn't castable to constructor types.
/// </exception>
Return a compiled delegate to invoke a constructor - that match  - with a array of parameters.
Return a compiled delegate to invoke a constructor - that match - with a array of parameters .
public static TDelegate GetNewParameterDelegate<TDelegate>(this Type type, IEnumerable<Type> types) where TDelegate : Delegate
        {
            if (type is null)
                throw new ArgumentNullException(nameof(type));
            if (types is null)
                throw new ArgumentNullException(nameof(types));
            if (types.Any(t => t is null))
                throw new ArgumentNullException(nameof(types), "At least on type is null");
            return (TDelegate)type.GetNewParameterDelegate(types, typeof(TDelegate));
        }
public static TDelegate GetNewParameterDelegate < TDelegate > ( this Type type , IEnumerable < Type > types ) where TDelegate : Delegate { if ( type is null ) throw new ArgumentNullException ( nameof ( type ) ) ; if ( types is null ) throw new ArgumentNullException ( nameof ( types ) ) ; if ( types . Any ( t => t is null ) ) throw new ArgumentNullException ( nameof ( types ) , " " ) ; return ( TDelegate ) type . GetNewParameterDelegate ( types , typeof ( TDelegate ) ) ; }
Return a compiled delegate to invoke a constructor - that match  - with a array of parameters.
Return a compiled delegate to invoke a constructor - that match - with a array of parameters .
None
None
If no matching constructor exists.
If delegate types isn't castable to constructor types.
If no matching constructor exists . If delegate types isn ' t castable to constructor types .
Type
this
types
IEnumerable<Type>
None
type
None
typeparam
None