You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new HostBuilder().ConfigureFunctionsWorkerDefaults().ConfigureServices(services =>{// Currently unavailable services.AddKeyedSingleton<ICache,BigCache>("big") services.AddKeyedSingleton<ICache,SmallCache>("small")}
Describe alternatives you've considered
Injecting multiple instances of the same class and accessing them through an IEnumerable<>. Implementing a factory pattern.
The text was updated successfully, but these errors were encountered:
What problem would the feature you're requesting solve? Please describe.
Keyed services dependency injection was introduced in .NET 8. It appears to be unavailable when configuring services for Azure Functions. Including this feature would be great to have!
Describe the solution you'd like
Add support for keyed services dependency injection (
AddKeyedSingleton
,AddKeyedScoped
, andAddKeyedTransient
).For example,
services.AddKeyedSingleton
would be available with the following project file and Program.csDescribe alternatives you've considered
Injecting multiple instances of the same class and accessing them through an
IEnumerable<>
. Implementing a factory pattern.The text was updated successfully, but these errors were encountered: