17 lines
No EOL
486 B
C#
17 lines
No EOL
486 B
C#
using System;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using PhoenixLib.Extensions;
|
|
|
|
namespace WingsEmu.Plugins.BasicImplementations;
|
|
|
|
public static class ItemServiceCollectionExtensions
|
|
{
|
|
public static void AddHandlers<TPlugin, T>(this IServiceCollection services)
|
|
{
|
|
Type[] types = typeof(TPlugin).Assembly.GetTypesImplementingInterface<T>();
|
|
foreach (Type handlerType in types)
|
|
{
|
|
services.AddTransient(handlerType);
|
|
}
|
|
}
|
|
} |