/// <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))); }
/// <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));