Skip to content

Commit

Permalink
update mediatr
Browse files Browse the repository at this point in the history
  • Loading branch information
HaikAsatryan committed May 14, 2024
1 parent ab90cbe commit 27df0c3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public static WebApplicationBuilder AddMediatrWithBehaviors(this WebApplicationB
{
var assemblies = AssemblyRegistry.GetAllAssemblies();
builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblies(assemblies.ToArray()));
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(ValidationBehaviorWithoutResponse<,>));
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(ValidationBehaviorWithResponse<,>));
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
builder.Services.AddValidatorsFromAssemblies(assemblies);
return builder;
}
Expand Down

0 comments on commit 27df0c3

Please sign in to comment.