24 lines
720 B
C#
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;
|
|
}
|
|
}
|
|
}
|