|
|
@ -80,30 +80,34 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API |
|
|
|
var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name; |
|
|
|
|
|
|
|
// Adds IdentityServer
|
|
|
|
services.AddIdentityServer(x => x.IssuerUri = "null") |
|
|
|
.AddSigningCredential(Certificate.Get()) |
|
|
|
.AddAspNetIdentity<ApplicationUser>() |
|
|
|
.AddConfigurationStore(options => |
|
|
|
services.AddIdentityServer(x => |
|
|
|
{ |
|
|
|
x.IssuerUri = "null"; |
|
|
|
x.Authentication.CookieLifetime = TimeSpan.FromHours(2); |
|
|
|
}) |
|
|
|
.AddSigningCredential(Certificate.Get()) |
|
|
|
.AddAspNetIdentity<ApplicationUser>() |
|
|
|
.AddConfigurationStore(options => |
|
|
|
{ |
|
|
|
options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString, |
|
|
|
sqlServerOptionsAction: sqlOptions => |
|
|
|
{ |
|
|
|
sqlOptions.MigrationsAssembly(migrationsAssembly); |
|
|
|
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
|
|
|
|
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null); |
|
|
|
}); |
|
|
|
}) |
|
|
|
.AddOperationalStore(options => |
|
|
|
{ |
|
|
|
options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString, |
|
|
|
sqlServerOptionsAction: sqlOptions => |
|
|
|
{ |
|
|
|
sqlOptions.MigrationsAssembly(migrationsAssembly); |
|
|
|
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
|
|
|
|
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null); |
|
|
|
}); |
|
|
|
sqlServerOptionsAction: sqlOptions => |
|
|
|
{ |
|
|
|
sqlOptions.MigrationsAssembly(migrationsAssembly); |
|
|
|
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
|
|
|
|
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null); |
|
|
|
}); |
|
|
|
}) |
|
|
|
.AddOperationalStore(options => |
|
|
|
{ |
|
|
|
options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString, |
|
|
|
sqlServerOptionsAction: sqlOptions => |
|
|
|
{ |
|
|
|
sqlOptions.MigrationsAssembly(migrationsAssembly); |
|
|
|
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
|
|
|
|
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null); |
|
|
|
}); |
|
|
|
}) |
|
|
|
.Services.AddTransient<IProfileService, ProfileService>(); |
|
|
|
.Services.AddTransient<IProfileService, ProfileService>(); |
|
|
|
|
|
|
|
var container = new ContainerBuilder(); |
|
|
|
container.Populate(services); |
|
|
|