-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathICommandHandler.cs
More file actions
65 lines (61 loc) · 2.58 KB
/
ICommandHandler.cs
File metadata and controls
65 lines (61 loc) · 2.58 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
63
64
65
// =================================================================================================================================
// 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;
namespace RapidField.SolidInstruments.Command
{
/// <summary>
/// Processes a single <see cref="ICommand" />.
/// </summary>
/// <remarks>
/// Do not use <see cref="ICommandHandler{TCommand, TResult}" /> as a registration target for inversion of control tools. Use
/// <see cref="ICommandHandler{TCommand}" /> instead.
/// </remarks>
/// <typeparam name="TCommand">
/// The type of the command that is processed by the handler.
/// </typeparam>
/// <typeparam name="TResult">
/// The type of the result that is emitted by the handler when processing a command.
/// </typeparam>
public interface ICommandHandler<in TCommand, TResult> : ICommandHandler<TCommand>
where TCommand : class, ICommand<TResult>
{
/// <summary>
/// Processes the specified <see cref="ICommand{TResult}" />
/// </summary>
/// <returns>
/// The result that is emitted when 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(TCommand command);
}
/// <summary>
/// Processes a single <see cref="ICommand" />.
/// </summary>
/// <remarks>
/// Do not implement <see cref="ICommandHandler{TCommand}" /> directly in user code. Use
/// <see cref="ICommandHandler{TCommand}" /> as a registration target for inversion of control tools.
/// </remarks>
/// <typeparam name="TCommand">
/// The type of the command that is processed by the handler.
/// </typeparam>
public interface ICommandHandler<in TCommand> : ICommandHandler
where TCommand : class, ICommandBase
{
}
/// <summary>
/// Processes a single <see cref="ICommand" />.
/// </summary>
public interface ICommandHandler : IInstrument
{
}
}