Src/Black.Beard.ComponentModel/ComponentModel/Factories/ObjectActivator.cs
/// <summary>
/// Gets an customed activator factory for the specified ctor.
/// Note if the the generic is diferent of the declaring type of the ctor do a cast and is injected in the method.
/// </summary>
/// <typeparam name="T">is the type that containt the constructor with the specified arguments types</typeparam>
/// <param name="type">type must see from external method call</param>
/// <param name="types">arguments types of the constructor</param>
/// <returns></returns>
Gets an customed activator factory for the specified ctor.
Note if the the generic is diferent of the declaring type of the ctor do a cast and is injected in the method.
Gets an customed activator factory for the specified ctor . Note if the the generic is diferent of the declaring type of the ctor do a cast and is injected in the method .
public static Factory<T> GetActivatorByTypeAndArguments<T>(Type type, params Type[] types)
            where T : class
        {
            var ctor = type.GetConstructor(types);
            if (ctor == null)
                throw new NullReferenceException($"no constructor resolved on '{type}' by specified arguments ({types})");
            var description = new MethodDescription(ctor.ToString(), ctor);
            return GetCallMethod<T>(ctor, description);
        }
public static Factory < T > GetActivatorByTypeAndArguments < T > ( Type type , params Type [ ] types ) where T : class { var ctor = type . GetConstructor ( types ) ; if ( ctor == null ) throw new NullReferenceException ( $" no constructor resolved on ' { type } ' by specified arguments ( { types } ) " ) ; var description = new MethodDescription ( ctor . ToString ( ) , ctor ) ; return GetCallMethod < T > ( ctor , description ) ; }
Gets an customed activator factory for the specified ctor.
Gets an customed activator factory for the specified ctor .
None
type
Type
type must see from external method call
type must see from external method call
types
arguments types of the constructor
arguments types of the constructor
typeparam
None