From 14b089695ac87e1c04c142beeb6e6a4e3f2fd4b0 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Sun, 27 Jan 2019 19:31:10 +0300 Subject: [PATCH] Upgraded to ABP v0.13. --- .../Acme.BookStore.Application.csproj | 3 +- .../BookStoreApplicationModule.cs | 4 ++- .../Acme.BookStore.Domain.csproj | 3 +- .../BookStoreDomainModule.cs | 5 +++- .../Acme.BookStore.EntityFrameworkCore.csproj | 13 +++------ .../Acme.BookStore.Web.csproj | 8 ++--- .../Acme.BookStore.Web/BookStoreWebModule.cs | 29 +++++++++++++------ .../Acme.BookStore.Application.Tests.csproj | 4 +-- .../Acme.BookStore.ConsoleApiClient.csproj | 4 +-- .../Acme.BookStore.Web.Tests.csproj | 2 +- .../BookStoreWebTestModule.cs | 3 -- 11 files changed, 44 insertions(+), 34 deletions(-) diff --git a/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj b/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj index 58fe58df245..c4c7a91bd8f 100644 --- a/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj +++ b/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj @@ -7,7 +7,8 @@ - + + diff --git a/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationModule.cs b/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationModule.cs index e02c84a71db..00f57310f6c 100644 --- a/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationModule.cs +++ b/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationModule.cs @@ -4,12 +4,14 @@ using Volo.Abp.AutoMapper; using Volo.Abp.Identity; using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; namespace Acme.BookStore { [DependsOn( typeof(BookStoreDomainModule), - typeof(AbpIdentityApplicationModule))] + typeof(AbpIdentityApplicationModule), + typeof(AbpPermissionManagementApplicationModule))] public class BookStoreApplicationModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj b/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj index dea3e5e7577..02e24618eee 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj +++ b/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj @@ -6,7 +6,8 @@ - + + diff --git a/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs b/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs index 06d11fd7371..f959184126b 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs +++ b/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs @@ -5,12 +5,15 @@ using Volo.Abp.Localization; using Volo.Abp.Localization.Resources.AbpValidation; using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement.Identity; using Volo.Abp.Settings; using Volo.Abp.VirtualFileSystem; namespace Acme.BookStore { - [DependsOn(typeof(AbpIdentityDomainModule))] + [DependsOn( + typeof(AbpIdentityDomainModule), + typeof(AbpPermissionManagementDomainIdentityModule))] public class BookStoreDomainModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj index 203f14facd3..88d54432b26 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj @@ -5,17 +5,12 @@ Acme.BookStore - - - - - - - - - + + + + diff --git a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj index ff31ecd5d40..ae71fd38d89 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj +++ b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj @@ -27,10 +27,10 @@ - - - - + + + + diff --git a/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs b/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs index 47bb60241ed..6309f6164b6 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs +++ b/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs @@ -9,11 +9,11 @@ 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.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 @@ public override void OnApplicationInitialization(ApplicationInitializationContex private void SeedDatabase(ApplicationInitializationContext context) { - AsyncHelper.RunSync(async () => + using (var scope = context.ServiceProvider.CreateScope()) { - await context.ServiceProvider - .GetRequiredService() - .SeedAsync( - "1q2w3E*", - IdentityPermissions.GetAll() //.Union(BookStorePermissions.GetAll()) - ); - }); + AsyncHelper.RunSync(async () => + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync( + "1q2w3E*" + ); + + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync( + RolePermissionValueProvider.ProviderName, + "admin", + IdentityPermissions.GetAll() //.Union(BookStorePermissions.GetAll()) + ); + }); + } } } } diff --git a/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj b/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj index 83d050d10da..baa40a77a45 100644 --- a/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj +++ b/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/samples/BookStore/test/Acme.BookStore.ConsoleApiClient/Acme.BookStore.ConsoleApiClient.csproj b/samples/BookStore/test/Acme.BookStore.ConsoleApiClient/Acme.BookStore.ConsoleApiClient.csproj index b79c657695d..0972a7878d7 100644 --- a/samples/BookStore/test/Acme.BookStore.ConsoleApiClient/Acme.BookStore.ConsoleApiClient.csproj +++ b/samples/BookStore/test/Acme.BookStore.ConsoleApiClient/Acme.BookStore.ConsoleApiClient.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj b/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj index 43b637c1004..208552c0a80 100644 --- a/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj +++ b/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/samples/BookStore/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs b/samples/BookStore/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs index 42c3fde03d1..911b4ba3aae 100644 --- a/samples/BookStore/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs +++ b/samples/BookStore/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs @@ -4,16 +4,13 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Mvc.ApplicationParts; -using Microsoft.AspNetCore.Mvc.Internal; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Acme.BookStore.Localization.BookStore; using Acme.BookStore.Menus; using Volo.Abp; using Volo.Abp.Account.Web; -using Volo.Abp.AspNetCore.Modularity; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; -using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.TestBase; using Volo.Abp.Identity.Web; using Volo.Abp.Localization;