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))); }
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); }