Class BaseCommand
Base class of a command. When an instance of this class is processed in the control server, the connection identifier of the channel it was received from is assigned.
public abstract class BaseCommand
- Inheritance
-
BaseCommand
- Derived
- Inherited Members
Constructors
BaseCommand()
Creates a new instance of the BaseCommand
protected BaseCommand()
Properties
Command
Name of the command to execute
[JsonPropertyOrder(-1)]
public string Command { get; set; }
Property Value
Methods
InvokeAsync(CancellationToken)
Invokes the command implementation
public virtual Task<object?> InvokeAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenOptional cancellation token
Returns
UpdateFromJson(JsonElement)
Update the command object from a JSON element
public abstract void UpdateFromJson(JsonElement jsonElement)
Parameters
jsonElementJsonElementJSON element
UpdateFromJsonReader(ref Utf8JsonReader)
Update the command object from a JSON reader
public abstract void UpdateFromJsonReader(ref Utf8JsonReader reader)
Parameters
readerUtf8JsonReaderJSON reader