This commit is contained in:
TheXamlGuy
2024-06-12 23:04:22 +01:00
parent c8f447251e
commit b155f5c6e2
40 changed files with 262 additions and 249 deletions
@@ -0,0 +1,17 @@
using Microsoft.Extensions.DependencyInjection;
namespace Toolkit.Foundation;
public static class IServiceProviderExtensions
{
public static object GetRequiredKeyedService(this IServiceProvider provider,
Type serviceType,
Action<object> serviceDelegate,
object? serviceKey)
{
object service = provider.GetRequiredKeyedService(serviceType, serviceKey);
serviceDelegate.Invoke(service);
return service;
}
}