Beispiel #1
0
 public EventEntity(Partition partition, RecordedEvent @event)
 {
     PartitionKey = partition.PartitionKey;
     RowKey       = partition.EventVersionRowKey(@event.Version);
     Properties   = @event.Properties;
     Version      = @event.Version;
 }
Beispiel #2
0
            TableQuery <DynamicTableEntity> PrepareQuery()
            {
                var rowKeyStart = partition.EventVersionRowKey(startVersion);
                var rowKeyEnd   = partition.EventVersionRowKey(startVersion + sliceSize - 1);

                // ReSharper disable StringCompareToIsCultureSpecific

                var query = table
                            .CreateQuery <DynamicTableEntity>()
                            .Where(x =>
                                   x.PartitionKey == partition.PartitionKey &&
                                   (x.RowKey == partition.StreamRowKey() ||
                                    (x.RowKey.CompareTo(rowKeyStart) >= 0 &&
                                     x.RowKey.CompareTo(rowKeyEnd) <= 0)));

                return((TableQuery <DynamicTableEntity>)query);
            }
Beispiel #3
0
            TableQuery <DynamicTableEntity> EventsQuery()
            {
                var rowKeyStart = partition.EventVersionRowKey(startVersion);
                var rowKeyEnd   = partition.EventVersionRowKey(startVersion + sliceSize - 1);

                var filter = TableQuery.CombineFilters(
                    TableQuery.GenerateFilterCondition(nameof(DynamicTableEntity.PartitionKey), QueryComparisons.Equal, partition.PartitionKey),
                    TableOperators.And,
                    TableQuery.CombineFilters(
                        TableQuery.GenerateFilterCondition(nameof(DynamicTableEntity.RowKey), QueryComparisons.GreaterThanOrEqual, rowKeyStart),
                        TableOperators.And,
                        TableQuery.GenerateFilterCondition(nameof(DynamicTableEntity.RowKey), QueryComparisons.LessThanOrEqual, rowKeyEnd)
                        )
                    );

                return(new TableQuery <DynamicTableEntity>().Where(filter));
            }