Код: Выделить всё
public sealed class Test : FeatureBase where TDbContext : ContextBase where TIAccessor : class, IAccessorBase where TAccessor : AccessorBase, TIAccessor
{
public override IServiceCollection ConfigService(WebApplicationBuilder builder, ConfigureFeatureOptions options)
{
foreach(Test test in options.Features())
{
_ = builder.Services
.AddScoped()
.AddScoped();
}
return builder.Services;
}
}
< /code>
Где я хочу его использовать: < /p>
FeatureUtility.ConfigureService(builder, featureOptions);
shrong>featurebase.configservice:
public static IServiceCollection ConfigureService(WebApplicationBuilder builder, ConfigureFeatureOptions options) where TFeature : class, IFeatureBase
{
if(options.Features.Exists())
{
foreach(TFeature feat in options.Features.Get())
{
feat.ConfigService(builder, options);
}
}
return builder.Services;
}
< /code>
В основном я хочу пройти в тесте to factionbase.configservice. < /p>
Есть идеи? Или что -то мне не хватает?
Подробнее здесь: https://stackoverflow.com/questions/796 ... ypes-in-c3
Мобильная версия