77using Microsoft . EntityFrameworkCore ;
88using JsonApiDotNetCore . Extensions ;
99using System ;
10+ using Microsoft . Extensions . Logging . Console ;
11+ using Microsoft . Extensions . Logging . Debug ;
1012
1113namespace JsonApiDotNetCoreExample
1214{
@@ -24,6 +26,7 @@ public Startup(IWebHostEnvironment env)
2426 Config = builder . Build ( ) ;
2527 }
2628
29+
2730 public virtual void ConfigureServices ( IServiceCollection services )
2831 {
2932 var loggerFactory = new LoggerFactory ( ) ;
@@ -36,15 +39,17 @@ public virtual void ConfigureServices(IServiceCollection services)
3639 } )
3740 . AddDbContext < AppDbContext > ( options =>
3841 {
39- options . UseNpgsql ( GetDbConnectionString ( ) , options => options . SetPostgresVersion ( new Version ( 9 , 6 ) ) ) ;
42+ options . UseLoggerFactory ( new LoggerFactory ( new [ ] { new DebugLoggerProvider ( ) } ) )
43+ . EnableSensitiveDataLogging ( )
44+ . UseNpgsql ( GetDbConnectionString ( ) , options => options . SetPostgresVersion ( new Version ( 9 , 6 ) ) ) ;
4045 } , ServiceLifetime . Transient )
4146 . AddJsonApi ( options =>
4247 {
4348 options . Namespace = "api/v1" ;
4449 options . DefaultPageSize = 5 ;
4550 options . IncludeTotalRecordCount = true ;
4651 options . EnableResourceHooks = true ;
47- options . LoaDatabaseValues = true ;
52+ options . LoadDatabaseValues = true ;
4853 } ,
4954 discovery => discovery . AddCurrentAssembly ( ) ) ;
5055 services . AddClientSerialization ( ) ;
0 commit comments