I'm using Hexagon Architecture
I have 2 driving sides, let's call them A and B (they are two difference assemblies)
The problem is the all the Dependency Injection configuration of the driving A are also applied on the driving B, and I don't want that.
for example:
I disable auto validate FromBody in driving A by using:
public static void AddApiServices(this IServiceCollection services)
{
services.Configure<ApiBehaviorOptions>(
options => { options.SuppressModelStateInvalidFilter = true; });
}
but this configuration will also apply on the driving B (I call the extention method in StartUp project)
also with WebApplication
the code below also apply to both
public static void UseApiConfiguration(this WebApplication app)
{
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.MapControllers();
}
do you have any ideas, please help me, thank you so much