Example #1
0
 public Event(EventRequest request)
 {
     AggregateId      = request.AggregateId;
     AggregateType    = request.AggregateType;
     EventType        = request.EventType;
     EventTypeVersion = request.EventTypeVersion;
     Value            = request.Value;
 }
Example #2
0
 /// <summary>
 /// The sequence number is a unique 64-bit integer assigned to a message as it is accepted
 /// and stored by the broker and functions as its true identifier.
 /// For partitioned entities, the topmost 16 bits reflect the partition identifier.
 /// Sequence numbers monotonically increase and are gap-less.
 /// They roll over to 0 when the 48-64 bit range is exhausted.
 /// This property is read-only.
 /// </summary>
 /// <returns></returns>
 private static Message CreateMessage(EventRequest request, string correlationId)
 {
     return(new Message(Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(request.Value)))
     {
         ContentType = "application/json",
         CorrelationId = correlationId,
         Label = $"{request.EventTypeVersion}{Separator}{request.EventTypeVersion}",
         MessageId = $"{request.AggregateId}{Separator}{Guid.NewGuid()}",
         PartitionKey = request.AggregateType
     });
 }