Let's build a simple stateful application that would help us understand the various aspects of a reliable stateful application. We will build an up and down counter that will increment or decrement a counter value depending on the partition it belongs to. We will save the counter value in a ReliableDictionary instance and trace the current state of the dictionary so that we can visualize it in the Diagnostics Event Viewer console.
To begin, using Visual Studio create a new Service Fabric application named StatefulUpDownCounterApplication and add a Stateful Reliable Service to it. Name the service UpDownCounterService:
Let's first create two partitions of this service. For this ...