Skip to content

Commit

Permalink
Add LoggingBehavior to service container
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishan Wickramarathna committed Sep 3, 2021
1 parent c25c787 commit 596f7ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CQRSDemo/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CQRSDemo.Data;
using CQRSDemo.Helpers;
using MediatR;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
Expand All @@ -25,6 +26,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddCors();
services.AddControllers();
services.AddMediatR(typeof(Startup).Assembly);
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
services.AddScoped<IProductRepository,ProductRepository>();
services.AddSwaggerGen();
}
Expand Down

0 comments on commit 596f7ee

Please sign in to comment.