MongolianBarbecue/Consumer.cs
/// <summary>
/// Gets whether a message with the given ID exists
/// </summary>
Gets whether a message with the given ID exists
Gets whether a message with the given ID exists
public async Task<bool> Exists(string messageId)
        {
            var collection = _config.Collection;
            var criteria = new BsonDocument
            {
                {"_id", messageId }
            };
            await _semaphore.WaitAsync();
            try
            {
                return await collection.CountAsync(new BsonDocumentFilterDefinition<BsonDocument>(criteria)) > 0;
            }
            finally
            {
                _semaphore.Release();
            }
        }
public async Task < bool > Exists ( string messageId ) { var collection = _config . Collection ; var criteria = new BsonDocument { { " " , messageId } } ; await _semaphore . WaitAsync ( ) ; try { return await collection . CountAsync ( new BsonDocumentFilterDefinition < BsonDocument > ( criteria ) ) > 0 ; } finally { _semaphore . Release ( ) ; } }
Gets whether a message with the given ID exists
Gets whether a message with the given ID exists
messageId
string