How to configure Orleans DI container to resolve a service with same instance per grain object graph?
<p>I'm using Microsoft Orleans, and I have a grain called ConsumerGrain that is associated with an Azure subscription by the subscription's id. The grain is injected with several application services in order to comply with SOLID principles. Some application services require the subscription's id. Instead of passing around the subscription id on every method call, I'd like to have an ISubscriptionContext object injected to every application service that requires the current subscription id, and I'd like the service instance to be created once per grain's object graph, so it can't be Transient not Singleton lifestyles. Can Scoped lifestyle be used here?</p>