Pip-Services-Commons-Dotnet
|
Concrete implementation of ICommand interface. Command allows to call a method or function using Command pattern. More...
Public Member Functions | |
Command (string name, Schema schema, ExecutableDelegate function) | |
Creates a new command object and assigns it's parameters. More... | |
async Task< object > | ExecuteAsync (string correlationId, Parameters args) |
Executes the command. Before execution is validates Parameters args using the defined schema.The command execution intercepts exceptions raised by the called function and calls them as an error. More... | |
IList< ValidationResult > | Validate (Parameters args) |
Validates the command Parameters args before execution using the defined schema. More... | |
Properties | |
string | Name [get] |
Gets the command name. More... | |
Schema | Schema [get] |
Gets the command schema. More... | |
![]() | |
string | Name [get] |
Gets the command name. More... | |
Schema | Schema [get] |
Gets the command schema. More... | |
Private Attributes | |
readonly ExecutableDelegate | _function |
Concrete implementation of ICommand interface. Command allows to call a method or function using Command pattern.
See ICommand, CommandSet
PipServices3.Commons.Commands.Command.Command | ( | string | name, |
Schema | schema, | ||
ExecutableDelegate | function | ||
) |
Creates a new command object and assigns it's parameters.
name | Command name. |
schema | Command schema. |
function | Executable function. |
async Task<object> PipServices3.Commons.Commands.Command.ExecuteAsync | ( | string | correlationId, |
Parameters | args | ||
) |
Executes the command. Before execution is validates Parameters args using the defined schema.The command execution intercepts exceptions raised by the called function and calls them as an error.
correlationId | Unique correlation/transaction id. |
args | Command arguments. |
See Parameters
Implements PipServices3.Commons.Run.IExecutable.
IList<ValidationResult> PipServices3.Commons.Commands.Command.Validate | ( | Parameters | args | ) |
Validates the command Parameters args before execution using the defined schema.
args | Command arguments. |
See Parameters, ValidationResult
Implements PipServices3.Commons.Commands.ICommand.
|
get |
Gets the command name.
|
get |
Gets the command schema.