Service Fabric: View contents of Reliable Dictionary while local debugging

69 Views Asked by At

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.

1

There are 1 best solutions below

1
On BEST ANSWER

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