diff --git a/Sheaft.Identity/Startup.cs b/Sheaft.Identity/Startup.cs index c1d9b29..9cbbc73 100644 --- a/Sheaft.Identity/Startup.cs +++ b/Sheaft.Identity/Startup.cs @@ -277,16 +277,16 @@ public void Configure(IApplicationBuilder app) if (!authContext.Roles.Any()) { var rm = serviceScope.ServiceProvider.GetService>(); - rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Admin:value")) { Id = Configuration.GetValue("Roles:Admin:id") }).Wait(); - rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Support:value")) { Id = Configuration.GetValue("Roles:Support:id") }).Wait(); - rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:AppUser:value")) { Id = Configuration.GetValue("Roles:AppUser:id") }).Wait(); + rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Admin:value")) { Id = Configuration.GetValue("Roles:Admin:id").ToString("D") }).Wait(); + rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Support:value")) { Id = Configuration.GetValue("Roles:Support:id").ToString("D") }).Wait(); + rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:AppUser:value")) { Id = Configuration.GetValue("Roles:AppUser:id").ToString("D") }).Wait(); //specific for sheaft - rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:User:value")) { Id = Configuration.GetValue("Roles:User:id") }).Wait(); - rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Consumer:value")) { Id = Configuration.GetValue("Roles:Consumer:id") }).Wait(); - rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Owner:value")) { Id = Configuration.GetValue("Roles:Owner:id") }).Wait(); - rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Producer:value")) { Id = Configuration.GetValue("Roles:Producer:id") }).Wait(); - rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Store:value")) { Id = Configuration.GetValue("Roles:Store:id") }).Wait(); - rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Anonymous:value")) { Id = Configuration.GetValue("Roles:Anonymous:id") }).Wait(); + rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:User:value")) { Id = Configuration.GetValue("Roles:User:id").ToString("D") }).Wait(); + rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Consumer:value")) { Id = Configuration.GetValue("Roles:Consumer:id").ToString("D") }).Wait(); + rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Owner:value")) { Id = Configuration.GetValue("Roles:Owner:id").ToString("D") }).Wait(); + rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Producer:value")) { Id = Configuration.GetValue("Roles:Producer:id").ToString("D") }).Wait(); + rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Store:value")) { Id = Configuration.GetValue("Roles:Store:id").ToString("D") }).Wait(); + rm.CreateAsync(new IdentityRole(Configuration.GetValue("Roles:Anonymous:value")) { Id = Configuration.GetValue("Roles:Anonymous:id").ToString("D") }).Wait(); authContext.SaveChanges(); }