DB
Size: a a a
DB
DB
AK
K
I
I
IC
IC
I
VS
VS
LD
System.Type
в IOptions<Type>
, знаю есть - https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.options.create?view=dotnet-plat-ext-5.0, но компайл тайм ошибка - The type 'System.Type' must have a public parameterless constructor in order to use it as parameter 'TOptions' in the generic method 'IOptions<TOptions>
Assembly.GetExecutingAssembly()
.GetTypes()
.Where(type => type
.GetInterfaces()
.Contains(typeof(Bar)))
.Where(type => type.GetConstructor(Type.EmptyTypes) != null) - хинт, что есть parameterless public ctor
.Select(type => Microsoft.Extensions.Options.Options.Create(type)
.ToList();
LD