Table of Contents

Class ConsoleCommand

Namespace
AppHealthMonitor
Assembly
AppHealthMonitor.dll

Represents a console command that can be executed by the daemon. Encapsulates command name, description, and execution logic. Validates all parameters at construction time to fail fast on misconfiguration.

public sealed record ConsoleCommand : IEquatable<ConsoleCommand>
Inheritance
ConsoleCommand
Implements
Inherited Members

Constructors

ConsoleCommand(string, string, Func<Task>)

Initializes a new instance of the ConsoleCommand record.

public ConsoleCommand(string name, string description, Func<Task> action)

Parameters

name string

The keyword used to invoke the command.

description string

A brief description of what the command does.

action Func<Task>

The asynchronous action to perform when invoked.

Exceptions

ArgumentNullException

Thrown when any parameter is null.

Properties

Action

An asynchronous delegate representing the action to perform when the command is invoked.

public Func<Task> Action { get; }

Property Value

Func<Task>

Description

A brief description of what the command does.

public string Description { get; }

Property Value

string

Name

The keyword used to invoke the command (e.g., "start", "help").

public string Name { get; }

Property Value

string