@@ -80,30 +80,34 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
8080 var migrationsAssembly = typeof ( Startup ) . GetTypeInfo ( ) . Assembly . GetName ( ) . Name ;
8181
8282 // Adds IdentityServer
83- services . AddIdentityServer ( x => x . IssuerUri = "null" )
84- . AddSigningCredential ( Certificate . Get ( ) )
85- . AddAspNetIdentity < ApplicationUser > ( )
86- . AddConfigurationStore ( options =>
83+ services . AddIdentityServer ( x =>
84+ {
85+ x . IssuerUri = "null" ;
86+ x . Authentication . CookieLifetime = TimeSpan . FromHours ( 2 ) ;
87+ } )
88+ . AddSigningCredential ( Certificate . Get ( ) )
89+ . AddAspNetIdentity < ApplicationUser > ( )
90+ . AddConfigurationStore ( options =>
91+ {
92+ options . ConfigureDbContext = builder => builder . UseSqlServer ( connectionString ,
93+ sqlServerOptionsAction : sqlOptions =>
94+ {
95+ sqlOptions . MigrationsAssembly ( migrationsAssembly ) ;
96+ //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
97+ sqlOptions . EnableRetryOnFailure ( maxRetryCount : 15 , maxRetryDelay : TimeSpan . FromSeconds ( 30 ) , errorNumbersToAdd : null ) ;
98+ } ) ;
99+ } )
100+ . AddOperationalStore ( options =>
87101 {
88102 options . ConfigureDbContext = builder => builder . UseSqlServer ( connectionString ,
89- sqlServerOptionsAction : sqlOptions =>
90- {
91- sqlOptions . MigrationsAssembly ( migrationsAssembly ) ;
92- //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
93- sqlOptions . EnableRetryOnFailure ( maxRetryCount : 15 , maxRetryDelay : TimeSpan . FromSeconds ( 30 ) , errorNumbersToAdd : null ) ;
94- } ) ;
103+ sqlServerOptionsAction : sqlOptions =>
104+ {
105+ sqlOptions . MigrationsAssembly ( migrationsAssembly ) ;
106+ //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
107+ sqlOptions . EnableRetryOnFailure ( maxRetryCount : 15 , maxRetryDelay : TimeSpan . FromSeconds ( 30 ) , errorNumbersToAdd : null ) ;
108+ } ) ;
95109 } )
96- . AddOperationalStore ( options =>
97- {
98- options . ConfigureDbContext = builder => builder . UseSqlServer ( connectionString ,
99- sqlServerOptionsAction : sqlOptions =>
100- {
101- sqlOptions . MigrationsAssembly ( migrationsAssembly ) ;
102- //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
103- sqlOptions . EnableRetryOnFailure ( maxRetryCount : 15 , maxRetryDelay : TimeSpan . FromSeconds ( 30 ) , errorNumbersToAdd : null ) ;
104- } ) ;
105- } )
106- . Services . AddTransient < IProfileService , ProfileService > ( ) ;
110+ . Services . AddTransient < IProfileService , ProfileService > ( ) ;
107111
108112 var container = new ContainerBuilder ( ) ;
109113 container . Populate ( services ) ;
0 commit comments