Replies: 1 comment 2 replies
-
|
It seems like Microsoft assumes that if you're using this, you're already smart enough to write the extension yourself ;) I've attached an example of an extension you can write, but I think it's just a workaround: public static void TryAddSingleton<TService, TImplementation>(
this IServiceCollection services,
Func<IServiceProvider, TImplementation> factory)
where TService : class
where TImplementation : class, TService
{
services.TryAddSingleton<TService>(factory);
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
does any one know what there is not a TryAddX version of this overload with both Type params like
the only overloads it has with implementation factories are
Beta Was this translation helpful? Give feedback.
All reactions