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
namestringThe keyword used to invoke the command.
descriptionstringA brief description of what the command does.
actionFunc<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
Description
A brief description of what the command does.
public string Description { get; }
Property Value
Name
The keyword used to invoke the command (e.g., "start", "help").
public string Name { get; }