dotnet-sdk icon indicating copy to clipboard operation
dotnet-sdk copied to clipboard

Allow to configure ActionRuntimeOptions via a Func<IServiceProvider>

Open dariogriffo opened this issue 1 year ago • 2 comments

Describe the feature

Provide an extension method of ServiceCollection to allow to configure the actor runtime from a function with a IServiceProvider as parameter This will allow the configuration to be read from any app configuration. Example

services.AddActors(sp => sp.GetRequiredService<IConfiguration>().Bind<ActorRuntimeOptions>());

dariogriffo avatar Jan 31 '24 13:01 dariogriffo

I wonder if it'd be enough to just have AddActors() always do an implicit bind (or, only if no Action<ActorRuntimeOptions> argument is passed) rather than an overload just to return a service provider, just to pull the configuration.

philliphoff avatar Feb 01 '24 17:02 philliphoff

My problem is at the moment I have to get the dapr configuration out of the air or build a service provider with the configuration registered to get the configuration and use it in the next line when registering Dapr.

dariogriffo avatar Feb 01 '24 19:02 dariogriffo