-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathICommandMediator.cs
More file actions
62 lines (59 loc) · 2.62 KB
/
ICommandMediator.cs
File metadata and controls
62 lines (59 loc) · 2.62 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using RapidField.SolidInstruments.Core;
using System;
using System.Threading.Tasks;
namespace RapidField.SolidInstruments.Command
{
/// <summary>
/// Serves as a dependency resolver and processing intermediary for commands.
/// </summary>
public interface ICommandMediator : IInstrument
{
/// <summary>
/// Processes the specified <see cref="ICommand{TResult}" />.
/// </summary>
/// <typeparam name="TResult">
/// The type of the result that is produced by processing the command.
/// </typeparam>
/// <param name="command">
/// The command to process.
/// </param>
/// <returns>
/// The result that is produced by processing the command.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="command" /> is <see langword="null" />.
/// </exception>
/// <exception cref="CommandHandlingException">
/// An exception was raised while processing the command.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public TResult Process<TResult>(ICommand<TResult> command);
/// <summary>
/// Asynchronously processes the specified <see cref="ICommand{TResult}" />.
/// </summary>
/// <typeparam name="TResult">
/// The type of the result that is produced by processing the command.
/// </typeparam>
/// <param name="command">
/// The command to process.
/// </param>
/// <returns>
/// A task representing the asynchronous operation and containing the result that is produced by processing the command.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="command" /> is <see langword="null" />.
/// </exception>
/// <exception cref="CommandHandlingException">
/// An exception was raised while processing the command.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public Task<TResult> ProcessAsync<TResult>(ICommand<TResult> command);
}
}