Table of Contents

Class CmdBootStrap

Namespace
SunamoCl.SunamoCmd
Assembly
SunamoCl.dll

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

services IServiceCollection

Service 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

services IServiceCollection

Service collection for dependency injection

isLoggingToConsole bool

Whether to add console logging provider

fileLoggerProvider ILoggerProvider

Optional file logger provider.

categoryName string

Category name for the logger

RunWithRunArgs(RunArgs)

Automatically calls the method in release according to the args

public static Task<string?> RunWithRunArgs(RunArgs runArgs)

Parameters

runArgs RunArgs

Configuration arguments for the run.

Returns

Task<string>

Name of the executed action, or null if cancelled.