-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCommandResult.cs
More file actions
30 lines (27 loc) · 1.03 KB
/
CommandResult.cs
File metadata and controls
30 lines (27 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Threading.Tasks;
using Ultz.Extensions.Commands.Built;
namespace Ultz.Extensions.Commands.Results.User
{
/// <summary>
/// The abstract class to use for implementing results that can be returned from <see cref="Built.Command" />s.
/// </summary>
public abstract class CommandResult : IResult
{
/// <summary>
/// The <see cref="Built.Command" /> this result was returned by.
/// </summary>
public Command Command { get; internal set; }
/// <summary>
/// Gets whether the result was successful or not.
/// </summary>
public abstract bool IsSuccessful { get; }
/// <summary>
/// Implicitly wraps the provided <see cref="CommandResult" /> in a <see cref="ValueTask{TResult}" />.
/// </summary>
/// <param name="result"> The result to wrap. </param>
public static implicit operator ValueTask<CommandResult>(CommandResult result)
{
return new ValueTask<CommandResult>(result);
}
}
}