src/Mimp.SeeSharper.Reflection/TypeExtensions.Constructor.cs
/// <summary>
/// Return a compiled delegate to invoke the constructor with same parameters like <typeparamref name="TDelegate"/>.
/// </summary>
/// <typeparam name="TDelegate"></typeparam>
/// <param name="type"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="InvalidOperationException">If no matching constructor exists.</exception>
Return a compiled delegate to invoke the constructor with same parameters like .
Return a compiled delegate to invoke the constructor with same parameters like .
public static TDelegate GetNewDelegate<TDelegate>(this Type type) where TDelegate : Delegate
        {
            if (type is null)
                throw new ArgumentNullException(nameof(type));
            return (TDelegate)type.GetNewDelegate(typeof(TDelegate));
        }
public static TDelegate GetNewDelegate < TDelegate > ( this Type type ) where TDelegate : Delegate { if ( type is null ) throw new ArgumentNullException ( nameof ( type ) ) ; return ( TDelegate ) type . GetNewDelegate ( typeof ( TDelegate ) ) ; }
Return a compiled delegate to invoke the constructor with same parameters like .
Return a compiled delegate to invoke the constructor with same parameters like .
None
None
If no matching constructor exists.
If no matching constructor exists .
Type
this
type
None
typeparam
None