예제 #1
0
        public IEnumerable <EventData> GetPendingEventsFor(string sourceId)
        {
            var query = GetEntitiesQuery(sourceId, RowKeyConstants.UnpublishedRowKeyPrefix,
                                         RowKeyConstants.UnpublishedRowKeyPrefixUpperLimit);
            var table = _tableClient.GetTableReference(_tableName);

            return(table.ExecuteQuery(query).Select(x => UnpublishedAzureTableEntryMapper.ToEventData(x)));
        }
예제 #2
0
        public void DeletePending(EventData eventData)
        {
            var table             = _tableClient.GetTableReference(_tableName);
            var partitionKey      = eventData.SourceId;
            var rowKey            = UnpublishedAzureTableEntryMapper.GetRowKeyFromVersion(eventData.Version);
            var retrieveOperation = TableOperation.Retrieve <EventTableServiceEntity>(partitionKey,
                                                                                      rowKey);
            var retrievedResult = table.Execute(retrieveOperation);
            var fetchedItem     = retrievedResult.Result as EventTableServiceEntity;

            if (fetchedItem == null)
            {
                return; //already deleted
            }
            var deleteOperation = TableOperation.Delete(fetchedItem);

            table.Execute(deleteOperation);
        }