|
|
|
@ -9,11 +9,11 @@ using Acme.BookStore.Menus; |
|
|
|
using Swashbuckle.AspNetCore.Swagger; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Account.Web; |
|
|
|
using Volo.Abp.AspNetCore.Modularity; |
|
|
|
using Volo.Abp.AspNetCore.Mvc; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.Localization; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; |
|
|
|
using Volo.Abp.Authorization.Permissions; |
|
|
|
using Volo.Abp.Autofac; |
|
|
|
using Volo.Abp.AutoMapper; |
|
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
|
@ -22,6 +22,7 @@ using Volo.Abp.Identity.Web; |
|
|
|
using Volo.Abp.Localization; |
|
|
|
using Volo.Abp.Localization.Resources.AbpValidation; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.PermissionManagement; |
|
|
|
using Volo.Abp.Threading; |
|
|
|
using Volo.Abp.UI.Navigation; |
|
|
|
using Volo.Abp.VirtualFileSystem; |
|
|
|
@ -180,15 +181,25 @@ namespace Acme.BookStore |
|
|
|
|
|
|
|
private void SeedDatabase(ApplicationInitializationContext context) |
|
|
|
{ |
|
|
|
AsyncHelper.RunSync(async () => |
|
|
|
using (var scope = context.ServiceProvider.CreateScope()) |
|
|
|
{ |
|
|
|
await context.ServiceProvider |
|
|
|
.GetRequiredService<IIdentityDataSeeder>() |
|
|
|
.SeedAsync( |
|
|
|
"1q2w3E*", |
|
|
|
IdentityPermissions.GetAll() //.Union(BookStorePermissions.GetAll())
|
|
|
|
); |
|
|
|
}); |
|
|
|
AsyncHelper.RunSync(async () => |
|
|
|
{ |
|
|
|
await scope.ServiceProvider |
|
|
|
.GetRequiredService<IIdentityDataSeeder>() |
|
|
|
.SeedAsync( |
|
|
|
"1q2w3E*" |
|
|
|
); |
|
|
|
|
|
|
|
await scope.ServiceProvider |
|
|
|
.GetRequiredService<IPermissionDataSeeder>() |
|
|
|
.SeedAsync( |
|
|
|
RolePermissionValueProvider.ProviderName, |
|
|
|
"admin", |
|
|
|
IdentityPermissions.GetAll() //.Union(BookStorePermissions.GetAll())
|
|
|
|
); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|