-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDomainCommandHandler.cs
More file actions
77 lines (72 loc) · 3.19 KB
/
DomainCommandHandler.cs
File metadata and controls
77 lines (72 loc) · 3.19 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
66
67
68
69
70
71
72
73
74
75
76
77
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using System;
namespace RapidField.SolidInstruments.Command
{
/// <summary>
/// Processes a single <see cref="IDomainCommand" />.
/// </summary>
/// <typeparam name="TCommand">
/// The type of the command that is processed by the handler.
/// </typeparam>
public abstract class DomainCommandHandler<TCommand> : CommandHandler<TCommand>
where TCommand : class, IDomainCommand
{
/// <summary>
/// Initializes a new instance of the <see cref="DomainCommandHandler{TCommand}" /> class.
/// </summary>
/// <param name="mediator">
/// A processing intermediary that is used to process sub-commands.
/// </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="mediator" /> is <see langword="null" />.
/// </exception>
protected DomainCommandHandler(ICommandMediator mediator)
: base(mediator)
{
return;
}
/// <summary>
/// Releases all resources consumed by the current <see cref="DomainCommandHandler{TCommand}" />.
/// </summary>
/// <param name="disposing">
/// A value indicating whether or not managed resources should be released.
/// </param>
protected override void Dispose(Boolean disposing) => base.Dispose(disposing);
}
/// <summary>
/// Processes a single <see cref="IDomainCommand{TResult}" />.
/// </summary>
/// <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 abstract class DomainCommandHandler<TCommand, TResult> : CommandHandler<TCommand, TResult>
where TCommand : class, IDomainCommand<TResult>
{
/// <summary>
/// Initializes a new instance of the <see cref="DomainCommandHandler{TCommand, TResult}" /> class.
/// </summary>
/// <param name="mediator">
/// A processing intermediary that is used to process sub-commands.
/// </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="mediator" /> is <see langword="null" />.
/// </exception>
protected DomainCommandHandler(ICommandMediator mediator)
: base(mediator)
{
return;
}
/// <summary>
/// Releases all resources consumed by the current <see cref="DomainCommandHandler{TCommand, TResult}" />.
/// </summary>
/// <param name="disposing">
/// A value indicating whether or not managed resources should be released.
/// </param>
protected override void Dispose(Boolean disposing) => base.Dispose(disposing);
}
}