1- using System ;
2-
31namespace SourceFlow . Messaging
42{
53 /// <summary>
64 /// Base class for command in the command-driven architecture.
75 /// </summary>
8- public class BaseCommand < TPayload > : ICommand < TPayload >
6+ public class BaseCommand < TPayload > : ICommand
97 where TPayload : class , IPayload , new ( )
108 {
119 /// <summary>
@@ -14,30 +12,20 @@ public class BaseCommand<TPayload> : ICommand<TPayload>
1412 /// <param name="payload"></param>
1513 public BaseCommand ( TPayload payload )
1614 {
17- EventId = Guid . NewGuid ( ) ;
18- OccurredOn = DateTime . UtcNow ;
15+ Metadata = new Metadata ( ) ;
16+ Name = GetType ( ) . Name ;
1917 Payload = payload ;
2018 }
2119
2220 /// <summary>
23- /// Unique identifier for the command.
24- /// </summary>
25- public Guid EventId { get ; }
26-
27- /// <summary>
28- /// Indicates whether the command is a replay of an existing command.
29- /// </summary>
30- public DateTime OccurredOn { get ; }
31-
32- /// <summary>
33- /// Indicates whether the command is a replay of an existing command.
21+ /// Metadata associated with the command, which includes information such as event ID, occurrence time, and sequence number.
3422 /// </summary>
35- bool ICommand . IsReplay { get ; set ; }
23+ public Metadata Metadata { get ; set ; } = new Metadata ( ) ;
3624
3725 /// <summary>
38- /// Sequence number of the command within the aggregate's command stream .
26+ /// Name of the command, typically the class name .
3927 /// </summary>
40- public int SequenceNo { get ; set ; }
28+ public string Name { get ; set ; }
4129
4230 /// <summary>
4331 /// Payload of the command, containing the data associated with the command.
0 commit comments