Skip to content
Docs Try Aspire

CommandResults Methods

Class Methods 4 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 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()
{
// ...
}
}