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
Actually, when I want to decorate specified service by key string, there is no way to do that, but I noticed DecorationStrategy.WithType method can create DecorationStrategy and i can decorate by key through method Decorate by overload. But I can only do that by reflection. Please consider making WithType to public accessibility
publicstaticIServiceCollectionDecorateKeyedService<TService,TDecorator>(thisIServiceCollectionservices,stringkey){varmethod=typeof(DecorationStrategy).GetMethod("WithType",System.Reflection.BindingFlags.Static|System.Reflection.BindingFlags.NonPublic);if(method==null){thrownewInvalidOperationException("DecorationStrategy.WithType method not found");}varobj=method?.Invoke(null,[typeof(TService),key,typeof(TDecorator)])asDecorationStrategy;if(obj==null){thrownewInvalidOperationException("DecorationStrategy.WithType invocation failed");}services.Decorate(obj);returnservices;}
The text was updated successfully, but these errors were encountered:
Actually, when I want to decorate specified service by key string, there is no way to do that, but I noticed
DecorationStrategy.WithType
method can createDecorationStrategy
and i can decorate by key through methodDecorate
by overload. But I can only do that by reflection. Please consider makingWithType
to public accessibilityThe text was updated successfully, but these errors were encountered: