Sunil Kumar
Sunil Kumar

Reputation: 416

Service Fabric: View contents of Reliable Dictionary while local debugging

Is there a way to view the contents of a reliable dictionary while local debugging. I can't find any property which gives me the contents.

Upvotes: 0

Views: 60

Answers (1)

Preben Huybrechts
Preben Huybrechts

Reputation: 6111

You can't inspect a property, but you could call CreateEnumerableAsync to get an async enumerable.

Sample:

using (var tran = this.stateManager.CreateTransaction())
{
    var asyncEnumerable = await yourDictionary.CreateEnumerableAsync(tran);
    var asyncEnumerator = asyncEnumerable.GetAsyncEnumerator();
    
    while (await asyncEnumerator.MoveNextAsync(cancelationToken))
    {
        log.Debug(asyncEnumerator.Current);
    }
}

Upvotes: 1

Related Questions