DI Into Storage Providers
Hello Everyone,
I am just curious to know if Custom Storage Providers (Classes Implementing IStorage Providers), currently Participate in Dependency Injection (Can have services Injected Into Them) .
I think currently it's a service locator pattern. You can access to the service locator through IProviderRuntime.ServiceProvider in IProvider's Init method, though it is not technically a DI pattern. But there's a way to access to the services registered in the service locator
But we are trying to make DI in Orleans better, supporting DI in Providers is one of the tasks we are constantly talking about and making plans to make it better
The short answer is no. They do have access to the ServiceProvider to retrieve services, but currently provider instances are not created or registered with DI, so we don't support ctor injection yet.
As @xiazen wrote it will change in the future as we're moving more classes towards DI support.