@@ -27,22 +27,25 @@ public Startup(IHostingEnvironment env)
2727
2828 public void ConfigureServices ( IServiceCollection services )
2929 {
30+
3031 services . AddMvc ( )
31- . AddXmlSerializerFormatters ( )
32- . AddXmlDataContractSerializerFormatters ( )
33- . AddJsonOptions ( o =>
32+
33+ . AddXmlSerializerFormatters ( )
34+ . AddXmlDataContractSerializerFormatters ( )
35+ . AddJsonOptions ( o =>
3436 {
37+ o . SerializerSettings . DateFormatString = "yyyy-MM-dd'T'HH:mm:ss.fffzz" ;
3538 o . SerializerSettings . DateTimeZoneHandling = Newtonsoft . Json . DateTimeZoneHandling . Utc ;
3639 o . SerializerSettings . ReferenceLoopHandling = Newtonsoft . Json . ReferenceLoopHandling . Ignore ;
3740 o . SerializerSettings . NullValueHandling = Newtonsoft . Json . NullValueHandling . Ignore ;
3841 } ) ;
3942
4043 var connectionString = Configuration [ "DbContextSettings:ConnectionString_Postgres" ] ;
4144 connectionString = connectionString . Replace ( "{USER_ID}" , Environment . GetEnvironmentVariable ( "POSTGRES_USER" ) )
42- . Replace ( "{PASSWORD}" , Environment . GetEnvironmentVariable ( "POSTGRES_PASSWORD" ) )
43- . Replace ( "{DB}" , Environment . GetEnvironmentVariable ( "POSTGRES_DB" ) )
44- . Replace ( "{HOST}" , Environment . GetEnvironmentVariable ( "POSTGRES_HOST" ) )
45- . Replace ( "{PORT}" , Environment . GetEnvironmentVariable ( "POSTGRES_PORT" ) ) ;
45+ . Replace ( "{PASSWORD}" , Environment . GetEnvironmentVariable ( "POSTGRES_PASSWORD" ) )
46+ . Replace ( "{DB}" , Environment . GetEnvironmentVariable ( "POSTGRES_DB" ) )
47+ . Replace ( "{HOST}" , Environment . GetEnvironmentVariable ( "POSTGRES_HOST" ) )
48+ . Replace ( "{PORT}" , Environment . GetEnvironmentVariable ( "POSTGRES_PORT" ) ) ;
4649
4750 services . AddDbContext < ToDoDbContext > ( opts => opts . UseNpgsql ( connectionString ) ) ;
4851 services . AddScoped < IToDoDbContext , ToDoDbContext > ( ) ;
0 commit comments