There is limited support for DI beans. This function promises to be delivered shortly, but, as in 1.0.9, there is no traditional constructor injection.
Until now, you can use the (anti-pattern) ServiceLocator using the frameworks of your choice (for example, for this we use Autofac and CommonServiceLocator) to solve the services that you want to call inside your grain instance.
For unit testing - there is a Grain constructor that you can use to create an instance of grain using mocks (see more details here )
I invite you to a conversation with the orchestra in Orleans (as in the link above), where you can see answers and discussions around some other burning questions.
source share