You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

18 lines
581 B

using Microsoft.Extensions.DependencyInjection;
using Tiobon.Core.Option.Core;
namespace Tiobon.Core.Extensions.ServiceExtensions;
public static class AllOptionRegister
{
public static void AddAllOptionRegister(this IServiceCollection services)
{
if (services == null) throw new ArgumentNullException(nameof(services));
foreach (var optionType in App.EffectiveTypes.Where(s =>
!s.IsInterface && typeof(IConfigurableOptions).IsAssignableFrom(s)))
{
services.AddConfigurableOptions(optionType);
}
}
}