Browse Source

Merge branch 'dev' into refactor/sort

pull/1875/head
Yasin Aydın 7 years ago
committed by GitHub
parent
commit
a30d6d58e6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 58
      docs/en/Authorization.md
  2. 8
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/AbpAspNetCoreMvcUiMultiTenancyModule.cs
  3. 11
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs
  4. 33
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/MainNavbar/Default.cshtml
  5. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml
  6. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml
  7. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/Default.cshtml
  8. 6
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/Default.cshtml
  9. 6
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/Default.cshtml
  10. 50
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml
  11. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml
  12. 73
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/layout.css
  13. 11
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/AbpAspNetCoreMvcUiThemeSharedModule.cs
  14. 5
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpAspNetCoreMvcUiWidgetsModule.cs
  15. 11
      framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/AbpAspNetCoreMvcUiModule.cs
  16. 20
      framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpMvcBuilderExtensions.cs
  17. 3
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs
  18. 63
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/InProcess/CurrentDirectoryHelpers.cs
  19. 4
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs
  20. 61
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml
  21. 66
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.cshtml
  22. 23
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml
  23. 3
      modules/blogging/app/Volo.BloggingTestApp/Program.cs
  24. 3
      modules/client-simulation/demo/Volo.ClientSimulation.Demo/Program.cs
  25. 3
      modules/docs/app/VoloDocs.Web/Program.cs
  26. 3
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs
  27. 27
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs
  28. 6
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml
  29. 3
      npm/ng-packs/packages/core/src/lib/tests/config.plugin.spec.ts
  30. 2
      npm/ng-packs/packages/core/src/lib/tests/locale.provider.spec.ts
  31. 6
      npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts
  32. 8
      npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html
  33. 4
      npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.html
  34. 6
      npm/ng-packs/scripts/push.js
  35. 8
      samples/BookStore-Angular-MongoDb/angular/package.json
  36. 14
      samples/BookStore-Angular-MongoDb/angular/src/app/app.module.ts
  37. 2
      samples/BookStore-Angular-MongoDb/angular/src/app/home/home.component.html
  38. 6
      samples/BookStore-Angular-MongoDb/angular/src/environments/environment.hmr.ts
  39. 6
      samples/BookStore-Angular-MongoDb/angular/src/environments/environment.prod.ts
  40. 6
      samples/BookStore-Angular-MongoDb/angular/src/environments/environment.ts
  41. 26
      samples/BookStore-Angular-MongoDb/aspnet-core/Acme.BookStore.sln.DotSettings
  42. 2
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj
  43. 0
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application.Contracts/Permissions/BookStorePermissionDefinitionProvider.cs
  44. 0
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application.Contracts/Permissions/BookStorePermissions.cs
  45. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj
  46. 3
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application/BookStoreApplicationAutoMapperProfile.cs
  47. 6
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application/BookStoreApplicationModule.cs
  48. 5
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj
  49. 6
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/BookStoreDbMigratorModule.cs
  50. 6
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/appsettings.json
  51. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj
  52. 5
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj
  53. 46
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain/BookStoreDataSeederContributor.cs
  54. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs
  55. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Client/Acme.BookStore.HttpApi.Client.csproj
  56. 10
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj
  57. 21
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/BookStoreHttpApiHostModule.cs
  58. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Controllers/HomeController.cs
  59. 3
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Program.cs
  60. 6
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Properties/launchSettings.json
  61. 2
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Startup.cs
  62. 7
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/appsettings.json
  63. 2
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/package.json
  64. 8196
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/wwwroot/libs/luxon/luxon.js
  65. 1
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/wwwroot/libs/luxon/luxon.js.map
  66. 1
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/wwwroot/libs/luxon/luxon.min.js
  67. 1
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/wwwroot/libs/luxon/luxon.min.js.map
  68. 219
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/yarn.lock
  69. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi/Acme.BookStore.HttpApi.csproj
  70. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.MongoDB/Acme.BookStore.MongoDB.csproj
  71. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj
  72. 72
      samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs
  73. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj
  74. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj
  75. 6
      samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/appsettings.json
  76. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/Acme.BookStore.MongoDB.Tests.csproj
  77. 2
      samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/MongoDb/BookStoreMongoDbTestModule.cs
  78. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj
  79. 43
      samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/BookStoreTestDataSeedContributor.cs
  80. 12
      samples/BookStore-Modular/application/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj
  81. 14
      samples/BookStore-Modular/application/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj
  82. 6
      samples/BookStore-Modular/application/src/Acme.BookStore.Application/BookStoreApplicationModule.cs
  83. 5
      samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj
  84. 2
      samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/appsettings.json
  85. 18
      samples/BookStore-Modular/application/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj
  86. 22
      samples/BookStore-Modular/application/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj
  87. 4
      samples/BookStore-Modular/application/src/Acme.BookStore.Domain/BookStoreDomainModule.cs
  88. 6
      samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj
  89. 18
      samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190918061142_Initial.Designer.cs
  90. 14
      samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190918061142_Initial.cs
  91. 782
      samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191008070344_Added_Book_Entity.Designer.cs
  92. 15
      samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191008070344_Added_Book_Entity.cs
  93. 780
      samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/BookStoreMigrationsDbContextModelSnapshot.cs
  94. 22
      samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj
  95. 14
      samples/BookStore-Modular/application/src/Acme.BookStore.HttpApi.Client/Acme.BookStore.HttpApi.Client.csproj
  96. 14
      samples/BookStore-Modular/application/src/Acme.BookStore.HttpApi/Acme.BookStore.HttpApi.csproj
  97. 24
      samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj
  98. 25
      samples/BookStore-Modular/application/src/Acme.BookStore.Web/BookStoreWebModule.cs
  99. 5
      samples/BookStore-Modular/application/src/Acme.BookStore.Web/Program.cs
  100. 6
      samples/BookStore-Modular/application/src/Acme.BookStore.Web/Properties/launchSettings.json

58
docs/en/Authorization.md

@ -1,10 +1,10 @@
# Authorization
Authorization is used to check if a user is allowed to perform some specific operation in the application.
Authorization is used to check if a user is allowed to perform some specific operations in the application.
ABP extends [ASP.NET Core's Authorization system](https://docs.microsoft.com/en-us/aspnet/core/security/authorization/introduction) by adding **permissions** as auto [policies](https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies) and allowing authorization system to be usable in the **[application services](Application-Services.md)** too.
ABP extends [ASP.NET Core Authorization](https://docs.microsoft.com/en-us/aspnet/core/security/authorization/introduction) by adding **permissions** as auto [policies](https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies) and allowing authorization system to be usable in the **[application services](Application-Services.md)** too.
So, all the ASP.NET Core authorization features and the documentation are valid in an ABP based application. This document focuses on the features added on top of them.
So, all the ASP.NET Core authorization features and the documentation are valid in an ABP based application. This document focuses on the features that added on top of ASP.NET Core authorization features.
## Authorize Attribute
@ -45,17 +45,17 @@ namespace Acme.BookStore
````
* `Authorize` attribute forces user to login to the application in order to use the `AuthorAppService` methods. So, `GetListAsync` method is only available to authenticated users.
* `AllowAnonymous` suppress the authentication. So, `GetAsync` method is available to everyone including unauthorized users.
* `Authorize` attribute forces the user to login into the application in order to use the `AuthorAppService` methods. So, `GetListAsync` method is only available to the authenticated users.
* `AllowAnonymous` suppresses the authentication. So, `GetAsync` method is available to everyone including unauthorized users.
* `[Authorize("BookStore_Author_Create")]` defines a policy (see [policy based authorization](https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies)) that is checked to authorize the current user.
"BookStore_Author_Create" is an arbitrary policy name. If you declare an attribute like that, ASP.NET Core authorization system expects a policy defined before.
"BookStore_Author_Create" is an arbitrary policy name. If you declare an attribute like that, ASP.NET Core authorization system expects a policy to be defined before.
You can of course implement your policies as stated in the ASP.NET Core documentation. But for simple true/false cases (that means a policy was granted a user or not), ABP defines the permission system explained in the next section.
You can, of course, implement your policies as stated in the ASP.NET Core documentation. But for simple true/false conditions like a policy was granted to a user or not, ABP defines the permission system which will be explained in the next section.
## Permission System
A permission is a simple policy where it is granted or prohibited for a particular user, role or client.
A permission is a simple policy that is granted or prohibited for a particular user, role or client.
### Defining Permissions
@ -78,9 +78,9 @@ namespace Acme.BookStore.Permissions
}
````
> ABP will automatically discover this class. No additional configuration required.
> ABP automatically discovers this class. No additional configuration required!
In the `Define` method, you first need to add a **permission group** (or get an existing group) then add **permissions** to this group.
In the `Define` method, you first need to add a **permission group** or get an existing group then add **permissions** to this group.
When you define a permission, it becomes usable in the ASP.NET Core authorization system as a **policy** name. It also becomes visible in the UI. See permissions dialog for a role:
@ -95,7 +95,7 @@ When you save the dialog, it is saved to the database and used in the authorizat
#### Localizing the Permission Name
"BookStore_Author_Create" is not a good permission name on the UI. Fortunately, `AddPermission` and `AddGroup` methods can take `LocalizableString` as second parameters:
"BookStore_Author_Create" is not a good permission name for the UI. Fortunately, `AddPermission` and `AddGroup` methods can take `LocalizableString` as second parameters:
````csharp
var myGroup = context.AddGroup(
@ -116,9 +116,9 @@ Then you can define texts for "BookStore" and "Permission:BookStore_Author_Creat
"Permission:BookStore_Author_Create": "Creating a new author"
````
> See the [localization document](Localization.md) for more details on the localization system.
> For more information, see the [localization document](Localization.md) on the localization system.
The localized UI will be like that:
The localized UI will be as seen below:
![authorization-new-permission-ui-localized](images/authorization-new-permission-ui-localized.png)
@ -195,12 +195,12 @@ public class AuthorAppService : ApplicationService, IAuthorAppService
}
````
* `GetListAsync` and `GetAsync` will be available to users if they have `Author_Management` permission granted.
* `GetListAsync` and `GetAsync` will be available to users if they have `Author_Management` permission is granted.
* Other methods require additional permissions.
### Overriding a Permission by a Custom Policy
If you define and register a policy to the ASP.NET Core authorization system with the same name of a permission, your policy will override the existing permission. This is a powerful way to extend authorization for a pre-built module you are using in your application.
If you define and register a policy to the ASP.NET Core authorization system with the same name of a permission, your policy will override the existing permission. This is a powerful way to extend the authorization for a pre-built module that you are using in your application.
See [policy based authorization](https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies) document to learn how to define a custom policy.
@ -240,15 +240,15 @@ public async Task CreateAsync(CreateAuthorDto input)
}
````
`CheckAsync` extension method throws `AbpAuthorizationException` if current user/client has not granted for the given permission. There is also `IsGrantedAsync` extension method that returns `true` or `false`.
`CheckAsync` extension method throws `AbpAuthorizationException` if the current user/client is not granted for the given permission. There is also `IsGrantedAsync` extension method that returns `true` or `false`.
`IAuthorizationService` has some overloads for the `AuthorizeAsync` method those are already explained in the [ASP.NET Core authorization documentation](https://docs.microsoft.com/en-us/aspnet/core/security/authorization/introduction).
`IAuthorizationService` has some overloads for the `AuthorizeAsync` method. These are explained in the [ASP.NET Core authorization documentation](https://docs.microsoft.com/en-us/aspnet/core/security/authorization/introduction).
> Tip: Prefer to use the `Authorize` attribute wherever possible, since it is declarative & simple. Use `IAuthorizationService` if you need to conditionally check a permission and run a business code based on the permission check.
### Check a Permission in JavaScript
You may need to check a policy/permission in the client side. For ASP.NET Core MVC / Razor Pages applications, you can use the `abp.auth` API. Example:
You may need to check a policy/permission on the client side. For ASP.NET Core MVC / Razor Pages applications, you can use the `abp.auth` API. Example:
````js
abp.auth.isGranted('MyPermissionName');
@ -290,17 +290,17 @@ public class MyService : ITransientDependency
`IPermissionManager` is defined by the permission management module. See the [permission management module documentation](Modules/Permission-Management.md) for more information.
## Avdanced Topics
## Advanced Topics
### Permission Value Providers
Permission checking system is extensible. Any class derived from `PermissionValueProvider` (or implements `IPermissionValueProvider`) can contribute to the permission check. There are three pre-defined value providers:
* `UserPermissionValueProvider` checks if current user has granted for the given permission. It gets user id from the current claims. User claim name is defined with the `AbpClaimTypes.UserId` static property.
* `RolePermissionValueProvider` checks if any of the roles of the current user has granted for the given permission. It gets role names from the current claims. Role claims name is defined with the `AbpClaimTypes.Role` static property.
* `ClientPermissionValueProvider` checks if current client has granted for the given permission. This is especially useful on a machine to machine interaction where there is no current user. It gets client id from the current claims. Client claim name is defined with the `AbpClaimTypes.ClientId` static property.
* `UserPermissionValueProvider` checks if the current user is granted for the given permission. It gets user id from the current claims. User claim name is defined with the `AbpClaimTypes.UserId` static property.
* `RolePermissionValueProvider` checks if any of the roles of the current user is granted for the given permission. It gets role names from the current claims. Role claims name is defined with the `AbpClaimTypes.Role` static property.
* `ClientPermissionValueProvider` checks if the current client is granted for the given permission. This is especially useful on a machine to machine interaction where there is no current user. It gets the client id from the current claims. Client claim name is defined with the `AbpClaimTypes.ClientId` static property.
You can extend permission check system by defining your own permission value provider.
You can extend the permission checking system by defining your own permission value provider.
Example:
@ -331,9 +331,9 @@ This provider allows for all permissions to a user with a `User_Type` claim that
A permission value provider should return one of the following values from the `CheckAsync` method:
* `PermissionGrantResult.Granted` is returned to grant the user for the permission. If any of the providers returns `Granted`, the result will be `Granted` if no other provider returns `Prohibited`.
* `PermissionGrantResult.Prohibited` is returned to prohibit the user for the permission. If any of the providers returns `Prohibited`, the result will always be `Prohibited`. Doesn't matter what other providers return.
* `PermissionGrantResult.Undefined` is returned if this value provider could not decide about the permission value. Return this to let other providers to check the permission.
* `PermissionGrantResult.Granted` is returned to grant the user for the permission. If any of the providers return `Granted`, the result will be `Granted`, if no other provider returns `Prohibited`.
* `PermissionGrantResult.Prohibited` is returned to prohibit the user for the permission. If any of the providers return `Prohibited`, the result will always be `Prohibited`. Doesn't matter what other providers return.
* `PermissionGrantResult.Undefined` is returned if this value provider could not decide about the permission value. Return this to let other providers check the permission.
Once a provider is defined, it should be added to the `PermissionOptions` as shown below:
@ -346,11 +346,11 @@ Configure<PermissionOptions>(options =>
### Permission Store
`IPermissionStore` is the only interface needs to be implemented to read the value of permissions from a persistence source, generally a database system. Permission management module implements it. See the [permission management module documentation](Modules/Permission-Management.md) for more information
`IPermissionStore` is the only interface that needs to be implemented to read the value of permissions from a persistence source, generally a database system. Permission management module implements it. See the [permission management module documentation](Modules/Permission-Management.md) for more information
### AlwaysAllowAuthorizationService
`AlwaysAllowAuthorizationService` is a class that is used to bypasses the authorization service. It is generally used in integration tests where you may want to disable the authorization system.
`AlwaysAllowAuthorizationService` is a class that is used to bypass the authorization service. It is generally used in integration tests where you may want to disable the authorization system.
Use `IServiceCollection.AddAlwaysAllowAuthorization()` extension method to register the `AlwaysAllowAuthorizationService` to the [dependency injection](Dependency-Injection.md) system:
@ -366,4 +366,4 @@ This is already done for the startup template integration tests.
## See Also
* [Permission Management Module](Modules/Permission-Management.md)
* [ASP.NET Core MVC / Razor Pages JavaScript Auth API](AspNetCore/JavaScript-API/Auth.md)
* [ASP.NET Core MVC / Razor Pages JavaScript Auth API](AspNetCore/JavaScript-API/Auth.md)

8
framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/AbpAspNetCoreMvcUiMultiTenancyModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.AspNetCore.MultiTenancy;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.Localization;
@ -25,6 +26,11 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy
typeof(AbpAspNetCoreMvcUiMultiTenancyModule).Assembly
);
});
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAspNetCoreMvcUiMultiTenancyModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)

11
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Toolbars;
@ -17,6 +18,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
)]
public class AbpAspNetCoreMvcUiBasicThemeModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAspNetCoreMvcUiBasicThemeModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<ThemingOptions>(options =>

33
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/MainNavbar/Default.cshtml

@ -1,20 +1,21 @@
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Brand
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Menu
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top" id="main-navbar">
@(await Component.InvokeAsync<MainNavbarBrandViewComponent>())
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#main-navbar-collapse" aria-controls="main-navbar-collapse"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="main-navbar-collapse">
<ul class="navbar-nav mr-auto">
@(await Component.InvokeAsync<MainNavbarMenuViewComponent>())
</ul>
<span id="main-navbar-tools">
@(await Component.InvokeAsync<MainNavbarToolbarViewComponent>())
</span>
<nav class="navbar navbar-expand-md navbar-dark bg-dark shadow-sm flex-column flex-md-row mb-4" id="main-navbar" style="min-height: 4rem;">
<div class="container">
@(await Component.InvokeAsync<MainNavbarBrandViewComponent>())
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#main-navbar-collapse" aria-controls="main-navbar-collapse"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="main-navbar-collapse">
<ul class="navbar-nav mx-auto">
@(await Component.InvokeAsync<MainNavbarMenuViewComponent>())
</ul>
<ul class="navbar-nav">
@(await Component.InvokeAsync<MainNavbarToolbarViewComponent>())
</ul>
</div>
</div>
</nav>
</nav>

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml

@ -37,7 +37,7 @@
}
@menuItem.DisplayName
</a>
<div class="dropdown-menu" aria-labelledby="Menu_@(menuItem.Name)">
<div class="dropdown-menu border-0 shadow-sm" aria-labelledby="Menu_@(menuItem.Name)">
@foreach (var childMenuItem in menuItem.Items)
{
@await Html.PartialAsync("~/Themes/Basic/Components/Menu/_MenuItem.cshtml", childMenuItem)

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml

@ -33,7 +33,7 @@ else
@Model.DisplayName
</span>
</a>
<div class="dropdown-menu">
<div class="dropdown-menu border-0 shadow-sm">
@foreach (var childMenuItem in Model.Items)
{
@await Html.PartialAsync("~/Themes/Basic/Components/Menu/_MenuItem.cshtml", childMenuItem)

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/Default.cshtml

@ -2,5 +2,5 @@
@model Toolbar
@foreach (var toolbarItem in Model.Items.OrderBy(i => i.Order))
{
<span>@(await Component.InvokeAsync(toolbarItem.ComponentType))</span>
<li class="nav-item">@(await Component.InvokeAsync(toolbarItem.ComponentType))</li>
}

6
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/Default.cshtml

@ -1,11 +1,11 @@
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar.LanguageSwitch
@model LanguageSwitchViewComponentModel
<div class="dropdown d-inline">
<a class="btn btn-link dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<div class="dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@Model.CurrentLanguage.DisplayName
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<div class="dropdown-menu dropdown-menu-right border-0 shadow-sm" aria-labelledby="dropdownMenuLink">
@foreach (var language in Model.OtherLanguages)
{
<a class="dropdown-item" href="/Abp/Languages/Switch?culture=@(language.CultureName)&uiCulture=@(language.UiCultureName)">@language.DisplayName</a>

6
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/Default.cshtml

@ -7,14 +7,14 @@
@inject ICurrentTenant CurrentTenant
@inject IHtmlLocalizer<AbpUiResource> L
@model ApplicationMenu
<div class="dropdown d-inline">
<a class="btn btn-link dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<div class="dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@CurrentUser.UserName
</a>
@if (Model.Items.Any())
{
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
<div class="dropdown-menu dropdown-menu-right border-0 shadow-sm" aria-labelledby="dropdownMenuLink">
@foreach (var menuItem in Model.Items)
{
var elementId = string.IsNullOrEmpty(menuItem.ElementId) ? string.Empty : $"id=\"{menuItem.ElementId}\"";

50
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml

@ -45,32 +45,42 @@
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.Last, StandardLayouts.Account)
</head>
<body class="abp-account-layout">
<body class="abp-account-layout bg-light">
@await Component.InvokeLayoutHookAsync(LayoutHooks.Body.First, StandardLayouts.Account)
@(await Component.InvokeAsync<MainNavbarViewComponent>())
<div class="@containerClass">
<abp-row>
<abp-column size-md="_4" offset-md="_4">
@if (MultiTenancyOptions.Value.IsEnabled &&
(TenantResolveResultAccessor.Result?.AppliedResolvers?.Contains(CookieTenantResolveContributor.ContributorName) == true))
{
<div class="tenant-switch-box" style="background-color: #eee; margin-bottom: 20px; color: #000; padding: 10px; text-align: center;">
<span style="color: #666;">@MultiTenancyStringLocalizer["Tenant"]: </span>
<strong>
@if (CurrentTenant.Id == null)
{
<i>@MultiTenancyStringLocalizer["NotSelected"]</i>
}
else
{
@(CurrentTenant.Name ?? CurrentTenant.Id.Value.ToString())
}
</strong>
(<a id="AbpTenantSwitchLink" style="color: #333; cursor: pointer">@MultiTenancyStringLocalizer["Switch"]</a>)
</div>
}
<abp-column size-md="_5" class="mx-auto">
<div class="card shadow-sm rounded mb-3">
<div class="card-body px-5">
<div class="row">
<div class="col">
<span style="font-size: .8em;" class="text-uppercase text-muted">@MultiTenancyStringLocalizer["Tenant"]</span><br />
<h6 class="m-0 d-inline-block">
@if (CurrentTenant.Id == null)
{
<span>
@MultiTenancyStringLocalizer["NotSelected"]
</span>
}
else
{
<strong>@(CurrentTenant.Name ?? CurrentTenant.Id.Value.ToString())</strong>
}
</h6>
</div>
<div class="col-auto">
@if (MultiTenancyOptions.Value.IsEnabled &&
(TenantResolveResultAccessor.Result?.AppliedResolvers?.Contains(CookieTenantResolveContributor.ContributorName) == true))
{
<a id="AbpTenantSwitchLink" href="javascript:;" class="btn btn-sm mt-3 btn-outline-primary">@MultiTenancyStringLocalizer["Switch"]</a>
}
</div>
</div>
</div>
</div>
@(await Component.InvokeAsync<PageAlertsViewComponent>())
@RenderBody()
</abp-column>

4
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml

@ -49,14 +49,14 @@
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.Last, StandardLayouts.Application)
</head>
<body class="abp-application-layout">
<body class="abp-application-layout bg-light">
@await Component.InvokeLayoutHookAsync(LayoutHooks.Body.First, StandardLayouts.Application)
@(await Component.InvokeAsync<MainNavbarViewComponent>())
<div class="@containerClass">
@(await Component.InvokeAsync<PageAlertsViewComponent>())
<div id="AbpContentToolbar" class="text-right mb-3">
<div id="AbpContentToolbar">
@RenderSection("content_toolbar", false)
</div>
@RenderBody()

73
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/layout.css

@ -1,36 +1,59 @@
body {
padding-top: 5rem;
}
body.abp-empty-layout {
padding-top: 0;
}
#main-navbar-tools a.dropdown-toggle {
text-decoration: none;
color: #fff;
}
/* Main Menu */
.navbar .dropdown-submenu {
position: relative;
}
.navbar .dropdown-submenu a {
padding: 0.25rem 1.4rem;
.navbar .dropdown-menu {
margin: 0;
padding: 0;
}
.navbar .dropdown-menu a {
font-size: .9em;
padding: 10px 15px;
display: block;
min-width: 210px;
text-align: left;
border-radius: 0.25rem;
min-height: 44px;
}
.navbar .dropdown-submenu a::after {
transform: rotate(-90deg);
position: absolute;
right: 16px;
top: 18px;
}
.navbar .dropdown-submenu .dropdown-menu {
top: 0;
left: 100%;
}
.card-header .btn {
padding: 2px 6px;
}
.card-header h5 {
margin: 0;
}
.container > .card {
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}
.navbar .dropdown-submenu a::after {
transform: rotate(-90deg);
position: absolute;
right: 16px;
top: 18px;
}
@media screen and (min-width: 768px) {
.navbar .dropdown:hover > .dropdown-menu {
display: block;
}
.navbar .dropdown-submenu .dropdown-menu {
top: 0;
left: 100%;
margin-left: .1rem;
margin-right: .1rem;
.navbar .dropdown-submenu:hover > .dropdown-menu {
display: block;
}
}
.input-validation-error {
border-color: #dc3545;
}
.field-validation-error {
font-size: 0.8em;
}

11
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/AbpAspNetCoreMvcUiThemeSharedModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling;
@ -15,6 +16,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared
)]
public class AbpAspNetCoreMvcUiThemeSharedModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAspNetCoreMvcUiThemeSharedModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<VirtualFileSystemOptions>(options =>

5
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpAspNetCoreMvcUiWidgetsModule.cs

@ -17,6 +17,11 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAspNetCoreMvcUiWidgetsModule).Assembly);
});
AutoAddWidgets(context.Services);
}

11
framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/AbpAspNetCoreMvcUiModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.Modularity;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
@ -8,6 +9,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI
[DependsOn(typeof(AbpUiNavigationModule))]
public class AbpAspNetCoreMvcUiModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAspNetCoreMvcUiModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<VirtualFileSystemOptions>(options =>

20
framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpMvcBuilderExtensions.cs

@ -0,0 +1,20 @@
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
namespace Microsoft.Extensions.DependencyInjection
{
public static class AbpMvcBuilderExtensions
{
public static void AddApplicationPartIfNotExists(this IMvcBuilder mvcBuilder, Assembly assembly)
{
if (mvcBuilder.PartManager.ApplicationParts.Any(
p => p is AssemblyPart assemblyPart && assemblyPart.Assembly == assembly))
{
return;
}
mvcBuilder.PartManager.ApplicationParts.Add(new AssemblyPart(assembly));
}
}
}

3
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs

@ -66,7 +66,7 @@ namespace Volo.Abp.AspNetCore.Mvc
var mvcCoreBuilder = context.Services.AddMvcCore();
context.Services.ExecutePreConfiguredActions(mvcCoreBuilder);
var abpMvcDataAnnotationsLocalizationOptions = context.Services.ExecutePreConfiguredActions(new AbpMvcDataAnnotationsLocalizationOptions());
context.Services
@ -85,7 +85,6 @@ namespace Volo.Abp.AspNetCore.Mvc
.AddRazorRuntimeCompilation()
.AddDataAnnotationsLocalization(options =>
{
options.DataAnnotationLocalizerProvider = (type, factory) =>
{
var resourceType = abpMvcDataAnnotationsLocalizationOptions.AssemblyResources.GetOrDefault(type.Assembly);

63
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/InProcess/CurrentDirectoryHelpers.cs

@ -1,63 +0,0 @@
using System;
namespace Microsoft.AspNetCore.InProcess
{
/// <summary>
/// https://github.com/aspnet/AspNetCore.Docs/blob/master/aspnetcore/host-and-deploy/aspnet-core-module/samples_snapshot/2.x/CurrentDirectoryHelpers.cs
/// TODO: Remove CurrentDirectoryHelpers.cs when upgrade to ASP.NET Core 3.0.
/// </summary>
public class CurrentDirectoryHelpers
{
internal const string AspNetCoreModuleDll = "aspnetcorev2_inprocess.dll";
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private static extern IntPtr GetModuleHandle(string lpModuleName);
[System.Runtime.InteropServices.DllImport(AspNetCoreModuleDll)]
private static extern int http_get_application_properties(ref IISConfigurationData iiConfigData);
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
private struct IISConfigurationData
{
public IntPtr pNativeApplication;
[System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)]
public string pwzFullApplicationPath;
[System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)]
public string pwzVirtualApplicationPath;
public bool fWindowsAuthEnabled;
public bool fBasicAuthEnabled;
public bool fAnonymousAuthEnable;
}
public static void SetCurrentDirectory()
{
try
{
// Check if physical path was provided by ANCM
var sitePhysicalPath = Environment.GetEnvironmentVariable("ASPNETCORE_IIS_PHYSICAL_PATH");
if (string.IsNullOrEmpty(sitePhysicalPath))
{
// Skip if not running ANCM InProcess
if (GetModuleHandle(AspNetCoreModuleDll) == IntPtr.Zero)
{
return;
}
IISConfigurationData configurationData = default(IISConfigurationData);
if (http_get_application_properties(ref configurationData) != 0)
{
return;
}
sitePhysicalPath = configurationData.pwzFullApplicationPath;
}
Environment.CurrentDirectory = sitePhysicalPath;
}
catch
{
// ignore
}
}
}
}

4
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs

@ -224,12 +224,16 @@ namespace Volo.Abp.Http.Client.DynamicProxying
requestMessage.Headers.Add(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString());
}
//Culture
//TODO: Is that the way we want? Couldn't send the culture (not ui culture)
var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name;
if (!currentCulture.IsNullOrEmpty())
{
requestMessage.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(currentCulture));
}
//X-Requested-With
requestMessage.Headers.Add("X-Requested-With", "XMLHttpRequest");
}
private string GetConfiguredApiVersion()

61
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml

@ -3,37 +3,44 @@
@model Volo.Abp.Account.Web.Pages.Account.LoginModel
@inherits Volo.Abp.Account.Web.Pages.Account.AccountPage
@inject Volo.Abp.Settings.ISettingProvider SettingProvider
<h2>@L["Login"]</h2>
@if (Model.EnableLocalLogin)
{
<form method="post">
<input asp-for="ReturnUrl" />
<input asp-for="ReturnUrlHash" />
<div class="form-group">
<label asp-for="LoginInput.UserNameOrEmailAddress"></label>
<input asp-for="LoginInput.UserNameOrEmailAddress" class="form-control" />
<span asp-validation-for="LoginInput.UserNameOrEmailAddress" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="LoginInput.Password"></label>
<input asp-for="LoginInput.Password" class="form-control" />
<span asp-validation-for="LoginInput.Password" class="text-danger"></span>
</div>
<div class="form-check">
<label asp-for="LoginInput.RememberMe" class="form-check-label">
<input asp-for="LoginInput.RememberMe" class="form-check-input" />
@Html.DisplayNameFor(m => m.LoginInput.RememberMe)
</label>
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<h4>@L["Login"]</h4>
@if (string.Equals(await SettingProvider.GetOrNullAsync(AccountSettingNames.IsSelfRegistrationEnabled), "true", StringComparison.OrdinalIgnoreCase))
{
<strong>
Are you new user?
<a href="@Url.Page("./Register", new {returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash})" class="text-decoration-none">@L["Register"]</a>
</strong>
}
<form method="post" class="mt-4">
<input asp-for="ReturnUrl" />
<input asp-for="ReturnUrlHash" />
<div class="form-group">
<label asp-for="LoginInput.UserNameOrEmailAddress"></label>
<input asp-for="LoginInput.UserNameOrEmailAddress" class="form-control" />
<span asp-validation-for="LoginInput.UserNameOrEmailAddress" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="LoginInput.Password"></label>
<input asp-for="LoginInput.Password" class="form-control" />
<span asp-validation-for="LoginInput.Password" class="text-danger"></span>
</div>
<div class="form-check">
<label asp-for="LoginInput.RememberMe" class="form-check-label">
<input asp-for="LoginInput.RememberMe" class="form-check-input" />
@Html.DisplayNameFor(m => m.LoginInput.RememberMe)
</label>
</div>
<abp-button type="submit" button-type="Primary" name="Action" value="Login" class="btn-block btn-lg mt-3">@L["Login"]</abp-button>
</form>
</div>
<abp-button type="button" button-type="Secondary" name="Action" value="Cancel">@L["Cancel"]</abp-button> @* TODO: Only show if identity server is used *@
<abp-button type="submit" button-type="Primary" name="Action" value="Login">@L["Login"]</abp-button>
</form>
<div style="padding-top: 20px">
@if (string.Equals(await SettingProvider.GetOrNullAsync(AccountSettingNames.IsSelfRegistrationEnabled), "true", StringComparison.OrdinalIgnoreCase))
{
<a href="@Url.Page("./Register", new {returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash})">@L["Register"]</a>
}
<div class="card-footer text-center border-0">
<abp-button type="button" button-type="Link" name="Action" value="Cancel" class="px-2 py-0">@L["Cancel"]</abp-button> @* TODO: Only show if identity server is used *@
</div>
</div>
}

66
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.cshtml

@ -17,34 +17,38 @@
@section scripts {
<abp-script src="/Pages/Account/Manage.js" />
}
<abp-tabs tab-style="PillVertical">
<abp-tab title="@L["ChangePassword"].Value">
<abp-dynamic-form abp-model="@Model.ChangePasswordInfoModel" id="ChangePasswordForm">
<abp-form-content />
<abp-button type="submit" button-type="Primary" text="@L["Submit"].Value" />
</abp-dynamic-form>
</abp-tab>
<abp-tab title="@L["PersonalSettings"].Value">
<form method="post" id="PersonalSettingsForm">
<abp-input asp-for="PersonalSettingsInfoModel.UserName" readonly="!isUserNameUpdateEnabled" />
<abp-row>
<abp-column size-md="_6">
<abp-input asp-for="PersonalSettingsInfoModel.Name" />
</abp-column>
<abp-column size-md="_6">
<abp-input asp-for="PersonalSettingsInfoModel.Surname" />
</abp-column>
</abp-row>
<abp-input asp-for="PersonalSettingsInfoModel.Email" readonly="!isEmailUpdateEnabled" />
<abp-input asp-for="PersonalSettingsInfoModel.PhoneNumber" />
<abp-button type="submit" button-type="Primary" text="@L["Submit"].Value" />
</form>
</abp-tab>
</abp-tabs>
<abp-card>
<abp-card-body>
<abp-tabs tab-style="PillVertical">
<abp-tab title="@L["ChangePassword"].Value">
<h4>@L["ChangePassword"].Value</h4><hr />
<abp-dynamic-form abp-model="@Model.ChangePasswordInfoModel" id="ChangePasswordForm">
<abp-form-content />
<abp-button type="submit" button-type="Primary" text="@L["Submit"].Value" />
</abp-dynamic-form>
</abp-tab>
<abp-tab title="@L["PersonalSettings"].Value">
<h4>@L["PersonalSettings"].Value</h4><hr />
<form method="post" id="PersonalSettingsForm">
<abp-input asp-for="PersonalSettingsInfoModel.UserName" readonly="!isUserNameUpdateEnabled" />
<abp-row>
<abp-column size-md="_6">
<abp-input asp-for="PersonalSettingsInfoModel.Name" />
</abp-column>
<abp-column size-md="_6">
<abp-input asp-for="PersonalSettingsInfoModel.Surname" />
</abp-column>
</abp-row>
<abp-input asp-for="PersonalSettingsInfoModel.Email" readonly="!isEmailUpdateEnabled" />
<abp-input asp-for="PersonalSettingsInfoModel.PhoneNumber" />
<abp-button type="submit" button-type="Primary" text="@L["Submit"].Value" />
</form>
</abp-tab>
</abp-tabs>
</abp-card-body>
</abp-card>

23
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml

@ -1,10 +1,19 @@
@page
@model Volo.Abp.Account.Web.Pages.Account.RegisterModel
@inherits Volo.Abp.Account.Web.Pages.Account.AccountPage
<h2>@L["Register"]</h2>
<form method="post">
<abp-input asp-for="Input.UserName" auto-focus="true" />
<abp-input asp-for="Input.EmailAddress" />
<abp-input asp-for="Input.Password" />
<abp-button button-type="Primary" type="submit">@L["Register"]</abp-button>
</form>
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<h4>@L["Register"]</h4>
<strong>
Already registered?
<a href="@Url.Page("./Login", new {returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash})" class="text-decoration-none">@L["Login"]</a>
</strong>
<form method="post" class="mt-4">
<abp-input asp-for="Input.UserName" auto-focus="true" />
<abp-input asp-for="Input.EmailAddress" />
<abp-input asp-for="Input.Password" />
<abp-button button-type="Primary" type="submit" class="btn-lg btn-block mt-4">@L["Register"]</abp-button>
</form>
</div>
</div>

3
modules/blogging/app/Volo.BloggingTestApp/Program.cs

@ -1,7 +1,6 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -11,8 +10,6 @@ namespace Volo.BloggingTestApp
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug() //TODO: Should be configurable!
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)

3
modules/client-simulation/demo/Volo.ClientSimulation.Demo/Program.cs

@ -1,7 +1,6 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -11,8 +10,6 @@ namespace Volo.ClientSimulation.Demo
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)

3
modules/docs/app/VoloDocs.Web/Program.cs

@ -1,7 +1,6 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -11,8 +10,6 @@ namespace VoloDocs.Web
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug() //TODO: Should be configurable!
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)

3
modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs

@ -165,7 +165,8 @@ namespace Volo.Docs.Pages.Documents.Project
{
projectName = ProjectName,
version = (LatestVersionInfo.IsSelected ? DocsAppConsts.Latest : Version),
languageCode = DefaultLanguageCode
languageCode = DefaultLanguageCode,
documentName = DocumentName
});
}

27
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs

@ -8,23 +8,22 @@ namespace Volo.Abp.Identity
public override void Define(ISettingDefinitionContext context)
{
context.Add(
new SettingDefinition(IdentitySettingNames.Password.RequiredLength, null, null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequiredUniqueChars, null, null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequireNonAlphanumeric, null, null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequireLowercase, null, null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequireUppercase, null, null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequireDigit, null, null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequiredLength, 6.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequiredUniqueChars, 1.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequireNonAlphanumeric, true.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequireLowercase, true.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequireUppercase, true.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.Password.RequireDigit, true.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.Lockout.AllowedForNewUsers, null, null, null, true),
new SettingDefinition(IdentitySettingNames.Lockout.LockoutDuration, null, null, null, true),
new SettingDefinition(IdentitySettingNames.Lockout.MaxFailedAccessAttempts, null, null, null, true),
new SettingDefinition(IdentitySettingNames.Lockout.AllowedForNewUsers, true.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.Lockout.LockoutDuration, (5*60).ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.Lockout.MaxFailedAccessAttempts, 5.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.SignIn.RequireConfirmedEmail, null, null, null, true),
new SettingDefinition(IdentitySettingNames.SignIn.RequireConfirmedPhoneNumber, null, null, null, true),
new SettingDefinition(IdentitySettingNames.User.IsUserNameUpdateEnabled, "true", null, null, true),
new SettingDefinition(IdentitySettingNames.User.IsEmailUpdateEnabled, "true", null, null, true)
new SettingDefinition(IdentitySettingNames.SignIn.RequireConfirmedEmail, false.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.SignIn.RequireConfirmedPhoneNumber, false.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.User.IsUserNameUpdateEnabled, true.ToString(), null, null, true),
new SettingDefinition(IdentitySettingNames.User.IsEmailUpdateEnabled, true.ToString(), null, null, true)
);
}
}

6
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml

@ -19,13 +19,11 @@
<div id="SettingManagementWrapper">
<abp-card>
<abp-card-body>
<abp-card-body>
<abp-tabs tab-style="PillVertical" vertical-header-size="_3">
@foreach (var group in Model.SettingPageCreationContext.Groups)
{
<abp-tab title="@group.DisplayName">
<abp-tab title="@group.DisplayName">
<h2>@group.DisplayName</h2>
<hr class="my-4" />
@await Component.InvokeAsync(group.ComponentType)

3
npm/ng-packs/packages/core/src/lib/tests/config.plugin.spec.ts

@ -4,11 +4,12 @@ import { NGXS_PLUGINS, NgxsModule, InitState, Store } from '@ngxs/store';
import { environment } from '../../../../../apps/dev-app/src/environments/environment';
import { LAYOUTS } from '../../../../theme-basic/src/public-api';
import { ABP } from '../models';
import { ConfigPlugin, NGXS_CONFIG_PLUGIN_OPTIONS, addAbpRoutes } from '../plugins';
import { ConfigPlugin, NGXS_CONFIG_PLUGIN_OPTIONS } from '../plugins';
import { RouterOutletComponent } from '../components';
import { ConfigState } from '../states';
import { CoreModule } from '../core.module';
import { eLayoutType } from '../enums/common';
import { addAbpRoutes } from '../utils';
addAbpRoutes([
{

2
npm/ng-packs/packages/core/src/lib/tests/locale.provider.spec.ts

@ -30,7 +30,7 @@ describe('LocaleProvider', () => {
expect(spectator.get(LOCALE_ID).valueOf()).toBe(localesMapping['en-US'] || 'en-US');
localizationService.currentLang = 'tr';
(localizationService as any).currentLang = 'tr';
expect(spectator.get(LOCALE_ID).valueOf()).toBe(localesMapping['tr'] || 'tr');
});
});

6
npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts

@ -24,7 +24,7 @@ describe('LocalizationService', () => {
describe('#currentLang', () => {
it('should be tr', () => {
store.selectSnapshot.andCallFake((selector: (state: any, ...states: any[]) => string) => {
return selector({ SessionState: { getLanguage: 'tr' } });
return selector({ SessionState: { language: 'tr' } });
});
expect(service.currentLang).toBe('tr');
@ -33,9 +33,7 @@ describe('LocalizationService', () => {
describe('#get', () => {
it('should be return an observable localization', async () => {
store.select.andCallFake((selector: (state: any, ...states: any[]) => Observable<string>) => {
return selector({ ConfigState: { getLocalization: (keys, ...interpolateParams) => of(keys) } });
});
store.select.andReturn(of('AbpTest'));
const localization = await service.get('AbpTest').toPromise();

8
npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html

@ -54,8 +54,12 @@
<th>{{ 'AbpIdentity::Actions' | abpLocalization }}</th>
<th pResizableColumn (click)="sortOrderIcon.sort('name')">
{{ 'AbpIdentity::RoleName' | abpLocalization }}
<abp-sort-order-icon #sortOrderIcon key="name" [selectedKey]="sortKey" [order]="sortOrder">
</abp-sort-order-icon>
<abp-sort-order-icon
#sortOrderIcon
key="name"
[(selectedKey)]="sortKey"
[(order)]="sortOrder"
></abp-sort-order-icon>
</th>
</tr>
</ng-template>

4
npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.html

@ -2,9 +2,9 @@
<div class="col-auto">
<h1 class="content-header-title">{{ 'AbpSettingManagement::Settings' | abpLocalization }}</h1>
</div>
<!-- <div id="breadcrumb" class="col-md-auto pl-md-0">
<div id="breadcrumb" class="col-md-auto pl-md-0">
<abp-breadcrumb></abp-breadcrumb>
</div> -->
</div>
<div class="col">
<div class="text-lg-right pt-2" id="AbpContentToolbar"></div>
</div>

6
npm/ng-packs/scripts/push.js

@ -4,9 +4,13 @@ const execa = require('execa');
(async () => {
const answer = await new Confirm('Would you like to push?').run().then(answer => answer);
const remote = execa.sync('git', ['remote']).stdout;
const branch = execa.sync('git', ['rev-parse', '--abbrev-ref', 'HEAD']).stdout;
if (answer) {
try {
await execa('git', ['push'], { stdout: 'inherit' });
await execa('git', ['push', remote, branch], { stdout: 'inherit' });
await execa('git', ['fetch', remote], { stdout: 'inherit' });
console.log('Successfully!');
} catch (error) {
console.log('An error occured.' + error);

8
samples/BookStore-Angular-MongoDb/angular/package.json

@ -13,10 +13,10 @@
},
"private": true,
"dependencies": {
"@abp/ng.account": "^0.8.3",
"@abp/ng.identity": "^0.8.3",
"@abp/ng.tenant-management": "^0.8.3",
"@abp/ng.theme.basic": "^0.8.3",
"@abp/ng.account": "^0.9.0",
"@abp/ng.identity": "^0.9.0",
"@abp/ng.tenant-management": "^0.9.0",
"@abp/ng.theme.basic": "^0.9.0",
"@angular/animations": "~8.2.2",
"@angular/common": "~8.2.2",
"@angular/compiler": "~8.2.2",

14
samples/BookStore-Angular-MongoDb/angular/src/app/app.module.ts

@ -11,15 +11,14 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SharedModule } from './shared/shared.module';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { AccountProviders } from '@abp/ng.account';
import { IdentityProviders } from '@abp/ng.identity';
import { TenantManagementProviders } from '@abp/ng.tenant-management';
import { BooksState } from './store/states/books.state';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
SharedModule,
ThemeSharedModule.forRoot(),
CoreModule.forRoot({
environment,
@ -28,10 +27,15 @@ import { BooksState } from './store/states/books.state';
},
}),
OAuthModule.forRoot(),
NgxsModule.forRoot([]),
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
SharedModule,
NgxsModule.forRoot([BooksState, ]),
NgxsReduxDevtoolsPluginModule.forRoot({ disabled: environment.production }),
],
providers: [],
providers: [...AccountProviders({ redirectUrl: '/' }), ...IdentityProviders(), ...TenantManagementProviders()],
bootstrap: [AppComponent],
})
export class AppModule {}

2
samples/BookStore-Angular-MongoDb/angular/src/app/home/home.component.html

@ -5,7 +5,7 @@
{{ '::LongWelcomeMessage' | abpLocalization }}
</p>
<p *ngIf="!hasLoggedIn">
<a routerLink="/account/login" [state]="{ redirectUrl: '/home' }" class="btn btn-primary" role="button"
<a routerLink="/account/login" [state]="{ redirectUrl: '/' }" class="btn btn-primary" role="button"
><i class="fa fa-sign-in"></i>{{ 'AbpIdentity::Login' | abpLocalization }}</a
>
</p>

6
samples/BookStore-Angular-MongoDb/angular/src/environments/environment.hmr.ts

@ -6,8 +6,8 @@ export const environment = {
logoUrl: '',
},
oAuthConfig: {
issuer: 'https://localhost:44359',
clientId: 'BookStore_ConsoleTestApp',
issuer: 'https://localhost:44341',
clientId: 'BookStore_App',
dummyClientSecret: '1q2w3e*',
scope: 'BookStore',
showDebugInformation: true,
@ -16,7 +16,7 @@ export const environment = {
},
apis: {
default: {
url: 'https://localhost:44359',
url: 'https://localhost:44341',
},
},
localization: {

6
samples/BookStore-Angular-MongoDb/angular/src/environments/environment.prod.ts

@ -6,8 +6,8 @@ export const environment = {
logoUrl: '',
},
oAuthConfig: {
issuer: 'https://localhost:44359',
clientId: 'BookStore_ConsoleTestApp',
issuer: 'https://localhost:44341',
clientId: 'BookStore_App',
dummyClientSecret: '1q2w3e*',
scope: 'BookStore',
showDebugInformation: true,
@ -16,7 +16,7 @@ export const environment = {
},
apis: {
default: {
url: 'https://localhost:44359',
url: 'https://localhost:44341',
},
},
localization: {

6
samples/BookStore-Angular-MongoDb/angular/src/environments/environment.ts

@ -6,8 +6,8 @@ export const environment = {
logoUrl: '',
},
oAuthConfig: {
issuer: 'https://localhost:44359',
clientId: 'BookStore_ConsoleTestApp',
issuer: 'https://localhost:44341',
clientId: 'BookStore_App',
dummyClientSecret: '1q2w3e*',
scope: 'BookStore',
showDebugInformation: true,
@ -16,7 +16,7 @@ export const environment = {
},
apis: {
default: {
url: 'https://localhost:44359',
url: 'https://localhost:44341',
},
},
localization: {

26
samples/BookStore-Angular-MongoDb/aspnet-core/Acme.BookStore.sln.DotSettings

@ -1,7 +1,23 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=59923913AE66194DB837F628B1FC08BE/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=59923913AE66194DB837F628B1FC08BE/AbsolutePath/@EntryValue">D:\github\abp\common.DotSettings</s:String>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=59923913AE66194DB837F628B1FC08BE/RelativePath/@EntryValue">..\..\..\common.DotSettings</s:String>
<s:Boolean x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File59923913AE66194DB837F628B1FC08BE/@KeyIndexDefined">True</s:Boolean>
<s:Double x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File59923913AE66194DB837F628B1FC08BE/RelativePriority/@EntryValue">1</s:Double>
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/CSharpCompletingCharacters/UpgradedFromVSSettings/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceDoWhileStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceFixedStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceForeachStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceForStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceIfStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceLockStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceUsingStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceWhileStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOR/@EntryValue">Required</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOREACH/@EntryValue">Required</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_IFELSE/@EntryValue">Required</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_WHILE/@EntryValue">Required</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_REDUNDANT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Implementations/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=Async/@EntryIndexedValue">False</s:String>
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=Mutable/@EntryIndexedValue">False</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Overrides/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Async/@EntryIndexedValue">False</s:String>
<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Mutable/@EntryIndexedValue">False</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String>
</wpf:ResourceDictionary>

2
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />

0
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application/Permissions/BookStorePermissionDefinitionProvider.cs → samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application.Contracts/Permissions/BookStorePermissionDefinitionProvider.cs

0
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application/Permissions/BookStorePermissions.cs → samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application.Contracts/Permissions/BookStorePermissions.cs

4
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>

3
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application/BookStoreApplicationAutoMapperProfile.cs

@ -6,6 +6,9 @@ namespace Acme.BookStore
{
public BookStoreApplicationAutoMapperProfile()
{
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<Book, BookDto>();
CreateMap<CreateUpdateBookDto, Book>();
}

6
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Application/BookStoreApplicationModule.cs

@ -23,11 +23,7 @@ namespace Acme.BookStore
{
Configure<AbpAutoMapperOptions>(options =>
{
/* Use `true` for the `validate` parameter if you want to
* validate the profile on application startup.
* See http://docs.automapper.org/en/stable/Configuration-validation.html for more info
* about the configuration validation. */
options.AddProfile<BookStoreApplicationAutoMapperProfile>();
options.AddMaps<BookStoreApplicationModule>();
});
}
}

5
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
@ -22,6 +22,7 @@
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.4" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
</ItemGroup>
<ItemGroup>

6
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/BookStoreDbMigratorModule.cs

@ -1,5 +1,6 @@
using Acme.BookStore.MongoDB;
using Volo.Abp.Autofac;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.Modularity;
namespace Acme.BookStore.DbMigrator
@ -11,6 +12,9 @@ namespace Acme.BookStore.DbMigrator
)]
public class BookStoreDbMigratorModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<BackgroundJobOptions>(options => options.IsJobExecutionEnabled = false);
}
}
}

6
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/appsettings.json

@ -7,10 +7,10 @@
"BookStore_Web": {
"ClientId": "BookStore_Web",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44335"
"RootUrl": "https://localhost:44357"
},
"BookStore_ConsoleTestApp": {
"ClientId": "BookStore_ConsoleTestApp",
"BookStore_App": {
"ClientId": "BookStore_App",
"ClientSecret": "1q2w3e*"
}
}

4
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Domain.Shared\Volo.Abp.Identity.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Domain.Shared\Volo.Abp.Identity.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.Domain.Shared\Volo.Abp.IdentityServer.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.Domain.Shared\Volo.Abp.BackgroundJobs.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.Domain.Shared\Volo.Abp.AuditLogging.Domain.Shared.csproj" />

5
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>
@ -12,7 +12,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" />
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Domain\Volo.Abp.Identity.Domain.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.Domain\Volo.Abp.IdentityServer.Domain.csproj" />

46
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain/BookStoreDataSeederContributor.cs

@ -1,46 +0,0 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
namespace Acme.BookStore
{
public class BookStoreDataSeederContributor : IDataSeedContributor, ITransientDependency
{
private readonly IRepository<Book, Guid> _bookRepository;
public BookStoreDataSeederContributor(IRepository<Book, Guid> bookRepository)
{
_bookRepository = bookRepository;
}
public async Task SeedAsync(DataSeedContext context)
{
if (await _bookRepository.GetCountAsync() > 0)
{
return;
}
await _bookRepository.InsertAsync(
new Book
{
Name = "1984",
Type = BookType.Dystopia,
PublishDate = new DateTime(1949, 6, 8),
Price = 19.84f
}
);
await _bookRepository.InsertAsync(
new Book
{
Name = "The Hitchhiker's Guide to the Galaxy",
Type = BookType.ScienceFiction,
PublishDate = new DateTime(1995, 9, 27),
Price = 42.0f
}
);
}
}
}

4
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs

@ -126,14 +126,14 @@ namespace Acme.BookStore.IdentityServer
}
//Console Test Client
var consoleClientId = configurationSection["BookStore_ConsoleTestApp:ClientId"];
var consoleClientId = configurationSection["BookStore_App:ClientId"];
if (!consoleClientId.IsNullOrWhiteSpace())
{
await CreateClientAsync(
consoleClientId,
commonScopes,
new[] { "password", "client_credentials" },
(configurationSection["BookStore_ConsoleTestApp:ClientSecret"] ?? "1q2w3e*").Sha256()
(configurationSection["BookStore_App:ClientSecret"] ?? "1q2w3e*").Sha256()
);
}
}

4
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Client/Acme.BookStore.HttpApi.Client.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>

10
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj

@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>Acme.BookStore</RootNamespace>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.7.0" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />

21
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/BookStoreHttpApiHostModule.cs

@ -2,11 +2,13 @@
using System.IO;
using System.Linq;
using System.Net.Http;
using Acme.BookStore.MongoDB;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Acme.BookStore.MongoDB;
using Acme.BookStore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Swashbuckle.AspNetCore.Swagger;
@ -45,10 +47,12 @@ namespace Acme.BookStore
ConfigureUrls(configuration);
ConfigureConventionalControllers();
ConfigureAuthentication(context, configuration);
ConfigureSwagger(context);
ConfigureLocalization();
ConfigureVirtualFileSystem(context);
ConfigureCors(context, configuration);
//Disabled swagger since it does not support ASP.NET Core 3.0 yet!
//ConfigureSwaggerServices(context);
}
private void ConfigureUrls(IConfigurationRoot configuration)
@ -98,7 +102,7 @@ namespace Acme.BookStore
});
}
private static void ConfigureSwagger(ServiceConfigurationContext context)
private static void ConfigureSwaggerServices(ServiceConfigurationContext context)
{
context.Services.AddSwaggerGen(
options =>
@ -133,6 +137,7 @@ namespace Acme.BookStore
.Select(o => o.RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
@ -145,10 +150,12 @@ namespace Acme.BookStore
{
var app = context.GetApplicationBuilder();
app.UseCors(DefaultCorsPolicyName);
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseAuthentication();
app.UseAuthorization();
app.UseJwtTokenMiddleware();
if (MultiTenancyConsts.IsEnabled)
@ -158,11 +165,15 @@ namespace Acme.BookStore
app.UseIdentityServer();
app.UseAbpRequestLocalization();
/* Disabled swagger since it does not support ASP.NET Core 3.0 yet!
app.UseSwagger();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "BookStore API");
});
*/
app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea();
}

4
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Controllers/HomeController.cs

@ -7,7 +7,9 @@ namespace Acme.BookStore.Controllers
{
public ActionResult Index()
{
return Redirect("/swagger");
//TODO: Enabled once Swagger supports ASP.NET Core 3.x
//return Redirect("/swagger");
return Content("OK: Acme.BookStore.HttpApi.Host is running...");
}
}
}

3
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Program.cs

@ -1,7 +1,6 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -11,8 +10,6 @@ namespace Acme.BookStore
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()

6
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Properties/launchSettings.json

@ -3,8 +3,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44359",
"sslPort": 44359
"applicationUrl": "https://localhost:44341",
"sslPort": 44341
}
},
"profiles": {
@ -18,7 +18,7 @@
"Acme.BookStore.HttpApi.Host": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:44359",
"applicationUrl": "https://localhost:44341",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

2
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Startup.cs

@ -19,7 +19,7 @@ namespace Acme.BookStore
return services.BuildServiceProviderFromFactory();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}

7
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/appsettings.json

@ -1,15 +1,12 @@
{
"App": {
"SelfUrl": "https://localhost:44359",
"SelfUrl": "https://localhost:44341",
"CorsOrigins": "https://*.BookStore.com,http://localhost:4200"
},
"ConnectionStrings": {
"Default": "mongodb://localhost:27017/BookStore"
},
"Redis": {
"Configuration": "127.0.0.1"
},
"AuthServer": {
"Authority": "https://localhost:44359"
"Authority": "https://localhost:44341"
}
}

2
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/package.json

@ -3,6 +3,6 @@
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^0.8.0"
"@abp/aspnetcore.mvc.ui.theme.basic": "^0.9.0"
}
}

8196
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/wwwroot/libs/luxon/luxon.js

File diff suppressed because it is too large

1
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/wwwroot/libs/luxon/luxon.js.map

File diff suppressed because one or more lines are too long

1
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/wwwroot/libs/luxon/luxon.min.js

File diff suppressed because one or more lines are too long

1
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/wwwroot/libs/luxon/luxon.min.js.map

File diff suppressed because one or more lines are too long

219
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/yarn.lock

@ -2,35 +2,36 @@
# yarn lockfile v1
"@abp/aspnetcore.mvc.ui.theme.basic@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-0.8.0.tgz#8b6b5fdcee9d0a61b2e6d602158c814eac808ef9"
integrity sha512-TLP5iCXnxfL7IECBHiJFTpvlgVEuzb9wm0vvxAGFZYiu5IkxeZxVMreQHiXOwJdRFGtyJtM6T5+va4LqNQtfCw==
dependencies:
"@abp/aspnetcore.mvc.ui.theme.shared" "^0.8.0"
"@abp/aspnetcore.mvc.ui.theme.shared@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-0.8.0.tgz#3892843e1519aa8e9bf56bd08d69a7114de20b56"
integrity sha512-s63rg2nmjbJn5oBrPwt0VBw0V8LQsS4kpup7b7jW8f6Fw1k07w6i4XVG0JZCZPx3HTCZbHc+Nu3fBTUhZfokaA==
dependencies:
"@abp/aspnetcore.mvc.ui" "^0.8.0"
"@abp/bootstrap" "^0.8.0"
"@abp/datatables.net-bs4" "^0.8.0"
"@abp/font-awesome" "^0.8.0"
"@abp/jquery-form" "^0.8.0"
"@abp/jquery-validation-unobtrusive" "^0.8.0"
"@abp/lodash" "^0.8.0"
"@abp/malihu-custom-scrollbar-plugin" "^0.8.0"
"@abp/select2" "^0.8.0"
"@abp/sweetalert" "^0.8.0"
"@abp/timeago" "^0.8.0"
"@abp/toastr" "^0.8.0"
"@abp/aspnetcore.mvc.ui@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-0.8.0.tgz#bb5234696771a900caa91a22033d017ceecd7df5"
integrity sha512-3wokY7KSjoft9O4UnysHZ5756YPTYdKMogxWddzJXCZXK8jJfx0hbAwV0sK+3Q0f4DGOzIzRoxE0UH6Dk2a9pw==
"@abp/aspnetcore.mvc.ui.theme.basic@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-0.9.0.tgz#7f68998a082c1b0972a101d9d4f7e15d0a86599c"
integrity sha512-5SW+Y5zIzjsy5SweBo9+C4ZX1xnJSLSmPhQW6Qup3Sfy7A+862ZcJj5IrSgH6Vxc36pNdBz4WyHj/gXQDuZ70Q==
dependencies:
"@abp/aspnetcore.mvc.ui.theme.shared" "^0.9.0"
"@abp/aspnetcore.mvc.ui.theme.shared@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-0.9.0.tgz#8bce8ad565ddba9768ddae121ea0c04111485e53"
integrity sha512-mgf3fqKi/ksdWZEPeM9uUluc48MM7V+9BwR9P3bCwih0P9+6aWJq6gq/BsnZrNAe9qKd11smjFku22OC1/c/tg==
dependencies:
"@abp/aspnetcore.mvc.ui" "^0.9.0"
"@abp/bootstrap" "^0.9.0"
"@abp/datatables.net-bs4" "^0.9.0"
"@abp/font-awesome" "^0.9.0"
"@abp/jquery-form" "^0.9.0"
"@abp/jquery-validation-unobtrusive" "^0.9.0"
"@abp/lodash" "^0.9.0"
"@abp/luxon" "^0.9.0"
"@abp/malihu-custom-scrollbar-plugin" "^0.9.0"
"@abp/select2" "^0.9.0"
"@abp/sweetalert" "^0.9.0"
"@abp/timeago" "^0.9.0"
"@abp/toastr" "^0.9.0"
"@abp/aspnetcore.mvc.ui@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-0.9.0.tgz#85a7745a59dd10164aa3862cc0e0d2839bab1dc7"
integrity sha512-DlcjrMk5dLRC6NJpITNO3XiqsbSPNwkSkqq8aqGYC5iN+tq9wzRgf1b8rz4sJsOeBZxaHH2U4L4SXSufsy7weg==
dependencies:
ansi-colors "^3.2.4"
extend-object "^1.0.0"
@ -39,121 +40,128 @@
path "^0.12.7"
rimraf "^2.6.3"
"@abp/bootstrap@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-0.8.0.tgz#ef5b076a892c47ebf00a13420b819a5f627b0beb"
integrity sha512-ZUu+4pbX1ky1Ub41d68VKAa1M/dy+u5RtEAvv2aqECsGu9LUZTxG5hc9adU59ZdnhPjARe2AeG9LA7Pf4KOAVA==
"@abp/bootstrap@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-0.9.0.tgz#6ff1df5b34197996938c08b06288dc7f6a161aa3"
integrity sha512-0aHTrJSKXqI0+V7V8+t3M6wG0L1E5Zq+UzJAzd79FXlXF9MoaNbMPpPrnnya4p+d0cZQsZm3lnWx0LwVXj2AVA==
dependencies:
"@abp/core" "^0.8.0"
"@abp/core" "^0.9.0"
bootstrap "^4.1.1"
"@abp/core@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/core/-/core-0.8.0.tgz#e7504cc14acc3a44bee2a414717a43c234600a14"
integrity sha512-hAY1HzZ+NkpmeutVrSajA1jBLoyaNonncO+qa6J463v2UJ/a7+WYGIfllsAIhaUDNqHhFtED2LJHQNEG9gpCfA==
"@abp/core@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/core/-/core-0.9.0.tgz#ef15f932bbc8d2b6345be9fe0c762810cf33c306"
integrity sha512-/Lg36ud9B6muLDjbaigCiMP9K+FgVCdERPuq+6We1k5xpPuVj+/cIJZQHlgSY25VIciOLMLbJg2lAOyuHSXbAA==
"@abp/datatables.net-bs4@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-0.8.0.tgz#acc42026a49948405792fcea2bcece002fe13e38"
integrity sha512-jqWxpbzfaq9VL+xb8qNMYJc0odAwZCbybHbN4kTPN4vIasL4Yhiotsxv6EC7T6YR9FxbAXnHpdmKBUogO3TGrw==
"@abp/datatables.net-bs4@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-0.9.0.tgz#30adb5e3afbf0cc58eec3ee52fdbd62cf2a1cce1"
integrity sha512-dD7ELc30bQeZdPFmTfZ/EUtmL6o4iY+1Ew17vdvkUxX3x+j7jmiaH2BJahKrtUTKtc4zCnv38dKt4ZwichsrBg==
dependencies:
"@abp/datatables.net" "^0.8.0"
"@abp/datatables.net" "^0.9.0"
datatables.net-bs4 "^1.10.16"
"@abp/datatables.net@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-0.8.0.tgz#0a596cbf810a224eeae9189442d0e993eaf4c18a"
integrity sha512-u2o6ZYzJ5kDi7t3ONhbwe14qNSVUj/5egIy645Ab8tDN7wEOt3eS7M3kledCEFmCcdmH2Ls9lxeHK5KMaizzzA==
"@abp/datatables.net@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-0.9.0.tgz#bcfa60fda70c1184e19fdde15d6e6aea706f9e0a"
integrity sha512-hYvGrG9PCfEO0D7jD/a7XbE/HOBCV2PQBSMakut81cx5piB0Gz4Zhw7I90ZHJ4r4CEqCM8u8A/xyaBFkQEqsbw==
dependencies:
"@abp/core" "^0.8.0"
"@abp/core" "^0.9.0"
datatables.net "^1.10.16"
"@abp/font-awesome@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-0.8.0.tgz#9325be9f6c7c1258c71b8706a0aea4f8436c67d1"
integrity sha512-R9NGupEjpMFaQ7EOumMwZd5+DgO+UIZ9KgvLU8q+SYTSQ/aSpYUX85BuUpaCWihKpOmucRHDBY4Jy8X/hBtLgQ==
"@abp/font-awesome@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-0.9.0.tgz#577196f787d3069216e8c7ed81fe1826b0036e79"
integrity sha512-6IAI7I7AMP3ubfTvjy4MKZUGIAYTzEDJq59UrLWuLrmpzwmdU/XRI3ItWg6hFbqkzkDiQh+qc5Eu9Oy15oi4JQ==
dependencies:
"@abp/core" "^0.8.0"
"@abp/core" "^0.9.0"
font-awesome "^4.7.0"
"@abp/jquery-form@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-0.8.0.tgz#9408a9fb7b240d21163fe3ccad703701fe22f40c"
integrity sha512-krUQkEV0HbrjsPmKB6qivVGJvB69SfyGE0t4hRrrOPh2NpSPeeQvVHlm9uTuzJyQ57/JPYuGINe2M8/bVbHdNA==
"@abp/jquery-form@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-0.9.0.tgz#351723fdfb0f0f84bad98a456eff209b556bca4c"
integrity sha512-aTx84JamYJnqQmNRLVN6PVQgZbFE+dS9jSQMHOs/zxJb/FU0Ko7sen0JQPgQ3SXuBYLHvqZgn9AFNg58nD9Kuw==
dependencies:
"@abp/jquery" "^0.8.0"
"@abp/jquery" "^0.9.0"
jquery-form "^4.2.2"
"@abp/jquery-validation-unobtrusive@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-0.8.0.tgz#369c9e995b6da6ef76519ce1f3ed41dc2f4e2bac"
integrity sha512-qkEXYe6kiI3UECK1vfiR+8zrdrr3bzhbdttP6F+DdstncPEe593B976H/jcXYruAXYAPIgP8sM5CTWoL0HrF2Q==
"@abp/jquery-validation-unobtrusive@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-0.9.0.tgz#731e2a74c2d551f395b3cb3dd18389843ac24735"
integrity sha512-dPBwdUu2ih0OKt3H7DciyLX2/+Db4HzsMejtzKQqpDhTQTccxGqOi0KDCj08Ak/JlEYgQI6pN1Vo9v7crBd29A==
dependencies:
"@abp/jquery-validation" "^0.8.0"
"@abp/jquery-validation" "^0.9.0"
jquery-validation-unobtrusive "^3.2.9"
"@abp/jquery-validation@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-0.8.0.tgz#c9fccfa8afd7b2bc2c455c131fd95338c2954c60"
integrity sha512-9ug0UTTfPdjOKlbUImzTP30SPY+IXz6BBHU4ODpNpIB9bnspW0VymSme3XJnM01pAiwjYEptf+uh7wuXbUvnDQ==
"@abp/jquery-validation@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-0.9.0.tgz#c32fbc119609ca2088e4e92b4134af52cabdc555"
integrity sha512-aUObKQVWb04GFt9Pmz232fzR5LQ/7+sjtoZEzO6ZT1zgYllFRPXEyiwjvsUyIQ4lzx8RQWfVLYCR5JBvcwZ/Ew==
dependencies:
"@abp/jquery" "^0.8.0"
"@abp/jquery" "^0.9.0"
jquery-validation "^1.17.0"
"@abp/jquery@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-0.8.0.tgz#3ece7d75f6f19adc1adf07f54e5db5c7c74931c2"
integrity sha512-cAZR/Jl5zWSbnYBKiLYbfItTVIf8teIeGVztA1pI6l40KpvtbGJsokz94su89kSMQj4Ixzo8SfSYlCgaFwYFSg==
"@abp/jquery@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-0.9.0.tgz#95a591ddbbcf13f772143ccfba5cbc8ab74c16fb"
integrity sha512-pqnqV5LtTolZz4J3aT+a+9yoBcv4LkaP3cG40r64fIdO1RsgWmNc6OWeRdD0N42bLJuPB7BQXd1vjNn+nT+cyA==
dependencies:
"@abp/core" "^0.8.0"
"@abp/core" "^0.9.0"
jquery "^3.3.1"
"@abp/lodash@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-0.8.0.tgz#54bfbe8d69dbd6866b1d923973f20033fc01457d"
integrity sha512-hzkSD36Ig127futjVBTi8HkO6KLPcsCyPiwVyncu1TVNTf37LVOcgtSdp7kaHV6ExwNs+u5FCpUUUftA+MHZig==
"@abp/lodash@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-0.9.0.tgz#df1128c7189e18f98dad379244015ce0ca230db2"
integrity sha512-ZzqSQy6F52p3XxcxTpzSj11gLJnTv3NzRPfSbl3FlRF++NJjLxFqKwYpAtZ2ExlnH5gWZwGBa5zdDmFMO0gMIQ==
dependencies:
"@abp/core" "^0.8.0"
"@abp/core" "^0.9.0"
lodash "^4.17.10"
"@abp/malihu-custom-scrollbar-plugin@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-0.8.0.tgz#fdd561e34d2e78dbb18141a5b45f3067e78d13f7"
integrity sha512-YAcVVWkmCv+eAiZl8FMK4inQAYLgqvtT6wp3LHPSwpi9M+npP7rsM1F8Xh8Yxi19ts7/QSluQMdfUqAlC8tzrg==
"@abp/luxon@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-0.9.0.tgz#3f10ff30382b17872cadc642285f3dfec54cd3c3"
integrity sha512-x8erCOutFMnDxSV/crnjriMtFCwTezSTdnv1eeWfAeFLu0H2Y4Y7f2OcXlxB0/n6qh+N4tffXsU9DaXKCi6XNA==
dependencies:
"@abp/core" "^0.8.0"
luxon "^1.17.3"
"@abp/malihu-custom-scrollbar-plugin@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-0.9.0.tgz#05b959c799d826e3f1bfcc6e112894613c3c9917"
integrity sha512-x9E09tyvuhMulzHvvjkgK/DvD5KPDH8J/gcVYtnJNlX6YGV6fBA/t1+nRgqPVbcGfhCzOW+ocqpJRQ05zIsVZw==
dependencies:
"@abp/core" "^0.9.0"
malihu-custom-scrollbar-plugin "^3.1.5"
"@abp/select2@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-0.8.0.tgz#037600ea3ef68ecd0b9d895a8a715b5e52a0ac85"
integrity sha512-Q2HV4/+zk9NNkZP7i0rbeEunE2usXtAHzTiSOFDHJaKCC3b1pAyo9ZZFwlVE69CVb9j0khXeem8T6zQmO9A88Q==
"@abp/select2@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-0.9.0.tgz#879a9ce03bb7e7c7b92847cf8c91696b459e3997"
integrity sha512-qoA0+KPpxRadQz5zA6UoDSNHXiu+mFU4oiqSvAngY2FvR5tC4w79n+6MNwDa+s2qUsUM6B6G0Q7LhcSVp6cWQA==
dependencies:
"@abp/core" "^0.8.0"
"@abp/core" "^0.9.0"
select2 "^4.0.5"
"@abp/sweetalert@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-0.8.0.tgz#d81d553d318c2809c8ff37aa92a4eed6492513e4"
integrity sha512-AcUil0SDrbuOSZyrBEOqa9TB9bqwVyfBGtULjRTxlVfYxyfPYxCajsqDL2W0uu9Ju+vRLZRIzY6IiAE7GFm8Ug==
"@abp/sweetalert@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-0.9.0.tgz#2efe24e5a678956259a060d3161a0a9f41fd8e49"
integrity sha512-90dvkVzO+SGEvE/L/7TZjIarU75VDqMooRRX71WH8H7hxyo/6Wq43/0Mw9X/nekSrUAO8iwDbUAVcmIooUjQtQ==
dependencies:
"@abp/core" "^0.8.0"
"@abp/core" "^0.9.0"
sweetalert "^2.1.0"
"@abp/timeago@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-0.8.0.tgz#9035f3476e26b7a70560280c7f87aa99c2a1ff29"
integrity sha512-/DJKXHorakg2Y4Tul+LV4Qihx3rsIAnuA236tttGQCuwynBXMCgNQxSDdvfdxYKlx36N+q1+FNa/d7bJ3bLY8g==
"@abp/timeago@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-0.9.0.tgz#be1b8e45a49502ce3df152279607b11233c5db9f"
integrity sha512-89hBxxGbd8LLLVPiRjKX2emybHzhAAfXMTL0eJVXAQj4f3pGPtD10TqfNmEaEQDS3ADrOmMTqOUHsHvkDy75rA==
dependencies:
"@abp/jquery" "^0.8.0"
"@abp/jquery" "^0.9.0"
timeago "^1.6.3"
"@abp/toastr@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-0.8.0.tgz#474e03e8154270fac7998a375d24469a1447e480"
integrity sha512-UUyhYE30KfeTc33kq0QTYuaUseVtHTYzybUDKTpZkXj9Tvb7hJ3MNVfmNcCzX9HYw/oKNNcvYgJHFUuSFX3bwQ==
"@abp/toastr@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-0.9.0.tgz#f7ae4499404ac5a5563acfe6d436419ae561a089"
integrity sha512-JEZKlmXLdPToVP9vmMUnSThBuY7dGutCw/DMo+w/mLuBC1Pv4e2FTzJdXQqM3ccunyy/pFZqXMfcoJtC+fwkTw==
dependencies:
"@abp/jquery" "^0.8.0"
"@abp/jquery" "^0.9.0"
toastr "^2.1.4"
abbrev@1:
@ -1410,6 +1418,11 @@ lodash@^4.17.10:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
luxon@^1.17.3:
version "1.19.2"
resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.19.2.tgz#f041a9031e7dff6fdbff46e46c73b3fdf4ab2764"
integrity sha512-4Dn6oriheX04QQd7mMhuScnyQPdD7h11aCJgSTq9FqkOWdxX7xRUXoX/OXu4rkw98NmcVz3QSLpLbDnT6lVsMw==
make-iterator@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6"

4
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi/Acme.BookStore.HttpApi.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>

4
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.MongoDB/Acme.BookStore.MongoDB.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>

4
samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>

72
samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs

@ -1,72 +0,0 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Shouldly;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Validation;
using Xunit;
namespace Acme.BookStore
{
public class BookAppService_Tests : BookStoreApplicationTestBase
{
private readonly IBookAppService _bookAppService;
public BookAppService_Tests()
{
_bookAppService = GetRequiredService<IBookAppService>();
}
[Fact]
public async Task Should_Get_List_Of_Books()
{
//Act
var result = await _bookAppService.GetListAsync(
new PagedAndSortedResultRequestDto()
);
//Assert
result.TotalCount.ShouldBeGreaterThan(0);
result.Items.ShouldContain(b => b.Name == "Test book 1");
}
[Fact]
public async Task Should_Create_A_Valid_Book()
{
//Act
var result = await _bookAppService.CreateAsync(
new CreateUpdateBookDto
{
Name = "New test book 42",
Price = 10,
PublishDate = DateTime.Now,
Type = BookType.ScienceFiction
}
);
//Assert
result.Id.ShouldNotBe(Guid.Empty);
result.Name.ShouldBe("New test book 42");
}
[Fact]
public async Task Should_Not_Create_A_Book_Without_Name()
{
var exception = await Assert.ThrowsAsync<AbpValidationException>(async () =>
{
await _bookAppService.CreateAsync(
new CreateUpdateBookDto
{
Name = "",
Price = 10,
PublishDate = DateTime.Now,
Type = BookType.ScienceFiction
}
);
});
exception.ValidationErrors
.ShouldContain(err => err.MemberNames.Any(mem => mem == "Name"));
}
}
}

4
samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>

4
samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj

@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

6
samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/appsettings.json

@ -1,17 +1,17 @@
{
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44351"
"BaseUrl": "https://localhost:44341"
}
},
"IdentityClients": {
"Default": {
"GrantType": "password",
"ClientId": "BookStore_ConsoleTestApp",
"ClientId": "BookStore_App",
"ClientSecret": "1q2w3e*",
"UserName": "admin",
"UserPassword": "1q2w3E*",
"Authority": "https://localhost:44331",
"Authority": "https://localhost:44341",
"Scope": "BookStore"
}
}

4
samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/Acme.BookStore.MongoDB.Tests.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>

2
samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/MongoDb/BookStoreMongoDbTestModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using Mongo2Go;
using Volo.Abp.Data;
using Volo.Abp.Modularity;

4
samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>

43
samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/BookStoreTestDataSeedContributor.cs

@ -1,49 +1,16 @@
using System;
using System.Threading.Tasks;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids;
namespace Acme.BookStore
{
public class BookStoreTestDataSeedContributor
: IDataSeedContributor, ITransientDependency
public class BookStoreTestDataSeedContributor : IDataSeedContributor, ITransientDependency
{
private readonly IRepository<Book, Guid> _bookRepository;
private readonly IGuidGenerator _guidGenerator;
public BookStoreTestDataSeedContributor(
IRepository<Book, Guid> bookRepository,
IGuidGenerator guidGenerator)
{
_bookRepository = bookRepository;
_guidGenerator = guidGenerator;
}
public async Task SeedAsync(DataSeedContext context)
public Task SeedAsync(DataSeedContext context)
{
await _bookRepository.InsertAsync(
new Book
{
Id = _guidGenerator.Create(),
Name = "Test book 1",
Type = BookType.Fantastic,
PublishDate = new DateTime(2015, 05, 24),
Price = 21
}
);
/* Seed additional test data... */
await _bookRepository.InsertAsync(
new Book
{
Id = _guidGenerator.Create(),
Name = "Test book 2",
Type = BookType.Science,
PublishDate = new DateTime(2014, 02, 11),
Price = 15
}
);
return Task.CompletedTask;
}
}
}

12
samples/BookStore-Modular/application/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
@ -12,11 +12,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="0.19.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="0.19.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="0.19.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="0.21.0" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" />
</ItemGroup>

14
samples/BookStore-Modular/application/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>
@ -13,11 +13,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="0.19.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="0.19.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="0.19.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Account.Application" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="0.21.0" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Application\Acme.BookStore.BookManagement.Application.csproj" />
</ItemGroup>

6
samples/BookStore-Modular/application/src/Acme.BookStore.Application/BookStoreApplicationModule.cs

@ -25,11 +25,7 @@ namespace Acme.BookStore
{
Configure<AbpAutoMapperOptions>(options =>
{
/* Use `true` for the `validate` parameter if you want to
* validate the profile on application startup.
* See http://docs.automapper.org/en/stable/Configuration-validation.html for more info
* about the configuration validation. */
options.AddProfile<BookStoreApplicationAutoMapperProfile>();
options.AddMaps<BookStoreApplicationModule>();
});
}
}

5
samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj

@ -4,7 +4,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
@ -22,10 +22,11 @@
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.4" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" />
<ProjectReference Include="..\Acme.BookStore.Application.Contracts\Acme.BookStore.Application.Contracts.csproj" />
<ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" />
</ItemGroup>

2
samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/appsettings.json

@ -7,7 +7,7 @@
"BookStore_Web": {
"ClientId": "BookStore_Web",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44388"
"RootUrl": "https://localhost:44367"
},
"BookStore_App": {
"ClientId": "BookStore_App",

18
samples/BookStore-Modular/application/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
@ -8,14 +8,14 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="0.19.0" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="0.19.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="0.19.0" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="0.19.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="0.19.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="0.19.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="0.19.0" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="0.21.0" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="0.21.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="0.21.0" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="0.21.0" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Domain.Shared\Acme.BookStore.BookManagement.Domain.Shared.csproj" />
</ItemGroup>

22
samples/BookStore-Modular/application/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>
@ -13,15 +13,15 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="0.19.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="0.19.0" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="0.19.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="0.19.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain" Version="0.19.0" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="0.19.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain" Version="0.19.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="0.19.0" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="0.21.0" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="0.21.0" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="0.21.0" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Domain\Acme.BookStore.BookManagement.Domain.csproj" />
</ItemGroup>

4
samples/BookStore-Modular/application/src/Acme.BookStore.Domain/BookStoreDomainModule.cs

@ -1,4 +1,5 @@
using Acme.BookStore.MultiTenancy;
using Acme.BookStore.BookManagement;
using Acme.BookStore.MultiTenancy;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.FeatureManagement;
@ -10,7 +11,6 @@ using Volo.Abp.PermissionManagement.Identity;
using Volo.Abp.PermissionManagement.IdentityServer;
using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
using Acme.BookStore.BookManagement;
namespace Acme.BookStore
{

6
samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>
@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.0.0" />
</ItemGroup>
</Project>

18
samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.Designer.cs → samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190918061142_Initial.Designer.cs

@ -10,14 +10,14 @@ using Acme.BookStore.EntityFrameworkCore;
namespace Acme.BookStore.Migrations
{
[DbContext(typeof(BookStoreMigrationsDbContext))]
[Migration("20190523122033_Initial")]
[Migration("20190918061142_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
@ -636,6 +636,8 @@ namespace Acme.BookStore.Migrations
.IsRequired()
.HasMaxLength(200);
b.Property<string>("Properties");
b.HasKey("Id");
b.ToTable("IdentityServerApiResources");
@ -776,6 +778,8 @@ namespace Acme.BookStore.Migrations
b.Property<string>("Description")
.HasMaxLength(1000);
b.Property<int>("DeviceCodeLifetime");
b.Property<bool>("EnableLocalLogin");
b.Property<bool>("Enabled");
@ -827,10 +831,14 @@ namespace Acme.BookStore.Migrations
b.Property<bool>("UpdateAccessTokenClaimsOnRefresh");
b.Property<string>("UserCodeType")
.HasMaxLength(100);
b.Property<int?>("UserSsoLifetime");
b.HasKey("Id");
b.HasIndex("ClientId")
.IsUnique();
b.HasIndex("ClientId");
b.ToTable("IdentityServerClients");
});
@ -1056,6 +1064,8 @@ namespace Acme.BookStore.Migrations
.IsRequired()
.HasMaxLength(200);
b.Property<string>("Properties");
b.Property<bool>("Required");
b.Property<bool>("ShowInDiscoveryDocument");

14
samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.cs → samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190918061142_Initial.cs

@ -218,7 +218,8 @@ namespace Acme.BookStore.Migrations
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Enabled = table.Column<bool>(nullable: false)
Enabled = table.Column<bool>(nullable: false),
Properties = table.Column<string>(nullable: true)
},
constraints: table =>
{
@ -272,7 +273,10 @@ namespace Acme.BookStore.Migrations
IncludeJwtId = table.Column<bool>(nullable: false),
AlwaysSendClientClaims = table.Column<bool>(nullable: false),
ClientClaimsPrefix = table.Column<string>(maxLength: 200, nullable: true),
PairWiseSubjectSalt = table.Column<string>(maxLength: 200, nullable: true)
PairWiseSubjectSalt = table.Column<string>(maxLength: 200, nullable: true),
UserSsoLifetime = table.Column<int>(nullable: true),
UserCodeType = table.Column<string>(maxLength: 100, nullable: true),
DeviceCodeLifetime = table.Column<int>(nullable: false)
},
constraints: table =>
{
@ -299,7 +303,8 @@ namespace Acme.BookStore.Migrations
Enabled = table.Column<bool>(nullable: false),
Required = table.Column<bool>(nullable: false),
Emphasize = table.Column<bool>(nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false)
ShowInDiscoveryDocument = table.Column<bool>(nullable: false),
Properties = table.Column<string>(nullable: true)
},
constraints: table =>
{
@ -902,8 +907,7 @@ namespace Acme.BookStore.Migrations
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClients_ClientId",
table: "IdentityServerClients",
column: "ClientId",
unique: true);
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type",

782
samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190914071643_Added_Book_Entity.Designer.cs → samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191008070344_Added_Book_Entity.Designer.cs

File diff suppressed because it is too large

15
samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190914071643_Added_Book_Entity.cs → samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191008070344_Added_Book_Entity.cs

@ -7,6 +7,14 @@ namespace Acme.BookStore.Migrations
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Data",
table: "IdentityServerPersistedGrants",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.CreateTable(
name: "BmBooks",
columns: table => new
@ -33,6 +41,13 @@ namespace Acme.BookStore.Migrations
{
migrationBuilder.DropTable(
name: "BmBooks");
migrationBuilder.AlterColumn<string>(
name: "Data",
table: "IdentityServerPersistedGrants",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string));
}
}
}

780
samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/BookStoreMigrationsDbContextModelSnapshot.cs

File diff suppressed because it is too large

22
samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj

@ -1,23 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.19.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.19.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.19.0" />
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="0.19.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.EntityFrameworkCore" Version="0.19.0" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="0.19.0" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="0.19.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="0.19.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="0.21.0" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.EntityFrameworkCore\Acme.BookStore.BookManagement.EntityFrameworkCore.csproj" />
</ItemGroup>

14
samples/BookStore-Modular/application/src/Acme.BookStore.HttpApi.Client/Acme.BookStore.HttpApi.Client.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>
@ -13,11 +13,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.HttpApi.Client" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="0.19.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="0.19.0" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi.Client" Version="0.19.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi.Client" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Account.HttpApi.Client" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi.Client" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi.Client" Version="0.21.0" />
</ItemGroup>
</Project>

14
samples/BookStore-Modular/application/src/Acme.BookStore.HttpApi/Acme.BookStore.HttpApi.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>
@ -13,11 +13,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="0.19.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="0.19.0" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi" Version="0.19.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi" Version="0.21.0" />
</ItemGroup>
</Project>

24
samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>Acme.BookStore.Web</RootNamespace>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
@ -12,6 +12,7 @@
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<PreserveCompilationContext>true</PreserveCompilationContext>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
</PropertyGroup>
<ItemGroup>
@ -31,13 +32,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.7.0" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
@ -45,13 +45,13 @@
<ProjectReference Include="..\Acme.BookStore.Application\Acme.BookStore.Application.csproj" />
<ProjectReference Include="..\Acme.BookStore.HttpApi\Acme.BookStore.HttpApi.csproj" />
<ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.19.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.19.0" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="0.19.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="0.19.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Web" Version="0.19.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Web" Version="0.21.0" />
</ItemGroup>
</Project>

25
samples/BookStore-Modular/application/src/Acme.BookStore.Web/BookStoreWebModule.cs

@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Acme.BookStore.EntityFrameworkCore;
using Acme.BookStore.Localization;
using Acme.BookStore.MultiTenancy;
@ -18,10 +19,12 @@ using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity.Web;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
@ -75,7 +78,9 @@ namespace Acme.BookStore.Web
ConfigureLocalizationServices();
ConfigureNavigationServices();
ConfigureAutoApiControllers();
ConfigureSwaggerServices(context.Services);
//Disabled swagger since it does not support ASP.NET Core 3.0 yet!
//ConfigureSwaggerServices(context.Services);
}
private void ConfigureUrls(IConfigurationRoot configuration)
@ -101,16 +106,12 @@ namespace Acme.BookStore.Web
{
Configure<AbpAutoMapperOptions>(options =>
{
/* use `true` for the `validate` parameter if you want to
* validate the profile on application startup.
* See http://docs.automapper.org/en/stable/Configuration-validation.html for more
* about configuration validation.
*/
options.AddProfile<BookStoreWebAutoMapperProfile>();
options.AddMaps<BookStoreWebModule>();
});
}
private void ConfigureVirtualFileSystem(IHostingEnvironment hostingEnvironment)
private void ConfigureVirtualFileSystem(IWebHostEnvironment hostingEnvironment)
{
if (hostingEnvironment.IsDevelopment())
{
@ -181,6 +182,8 @@ namespace Acme.BookStore.Web
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.UseCorrelationId();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
@ -191,7 +194,9 @@ namespace Acme.BookStore.Web
}
app.UseVirtualFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseJwtTokenMiddleware();
if (MultiTenancyConsts.IsEnabled)
@ -201,11 +206,15 @@ namespace Acme.BookStore.Web
app.UseIdentityServer();
app.UseAbpRequestLocalization();
/* Disabled swagger since it does not support ASP.NET Core 3.0 yet!
app.UseSwagger();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "BookStore API");
});
*/
app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea();
}

5
samples/BookStore-Modular/application/src/Acme.BookStore.Web/Program.cs

@ -1,7 +1,6 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -11,15 +10,13 @@ namespace Acme.BookStore.Web
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft", LogEventLevel.Debug)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.CreateLogger();

6
samples/BookStore-Modular/application/src/Acme.BookStore.Web/Properties/launchSettings.json

@ -3,8 +3,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44388/",
"sslPort": 44388
"applicationUrl": "https://localhost:44367/",
"sslPort": 44367
}
},
"profiles": {
@ -21,7 +21,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:44388/"
"applicationUrl": "https://localhost:44367/"
}
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save