Skip to content
Docs Try Aspire
Docs Try

CommandResults Methods

Class Methods 10 members
A factory for ExecuteCommandResult.
Produces a canceled result.
public static class CommandResults
{
public static ExecuteCommandResult Canceled()
{
// ...
}
}
Produces an unsuccessful result with an error message.
public static class CommandResults
{
public static ExecuteCommandResult Failure(
string? errorMessage = null)
{
// ...
}
}
errorMessage string? optional An optional error message.
Produces an unsuccessful result with an error message and result data.
public static class CommandResults
{
public static ExecuteCommandResult Failure(
string errorMessage,
string result,
CommandResultFormat resultFormat = CommandResultFormat.Text)
{
// ...
}
}
errorMessage string The error message.
result string The result data.
resultFormat CommandResultFormat optional The format of the result data. Defaults to CommandResultFormat.Text.
Produces an unsuccessful result with an error message and a value.
public static class CommandResults
{
public static ExecuteCommandResult Failure(
string errorMessage,
CommandResultData value)
{
// ...
}
}
errorMessage string The error message.
value CommandResultData The value produced by the command.
Produces an unsuccessful result from an Exception. Exception.Message is used as the error message.
public static class CommandResults
{
public static ExecuteCommandResult Failure(
Exception exception)
{
// ...
}
}
exception Exception The exception to get the error message from.
Produces a success result.
public static class CommandResults
{
public static ExecuteCommandResult Success()
{
// ...
}
}
Produces a success result.
public static class CommandResults
{
public static ExecuteCommandResult Success(
string message)
{
// ...
}
}
message string
Produces a success result with a message and result data.
public static class CommandResults
{
public static ExecuteCommandResult Success(
string message,
string result,
CommandResultFormat resultFormat = CommandResultFormat.Text)
{
// ...
}
}
message string The message associated with the result.
result string The result data.
resultFormat CommandResultFormat optional The format of the result data. Defaults to CommandResultFormat.Text.
Produces a success result with a message and result data.
public static class CommandResults
{
public static ExecuteCommandResult Success(
string message,
string result,
CommandResultFormat resultFormat,
bool displayImmediately)
{
// ...
}
}
message string The message associated with the result.
result string The result data.
resultFormat CommandResultFormat The format of the result data.
displayImmediately bool A value indicating whether the result data should be displayed immediately in the dashboard.
When displayImmediately is true, the dashboard opens the result dialog automatically when the command completes. Other clients can still read the result data from ExecuteCommandResult.Data.
Produces a success result with a message and a value.
public static class CommandResults
{
public static ExecuteCommandResult Success(
string message,
CommandResultData value)
{
// ...
}
}
message string The message associated with the result.
value CommandResultData The value produced by the command.