File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed
examples/bank-account/RetailBank.AzureFunctionApp/Transfer/Functions
src/EventSourcingOnAzureFunctions.Common/CQRS/CommandHandler/Classifications Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ namespace RetailBank.AzureFunctionApp.Transfer.Functions
7
7
public class TransferCommands
8
8
{
9
9
10
+ //Transfer money
10
11
12
+ //Cancel in-progress transfer
11
13
12
14
}
13
15
}
Original file line number Diff line number Diff line change @@ -11,15 +11,19 @@ namespace EventSourcingOnAzureFunctions.Common.CQRS.CommandHandler.Classificatio
11
11
/// A classification to denote that a command execution has completed
12
12
/// </summary>
13
13
[ ClassificationName ( "Command Completed" ) ]
14
- public class Completed
14
+ public sealed class Completed
15
15
: ClassificationBase ,
16
16
IClassifyEventType < Completed >
17
17
{
18
18
19
19
20
20
public ClassificationResponse . ClassificationResults ClassifyEventInstance ( Completed eventInstance )
21
21
{
22
- return ClassificationResponse . ClassificationResults . Include ;
22
+ if ( eventInstance != null )
23
+ {
24
+ return ClassificationResponse . ClassificationResults . Include ;
25
+ }
26
+ return ClassificationResponse . ClassificationResults . Unchanged ;
23
27
}
24
28
25
29
public override void SetParameter ( string parameterName , object parameterValue )
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Text ;
4
+ using EventSourcingOnAzureFunctions . Common . CQRS . CommandHandler . Events ;
5
+ using EventSourcingOnAzureFunctions . Common . EventSourcing ;
6
+ using EventSourcingOnAzureFunctions . Common . EventSourcing . Interfaces ;
7
+
8
+ namespace EventSourcingOnAzureFunctions . Common . CQRS . CommandHandler . Classifications
9
+ {
10
+ /// <summary>
11
+ /// A classification to denote that a command execution has had a fatal error
12
+ /// </summary>
13
+ [ ClassificationName ( "Command In Error" ) ]
14
+ public sealed class InError
15
+ : ClassificationBase ,
16
+ IClassifyEventType < FatalErrorOccured >
17
+ {
18
+ public ClassificationResponse . ClassificationResults ClassifyEventInstance ( FatalErrorOccured eventInstance )
19
+ {
20
+ if ( eventInstance != null )
21
+ {
22
+ return ClassificationResponse . ClassificationResults . Include ;
23
+ }
24
+ return ClassificationResponse . ClassificationResults . Unchanged ;
25
+ }
26
+
27
+ public override void SetParameter ( string parameterName , object parameterValue )
28
+ {
29
+ // This classifier has no parameters
30
+ }
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments