AdventOfCode/AdventOfCode.Solutions/ServiceConfiguration.cs
2024-12-01 10:17:24 +01:00

24 lines
720 B
C#

using AdventOfCode.Solutions._2024;
using Microsoft.Extensions.DependencyInjection;
namespace AdventOfCode.Solutions
{
public static class ServiceConfiguration
{
public static IServiceCollection AddChallanges(this IServiceCollection services)
{
IEnumerable<Type> challanges = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes())
.Where(t => t.GetInterfaces().Contains(typeof(IChallange)));
services.AddScoped<IChallange, Day01>();
//foreach (Type challange in challanges)
//{
// services.AddScoped(typeof(IChallange), challange);
//}
return services;
}
}
}