Ejemplo n.º 1
0
        /// <summary>
        /// Configures application to use specified factory method for creating new instances of <see cref="ICommand"/>.
        /// </summary>
        public static ICliApplicationBuilder UseCommandFactory(this ICliApplicationBuilder builder, Func <CommandSchema, ICommand> factoryMethod)
        {
            builder.GuardNotNull(nameof(builder));
            factoryMethod.GuardNotNull(nameof(factoryMethod));

            return(builder.UseCommandFactory(new DelegateCommandFactory(factoryMethod)));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Configures application to use specified factory method for creating new instances of <see cref="ICommand"/>.
 /// </summary>
 public static ICliApplicationBuilder UseCommandFactory(this ICliApplicationBuilder builder, Func <CommandSchema, ICommand> factoryMethod) =>
 builder.UseCommandFactory(new DelegateCommandFactory(factoryMethod));