7
7
using Microsoft . EntityFrameworkCore ;
8
8
using JsonApiDotNetCore . Extensions ;
9
9
using System ;
10
+ using Microsoft . Extensions . Logging . Console ;
11
+ using Microsoft . Extensions . Logging . Debug ;
10
12
11
13
namespace JsonApiDotNetCoreExample
12
14
{
@@ -24,6 +26,7 @@ public Startup(IWebHostEnvironment env)
24
26
Config = builder . Build ( ) ;
25
27
}
26
28
29
+
27
30
public virtual void ConfigureServices ( IServiceCollection services )
28
31
{
29
32
var loggerFactory = new LoggerFactory ( ) ;
@@ -36,15 +39,17 @@ public virtual void ConfigureServices(IServiceCollection services)
36
39
} )
37
40
. AddDbContext < AppDbContext > ( options =>
38
41
{
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 ) ) ) ;
40
45
} , ServiceLifetime . Transient )
41
46
. AddJsonApi ( options =>
42
47
{
43
48
options . Namespace = "api/v1" ;
44
49
options . DefaultPageSize = 5 ;
45
50
options . IncludeTotalRecordCount = true ;
46
51
options . EnableResourceHooks = true ;
47
- options . LoaDatabaseValues = true ;
52
+ options . LoadDatabaseValues = true ;
48
53
} ,
49
54
discovery => discovery . AddCurrentAssembly ( ) ) ;
50
55
services . AddClientSerialization ( ) ;
0 commit comments