Class CmdBootStrap
Provides bootstrapping functionality for command-line applications including running actions, DI configuration, and logging setup
public class CmdBootStrap
- Inheritance
-
CmdBootStrap
- Inherited Members
- Extension Methods
Methods
AddIConfiguration(IServiceCollection?)
Resolve IConfiguration from appsettings.json
public static void AddIConfiguration(IServiceCollection? services)
Parameters
servicesIServiceCollectionService collection to add configuration to.
AddILogger(IServiceCollection?, bool, ILoggerProvider?, string)
Configures ILogger with console and/or file logging providers
public static void AddILogger(IServiceCollection? services, bool isLoggingToConsole, ILoggerProvider? fileLoggerProvider, string categoryName)
Parameters
servicesIServiceCollectionService collection for dependency injection
isLoggingToConsoleboolWhether to add console logging provider
fileLoggerProviderILoggerProviderOptional file logger provider.
categoryNamestringCategory name for the logger
RunWithRunArgs(RunArgs)
Automatically calls the method in release according to the args
public static Task<string?> RunWithRunArgs(RunArgs runArgs)
Parameters
runArgsRunArgsConfiguration arguments for the run.