Skip to content

Commit

Permalink
enable more detailed logging and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsonax committed Apr 27, 2024
1 parent 13747f6 commit c03aa63
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CleanAspCore.Api.Tests/TestSetup/TestWebApi.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using CleanAspCore.Data;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Refit;
Expand Down Expand Up @@ -31,6 +33,14 @@ protected override IHost CreateHost(IHostBuilder builder)
});
});

builder.ConfigureServices(services =>
{
services.RemoveAll(typeof(DbContextOptions<HrContext>));
services.AddDbContext<HrContext>(c => c
.EnableSensitiveDataLogging()
.EnableDetailedErrors());
});

builder.ConfigureLogging(loggingBuilder =>
{
loggingBuilder.ClearProviders();
Expand Down

0 comments on commit c03aa63

Please sign in to comment.