Ejemplo n.º 1
0
 public EventEntity(Partition partition, RecordedEvent @event)
 {
     PartitionKey = partition.PartitionKey;
     RowKey       = partition.EventVersionRowKey(@event.Version);
     Properties   = @event.Properties;
     Version      = @event.Version;
 }
Ejemplo n.º 2
0
 public EventIdEntity(Partition partition, RecordedEvent @event)
 {
     Event        = @event;
     PartitionKey = partition.PartitionKey;
     RowKey       = partition.EventIdRowKey(@event.Id);
     Version      = @event.Version;
 }
Ejemplo n.º 3
0
 public EventIdEntity(Partition partition, RecordedEvent @event)
 {
     Event = @event;
     PartitionKey = partition.PartitionKey;
     RowKey = partition.EventIdRowKey(@event.Id);
     Version = @event.Version;
 }
Ejemplo n.º 4
0
 internal StreamWriteResult(Stream stream, RecordedEvent[] events)
 {
     Stream = stream;
     Events = events;
     Includes = events
         .SelectMany(x => x.IncludedOperations.Select(y => y.Entity))
         .ToArray();
 }
Ejemplo n.º 5
0
                Chunk Add(RecordedEvent @event)
                {
                    if (@event.Operations > MaxOperationsPerChunk)
                    {
                        throw new InvalidOperationException(
                                  string.Format("{0} include(s) in event {1}:{{{2}}}, plus event entity itself, is over Azure's max batch size limit [{3}]",
                                                @event.IncludedOperations.Length, @event.Version, @event.Id, MaxOperationsPerChunk));
                    }

                    if (!CanAccomodate(@event))
                    {
                        return(new Chunk(@event));
                    }

                    Accomodate(@event);
                    return(this);
                }
Ejemplo n.º 6
0
 bool CanAccomodate(RecordedEvent @event)
 {
     return(operations + @event.Operations <= MaxOperationsPerChunk);
 }
Ejemplo n.º 7
0
 void Accomodate(RecordedEvent @event)
 {
     operations += @event.Operations;
     events.Add(@event);
 }
Ejemplo n.º 8
0
 Chunk(RecordedEvent first) => Accomodate(first);