server-master/srcs/_plugins/WingsEmu.Plugins.BasicImplementation/ItemServiceCollectionExtensions.cs
2026-02-10 18:21:30 +01:00

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);
}
}
}