Grains with multiple states
An Orleans grain can have more than one state and they can be from different state providers. The HotelGrain
class we implemented has the checkedInGuests
state and it is persisted to Azure Cosmos DB. The main business of Distel is providing hospitality at all the locations of the seven wonders of the world. Consider that we may have a partnership with others to provide services such as transport for our guests. To manage this, we need to have the HotelGrain
state manage the partner relationships. Though this should be part of the HotelGrain
state, we may not want to club this with the checkedInGuests
state as they both represent two different entities. Since the two states are separate concerns from each other, we will track them separately, with two different state providers. In this section, we will learn about having multiple states for the grain with different providers.
Follow the steps outlined here to add a new state:
- Let's start by...