Browse Source

Merge branch 'dev' into maliming/batch

pull/6119/head
maliming 6 years ago
parent
commit
c79935eca0
  1. 2
      .github/workflows/build-and-test.yml
  2. 4
      abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
  3. 11
      abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json
  4. 11
      common.DotSettings
  5. 142
      docs/en/Blog-Posts/2020-11-12 v4_0_Preview/POST.md
  6. BIN
      docs/en/Blog-Posts/2020-11-12 v4_0_Preview/abp-suite-auto-complete-dropdown.png
  7. 6
      docs/en/CLI.md
  8. 1
      docs/en/Customizing-Application-Modules-Overriding-Services.md
  9. 11
      docs/en/Migration-Guides/Abp-4_0-Angular.md
  10. 88
      docs/en/Migration-Guides/Abp-4_0-Blazor.md
  11. 6
      docs/en/Migration-Guides/Abp-4_0-MVC-Razor-Pages.md
  12. 195
      docs/en/Migration-Guides/Abp-4_0.md
  13. 11
      docs/en/Road-Map.md
  14. 4
      docs/en/UI/Angular/Component-Replacement.md
  15. 4
      docs/en/UI/Angular/Config-State.md
  16. 5
      docs/en/UI/Angular/Confirmation-Service.md
  17. 5
      docs/en/UI/Angular/Content-Projection-Service.md
  18. 7
      docs/en/UI/Angular/Cross-Origin-Strategy.md
  19. 4
      docs/en/UI/Angular/Dom-Insertion-Service.md
  20. 5
      docs/en/UI/Angular/Environment.md
  21. 6
      docs/en/UI/Angular/Feature-Libraries.md
  22. 4
      docs/en/UI/Angular/Features.md
  23. 140
      docs/en/UI/Angular/Form-Validation.md
  24. 4
      docs/en/UI/Angular/HTTP-Requests.md
  25. 7
      docs/en/UI/Angular/Lazy-Load-Service.md
  26. 5
      docs/en/UI/Angular/List-Service.md
  27. 8
      docs/en/UI/Angular/Localization.md
  28. 5
      docs/en/UI/Angular/Migration-Guide-v3.md
  29. 5
      docs/en/UI/Angular/Modifying-the-Menu.md
  30. 4
      docs/en/UI/Angular/Multi-Tenancy.md
  31. 4
      docs/en/UI/Angular/PWA-Configuration.md
  32. 6
      docs/en/UI/Angular/Permission-Management.md
  33. 6
      docs/en/UI/Angular/Quick-Start.md
  34. 4
      docs/en/UI/Angular/Service-Proxies.md
  35. 4
      docs/en/UI/Angular/Settings.md
  36. 4
      docs/en/UI/Angular/Subscription-Service.md
  37. 4
      docs/en/UI/Angular/Toaster-Service.md
  38. 6
      docs/en/UI/Angular/Track-By-Service.md
  39. BIN
      docs/en/UI/Angular/images/form-validation---custom-error-template.gif
  40. BIN
      docs/en/UI/Angular/images/form-validation---error-display-user-experience.gif
  41. BIN
      docs/en/UI/Angular/images/form-validation---new-error-message.gif
  42. BIN
      docs/en/UI/Angular/images/form-validation---overwrite-error-message.gif
  43. 4
      docs/en/UI/AspNetCore/Overall.md
  44. 4
      docs/en/docs-nav.json
  45. 1
      docs/zh-Hans/Customizing-Application-Modules-Overriding-Services.md
  46. 2
      framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj
  47. 2
      framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj
  48. 4
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj
  49. 4
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ExceptionHandling/UserExceptionInformer.cs
  50. 10
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/Messages/SimpleUiMessageService.cs
  51. 2
      framework/src/Volo.Abp.AspNetCore.Components/Volo.Abp.AspNetCore.Components.csproj
  52. 10
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/IUiMessageService.cs
  53. 3
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/IUiNotificationService.cs
  54. 15
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/VeeValidate/VeeValidateScriptContributor.cs
  55. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Vue/VueScriptContributor.cs
  56. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.csproj
  57. 4
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj
  58. 4
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs
  59. 9
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/MvcCoreBuilderExtensions.cs
  60. 3
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Response/AbpNoContentActionFilter.cs
  61. 2
      framework/src/Volo.Abp.AspNetCore.TestBase/Volo.Abp.AspNetCore.TestBase.csproj
  62. 2
      framework/src/Volo.Abp.Authorization/Volo.Abp.Authorization.csproj
  63. 2
      framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj
  64. 10
      framework/src/Volo.Abp.BlazoriseUI/BlazoriseUiMessageService.cs
  65. 2
      framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs
  66. 6
      framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj
  67. 2
      framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo.Abp.Caching.StackExchangeRedis.csproj
  68. 2
      framework/src/Volo.Abp.Caching/Volo.Abp.Caching.csproj
  69. 17
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs
  70. 4
      framework/src/Volo.Abp.Cli/Volo.Abp.Cli.csproj
  71. 18
      framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj
  72. 2
      framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo.Abp.EntityFrameworkCore.SqlServer.csproj
  73. 2
      framework/src/Volo.Abp.EntityFrameworkCore.Sqlite/Volo.Abp.EntityFrameworkCore.Sqlite.csproj
  74. 4
      framework/src/Volo.Abp.EntityFrameworkCore/Volo.Abp.EntityFrameworkCore.csproj
  75. 2
      framework/src/Volo.Abp.ExceptionHandling/Volo.Abp.ExceptionHandling.csproj
  76. 2
      framework/src/Volo.Abp.Http.Client.IdentityModel.WebAssembly/Volo.Abp.Http.Client.IdentityModel.WebAssembly.csproj
  77. 17
      framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs
  78. 2
      framework/src/Volo.Abp.Http.Client/Volo.Abp.Http.Client.csproj
  79. 4
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientBuilderOptions.cs
  80. 20
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientModule.cs
  81. 2
      framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj
  82. 7
      framework/src/Volo.Abp.Json/Volo/Abp/Json/AbpJsonModule.cs
  83. 9
      framework/src/Volo.Abp.Json/Volo/Abp/Json/AbpJsonOptions.cs
  84. 6
      framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs
  85. 38
      framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToBooleanConverter.cs
  86. 41
      framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs
  87. 1
      framework/src/Volo.Abp.Swashbuckle/Microsoft/AspNetCore/Builder/AbpSwaggerUIBuilderExtensions.cs
  88. 54
      framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs
  89. 3
      framework/src/Volo.Abp.Swashbuckle/wwwroot/swagger/ui/abp.swagger.js
  90. 6
      framework/src/Volo.Abp.VirtualFileSystem/Volo.Abp.VirtualFileSystem.csproj
  91. 2
      framework/test/SimpleConsoleDemo/SimpleConsoleDemo.csproj
  92. 8
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Response/NoContentTestController.cs
  93. 25
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Response/NoContentTestController_Tests.cs
  94. 19
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Response/TestResultFilter.cs
  95. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj
  96. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.csproj
  97. 2
      framework/test/Volo.Abp.BlobStoring.Aliyun.Tests/Volo.Abp.BlobStoring.Aliyun.Tests.csproj
  98. 2
      framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo.Abp.VirtualFileSystem.Tests.csproj
  99. 2
      global.json
  100. 2
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj

2
.github/workflows/build-and-test.yml

@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@master
with:
dotnet-version: 5.0.100-rc.2.20479.15
dotnet-version: 5.0.100
- name: Build All
run: .\build-all.ps1

4
abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json

@ -30,6 +30,8 @@
"UserNameNotFound": "There is no user with username {0}",
"SuccessfullyAddedToNewsletter": "Thanks you for subscribing to our newsletter!",
"MyProfile": "My profile",
"EmailNotValid": "Please enter a valid email address."
"EmailNotValid": "Please enter a valid email address.",
"JoinOurMarketingNewsletter": "Join our marketing newsletter",
"WouldLikeToReceiveMarketingMaterials": "I would like to receive marketing materials like product deals & special offers."
}
}

11
abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json

@ -90,6 +90,15 @@
"LatestArticles": "Latest Articles",
"ArticleRequests": "Article Requests",
"AllArticleRequests": "See All Article Requests",
"ArticleAssignRequest": "Want to write this article? Click here to assign yourself."
"ArticleAssignRequest": "assign yourself.",
"SubscribeToTheNewsletter": "Subscribe to the Newsletter",
"NewsletterEmailDefinition": "Get information about happenings in ABP like new releases, free sources, articles, and more.",
"NoThanks": "No, thanks",
"MaybeLater": "Maybe later",
"JoinOurArticleNewsletter": "Join our article newsletter",
"Community": "Community",
"Marketing": "Marketing",
"ArticleAssignMessage": "Want to write this article? Click here to",
"CommunityPrivacyPolicyConfirmation": "I agree to the Terms & Conditions and <a href=\"https://commercial.abp.io/Privacy\">Privacy Policy</a>."
}
}

11
common.DotSettings

@ -20,6 +20,17 @@
<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>
<s:Boolean x:Key="/Default/Environment/InlayHints/CppTypeNameHintsOptions/HideTypeNameHintsWhenTypeNameIsEvidentFromVariableName/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/Environment/InlayHints/CppTypeNameHintsOptions/ShowMethodReturnTypeNameHints/@EntryValue">Never</s:String>
<s:String x:Key="/Default/Environment/InlayHints/CppTypeNameHintsOptions/ShowTypeNameHintsForImplicitlyTypedVariables/@EntryValue">Never</s:String>
<s:Boolean x:Key="/Default/Environment/InlayHints/CSharpTypeNameHintsOptions/HideTypeNameHintsWhenTypeNameIsEvidentFromVariableName/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/Environment/InlayHints/CSharpTypeNameHintsOptions/ShowMethodReturnTypeNameHints/@EntryValue">Never</s:String>
<s:String x:Key="/Default/Environment/InlayHints/CSharpTypeNameHintsOptions/ShowTypeNameHintsForImplicitlyTypedVariables/@EntryValue">Never</s:String>
<s:String x:Key="/Default/Environment/InlayHints/CSharpTypeNameHintsOptions/ShowTypeNameHintsForLambdaExpressionParameters/@EntryValue">Never</s:String>
<s:String x:Key="/Default/Environment/InlayHints/CSharpTypeNameHintsOptions/ShowTypeNameHintsForLinqQueryRangeVariables/@EntryValue">Never</s:String>
<s:String x:Key="/Default/Environment/InlayHints/CSharpTypeNameHintsOptions/ShowTypeNameHintsForPatternMatchingExpressions/@EntryValue">Never</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002EDaemon_002ETypeNameHints_002ECppTypeNameHintsOptionsMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECSharp_002ETypeNameHints_002ECSharpTypeNameHintsOptionsMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/TypeNameHintsOptions/HideTypeNameHintsWhenTypeNameIsEvidentFromVariableName/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/Environment/TypeNameHintsOptions/ShowMethodReturnTypeNameHints/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/Environment/TypeNameHintsOptions/ShowTypeNameHintsForImplicitlyTypedVariables/@EntryValue">False</s:Boolean>

142
docs/en/Blog-Posts/2020-11-12 v4_0_Preview/POST.md

@ -0,0 +1,142 @@
# ABP Framework 4.0 RC Has Been Published based on .NET 5.0!
Today, we have released the [ABP Framework](https://abp.io/) (and the [ABP Commercial](https://commercial.abp.io/)) `4.0.0-rc.1` that is based on the **.NET 5.0**. This blog post introduces the new features and important changes in the new version.
> **The planned release date for the [4.0.0 final](https://github.com/abpframework/abp/milestone/45) version is November 26, 2020**.
## Get Started with the 4.0 RC.1
If you want to try the version `4.0.0-rc.1` today, follow the steps below;
1) **Upgrade** the ABP CLI to the version `4.0.0-rc.1` using a command line terminal:
````bash
dotnet tool update Volo.Abp.Cli -g --version 4.0.0-rc.1
````
**or install** if you haven't installed before:
````bash
dotnet tool install Volo.Abp.Cli -g --version 4.0.0-rc.1
````
2) Create a **new application** with the `--preview` option:
````bash
abp new BookStore --preview
````
See the [ABP CLI documentation](https://docs.abp.io/en/abp/3.3/CLI) for all the available options.
> You can also use the *Direct Download* tab on the [Get Started](https://abp.io/get-started) page by selecting the **Preview checkbox**.
## Migrating From 3.x to 4.0
The version 4.0 comes with some major changes including the **migration from .NET Core 3.1 to .NET 5.0**.
We've prepared a **detailed [migration document](https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0)** to explain all the changes and the actions you need to take while upgrading your existing solutions.
## What's new with the ABP Framework 4.0
### The Blazor UI
The Blazor UI is now stable and officially supported. The [web application development tutorial](https://docs.abp.io/en/abp/4.0/Tutorials/Part-1?UI=Blazor) has been updated based on the version 4.0.
#### abp bundle command
Introducing the `abp bundle` CLI command to manage static JavaScript & CSS file dependencies of a Blazor application. This command is currently used to add the dependencies to the `index.html` file in the dependency order by respecting to modularity. In the next version it will automatically unify & minify the files. The documentation is being prepared.
#### Removed the JQuery & Bootstrap JavaScript
Removed JQuery & Bootstrap JavaScript dependencies for the Blazor UI.
>There are some other changes in the startup template and some public APIs. Follow the [Migration Guide](https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0) to apply changes for existing solutions that you're upgrading from the version 3.3. While we will continue to make improvements add new features, we no longer make breaking changes on the existing APIs until the version 5.0.
#### Others
A lot of minor and major improvements have been done for the Blazor UI. Some of them are listed below:
* Implemented `IComponentActivator` to resolve the component from the `IServiceProvider`. So, you can now inject dependencies into the constructor of your razor component.
* Introduced the `AbpComponentBase` base class that you derive your components from. It has useful base properties that you can use in your pages/components.
* Introduced `IUiNotificationService` service to show toast notifications on the UI.
* Improved the `IUiMessageService` to show message & confirmation dialogs.
### System.Text.Json
ABP Framework 4.0 uses the System.Text.Json by default as the JSON serialization library. It, actually, using a hybrid approach: Continues to use the Newtonsoft.Json when it needs to use the features not supported by the System.Text.Json.
Follow the [Migration Guide](https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0) to learn how to configure to use the Newtonsoft.Json for some specific types or switch back to the Newtonsoft.Json as the default JSON serializer.
### Identity Server 4 Upgrade
ABP Framework upgrades the [IdentityServer4](https://www.nuget.org/packages/IdentityServer4) library from 3.x to 4.1.1 with the ABP Framework version 4.0. IdentityServer 4.x has a lot of changes. Some of them are **breaking changes in the data structure**.
Follow the [Migration Guide](https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0) to upgrade existing solutions.
### Creating a New Module Inside the Application
ABP CLI has now a command to create a new module and add it to an existing solution. In this way, you can create modular applications easier than before.
Example: Create a *ProductManagement* module into your solution.
````bash
abp add-module ProductManagement --new --add-to-solution-file
````
Execute this command in a terminal in the root folder of your solution. If you don't specify the `--add-to-solution-file` option, then the module projects will not be added to the main solution, but the project references still be added. In this case, you need to open the module's solution to develop the module.
See the [CLI document](https://docs.abp.io/en/abp/4.0/CLI) for other options.
### WPF Startup Template
Introducing the WPF startup template for the ABP Framework. Use the ABP CLI new command to create a new WPF application:
````bash
abp new MyWpfApp -t wpf
````
This is a minimalist, empty project template that is integrated to the ABP Framework.
### New Languages
**Thanks to the contributors** from the ABP Community, the framework modules and the startup template have been localized to **German** (by [Alexander Pilhar](https://github.com/alexanderpilhar) & [Nico Lachmuth](https://github.com/tntwist)) and **Spanish** (by [Jose Manuel Gonzalez](https://github.com/jmglezgz)) languages.
### Other Notes
* Since [Mongo2Go](https://github.com/Mongo2Go/Mongo2Go) library not supports transactions, you can use transactions in unit tests for MongoDB.
## What's new with the ABP Commercial 4.0
### The Blazor UI
The Blazor UI for the ABP Commercial is also becomes stable and feature rich with the version 4.0;
* [ABP Suite](https://commercial.abp.io/tools/suite) now supports to generate CRUD pages for the Blazor UI.
* Completed the [Lepton Theme](https://commercial.abp.io/themes) for the Blazor UI.
* Implemented the [File Management](https://commercial.abp.io/modules/Volo.FileManagement) module for the Blazor UI.
### The ABP Suite
While creating create/edit modals with a navigation property, we had two options: A dropdown to select the target entity and a modal to select the entity by searching with a data table.
Dropdown option now supports **lazy load, search and auto-complete**. In this way, selecting a navigation property becomes much easier and supports large data sets on the dropdown.
**Example: Select an author while creating a new book**
![abp-suite-auto-complete-dropdown](abp-suite-auto-complete-dropdown.png)
With the new version, you can **disable backend code generation** on CRUD page generation. This is especially useful if you want to regenerate the page with a different UI framework, but don't want to regenerate the server side code.
### Identity Server Management UI Revised
Completely revised the Identity Server Management UI based on the IDS 4.x changes.
## About the Next Release
The next feature version, `4.1.0`, will mostly focus on completing the missing documents, fixing bugs, performance optimizations and improving the Blazor UI features. The planned preview release date for the version `4.1.0` is December 10 and the final (stable) version release date is December 24.
Follow the [GitHub milestones](https://github.com/abpframework/abp/milestones) for all the planned ABP Framework version release dates.
## Feedback
Please check out the ABP Framework 4.0.0 RC and [provide feedback](https://github.com/abpframework/abp/issues/new) to help us to release a more stable version. **The planned release date for the [4.0.0 final](https://github.com/abpframework/abp/milestone/45) version is November 26**.

BIN
docs/en/Blog-Posts/2020-11-12 v4_0_Preview/abp-suite-auto-complete-dropdown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

6
docs/en/CLI.md

@ -178,7 +178,7 @@ abp add-module Volo.Blogging
* This example adds the `Volo.Blogging` module to the solution.
```bash
abp add-module ProductManagement --new-template --add-to-solution-file
abp add-module ProductManagement --new --add-to-solution-file
```
* This command creates a fresh new module customized for your solution (named `ProductManagement`) and adds it to your solution.
@ -189,8 +189,8 @@ abp add-module ProductManagement --new-template --add-to-solution-file
* `--solution` or `-s`: Specifies the solution (.sln) file path. If not specified, CLI tries to find a .sln file in the current directory.
* `--skip-db-migrations`: For EF Core database provider, it automatically adds a new code first migration (`Add-Migration`) and updates the database (`Update-Database`) if necessary. Specify this option to skip this operation.
* `-sp` or `--startup-project`: Relative path to the project folder of the startup project. Default value is the current folder.
* `--new-template`: Creates a fresh new module (customized for your solution) and adds it to your solution.
* `--with-source-code`: Downloads the source code of the module to your solution folder and uses local project references instead of NuGet/NPM packages. This options is always `True` if `--new-template` is used.
* `--new`: Creates a fresh new module (customized for your solution) and adds it to your solution.
* `--with-source-code`: Downloads the source code of the module to your solution folder and uses local project references instead of NuGet/NPM packages. This options is always `True` if `--new` is used.
* `--add-to-solution-file`: Adds the downloaded/created module to your solution file, so you will also see the projects of the module when you open the solution on a IDE. (only available when `--with-source-code` is `True`.)
### get-source

1
docs/en/Customizing-Application-Modules-Overriding-Services.md

@ -59,7 +59,6 @@ In most cases, you will want to change one or a few methods of the current imple
### Example: Overriding an Application Service
````csharp
//[RemoteService(IsEnabled = false)] // If you use dynamic controller feature you can disable remote service. Prevent creating duplicate controller for the application service.
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IIdentityUserAppService), typeof(IdentityUserAppService), typeof(MyIdentityUserAppService))]
public class MyIdentityUserAppService : IdentityUserAppService

11
docs/en/Migration-Guides/Abp-4_0-Angular.md

@ -0,0 +1,11 @@
# Angular UI 3.3 to 4.0 Migration Guide
### Removed the Angular Account Module Public UI
Angular UI is using the Authorization Code Flow to authenticate since the version 3.1.0 by default. Starting from the version 4.0, this is becoming the only option, because it is the recommended way of authenticating SPAs.
If you haven't done it yet, see [this post](https://blog.abp.io/abp/ABP-Framework-v3.1-RC-Has-Been-Released) to change the authentication of your application.
### Removed the SessionState
Use `SessionStateService` instead of the `SessionState`. See [this issue](https://github.com/abpframework/abp/issues/5606) for details.

88
docs/en/Migration-Guides/Abp-4_0-Blazor.md

@ -0,0 +1,88 @@
# Blazor UI 3.3 to 4.0 Migration Guide
## Startup Template Changes
These changes are required to manually applied in your own solution. It would be easier if you create a new solution based on 4.0 with the same name of your current solution then compare the files.
### Csproj File / Dependencies
* Add `<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>` to the `PropertyGroup` section of your project (`.csproj`) file.
* Update the `Blazorise.*` packages to the latest version (to the latest RC for the ABP 4.0 preview).
### wwwroot/index.html
There are some changes made in the index.html file;
* Removed JQuery & Bootstrap JavaScript dependencies
* Replaced Bootstrap and FontAwesome imports with local files instead of CDN usages.
* Re-arranged some ABP CSS file locations.
* Introduced the `abp bundle` CLI command to manage global Style/Script file imports.
Follow the steps below to apply the changes;
1. Add the bundle contributor class into your project (it will be slightly different based on your solution namespaces):
````csharp
using Volo.Abp.Bundling;
namespace MyCompanyName.MyProjectName.Blazor
{
public class MyProjectNameBundleContributer : IBundleContributer
{
public void AddScripts(BundleContext context)
{
}
public void AddStyles(BundleContext context)
{
context.Add("main.css");
}
}
}
````
If you are using another global style/script files, add them here.
2. Remove all the `<link...>` elements and replace with the following comment tags:
````html
<!--ABP:Styles-->
<!--/ABP:Styles-->
````
3. Remove all the `<script...>` elements and replace with the following comment tags:
````html
<!--ABP:Scripts-->
<!--/ABP:Scripts-->
````
4. Execute the following command in a terminal in the root folder of the Blazor project (`.csproj`) file (ensure that you're using the ABP CLI version 4.0):
````bash
abp bundle
````
This will fill in the `Styles` and `Scripts` tags based on the dependencies.
5. You can clean the `blazor-error-ui` related sections from your `main.css` file since they are not needed anymore.
### The Root Element
This change is optional but recommended.
* Change `<app>...</app>` to `<div id="ApplicationContainer">...</div>` in the `wwwroot/index.html`.
* Change `builder.RootComponents.Add<App>("app");` to `builder.RootComponents.Add<App>("#ApplicationContainer");` in the *YourProjectBlazorModule.cs*.
## AbpCrudPageBase Changes
If you've derived your pages from the `AbpCrudPageBase` class, then you may need to apply the following changes;
- `OpenEditModalAsync` method gets `EntityDto` instead of id (`Guid`) parameter. Pass `context` instead of `context.Id`.
- `DeleteEntityAsync` method doesn't display confirmation dialog anymore. You can use the new `EntityActions` component in Data Grids to show confirmation messages. You can also inject `IUiMessageService` to your page or component and call the `ConfirmAsync` explicitly.
- Added `GetListInput` as a base property that is used to filter while getting the entities from the server.
## Others
- Refactored namespaces for some Blazor components ([#6015](https://github.com/abpframework/abp/issues/6015)).
- Removed Async Suffix from IUiMessageService ([#6123](https://github.com/abpframework/abp/pull/6123)).

6
docs/en/Migration-Guides/Abp-4_0-MVC-Razor-Pages.md

@ -0,0 +1,6 @@
# MVC / Razor Pages UI 3.3 to 4.0 Migration Guide
## Use IBrandingProvider in the Volo.Abp.UI Package
This will be a breaking change for MVC UI, but very easy to fix. `IBrandingProvider` is being moved from `Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components` to `Volo.Abp.Ui.Branding` namespace. So, just update the namespace imports.

195
docs/en/Migration-Guides/Abp-4_0.md

@ -1,53 +1,70 @@
# ABP Framework 3.3 to 4.0 Migration Guide
## Auto API Controller Route Changes
This document introduces the breaking changes done in the ABP Framework 4.0 and explains how to fix your 3.x based solutions while upgrading to the ABP Framework 4.0.
The route calculation for the [Auto API Controllers](https://docs.abp.io/en/abp/latest/API/Auto-API-Controllers) is changing with the ABP Framework version 4.0 ([#5325](https://github.com/abpframework/abp/issues/5325)). Previously, **camelCase** route paths were being used. Beginning from the version 4.0, it uses **kebab-case** route paths where it is possible.
> See this blog post (TODO: LINK) to learn what's new with the ABP Framework 4.0. This document only focuses on the breaking changes.
**A typical auto API before v4.0**
## Overall
![route-before-4](images/route-before-4.png)
Here, the overall list of the changes;
**camelCase route parts become kebab-case with 4.0**
* Upgraded to the .NET 5.0 [(#6118](https://github.com/abpframework/abp/issues/6118)).
* Moved from Newtonsoft.Json to System.Text.Json [(#1198](https://github.com/abpframework/abp/issues/1198)).
* Upgraded to the Identity Server 4.1.1 ([#4461](https://github.com/abpframework/abp/issues/4461)).
* Switched to `kebab-case` for conventional URLs for the auto API controller routes ([#5325](https://github.com/abpframework/abp/issues/5325)).
* Removed Retry for the Dynamic HTTP Client Proxies ([#6090](https://github.com/abpframework/abp/issues/6090)).
* Creation audit properties of the entities made read-only ([#6020](https://github.com/abpframework/abp/issues/6020)).
* Changed type of the IHasExtraProperties.ExtraProperties ([#3751](https://github.com/abpframework/abp/issues/3751)).
* Use IBrandingProvider in the Volo.Abp.UI package and remove the one in the Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared ([#5375](https://github.com/abpframework/abp/issues/5375)).
* Removed the Angular Account Module Public UI (login, register... pages) since they are not being used in the default (authorization code) flow ([#5652](https://github.com/abpframework/abp/issues/5652)).
* Removed the SessionState in the @abp/ng.core package ([#5606](https://github.com/abpframework/abp/issues/5606)).
* Made some API revisions & startup template changes for the Blazor UI.
![route-4](images/route-4.png)
## Upgraded to .NET 5.0
If it is hard to change it for your application, you can continue to use the version 3.x route strategy, by following one of the approaches;
ABP Framework has been moved to .NET 5.0. So, if you want to upgrade to the ABP Framework 4.0, you also need to upgrade to .NET 5.0.
- Set `UseV3UrlStyle` to `true` in the options of the `options.ConventionalControllers.Create(...)` method. Example:
See the [Migrate from ASP.NET Core 3.1 to 5.0](https://docs.microsoft.com/en-us/aspnet/core/migration/31-to-50) document to learn how to upgrade your solution to .NET 5.0.
```csharp
options.ConventionalControllers
.Create(typeof(BookStoreApplicationModule).Assembly, opts =>
{
opts.UseV3UrlStyle = true;
});
```
## Moved to System.Text.Json
This approach effects only the controllers for the `BookStoreApplicationModule`.
ABP Framework 4.0 uses the System.Text.Json by default as the JSON serialization library. It, actually, using a hybrid approach: Continues to use the Newtonsoft.Json when it needs to use features not supported by the System.Text.Json.
- Set `UseV3UrlStyle` to `true` for the `AbpConventionalControllerOptions` to set it globally. Example:
### Unsupported Types
```csharp
Configure<AbpConventionalControllerOptions>(options =>
If you want to use the Newtonsoft.Json to serialize/deserialize for some specific types, you can configure the `AbpSystemTextJsonSerializerOptions` in your module's `ConfigureServices` method.
**Example: Use Newtonsoft.Json for `MySpecialClass`**
````csharp
Configure<AbpSystemTextJsonSerializerOptions>(options =>
{
options.UseV3UrlStyle = true;
options.UnsupportedTypes.AddIfNotContains(typeof(MySpecialClass));
});
```
````
### Always Use the Newtonsoft.Json
Setting it globally effects all the modules in a modular application.
If you want to continue to use the Newtonsoft.Json library for all the types, you can set `UseHybridSerializer` to false in the `PreConfigureServices` method of your module class:
## Identity Server Changes
````csharp
PreConfigure<AbpJsonOptions>(options =>
{
options.UseHybridSerializer = false;
});
````
## Upgraded to Identity Server 4.1.1
ABP Framework upgrades the [IdentityServer4](https://www.nuget.org/packages/IdentityServer4) library from 3.x to 4.x with the ABP Framework version 4.0. IdentityServer 4.x has a lot of changes, some of them are **breaking changes in the data structure**.
ABP Framework upgrades the [IdentityServer4](https://www.nuget.org/packages/IdentityServer4) library from 3.x to 4.1.1 with the ABP Framework version 4.0. IdentityServer 4.x has a lot of changes. Some of them are **breaking changes in the data structure**.
### Entity Changes
Entity changed don't directly affect your application, however it is good to know.
Entity changes don't directly affect your application; however, it is good to know.
#### ApiScope
As the **most important breaking change**, Identity Server 4.x places the `ApiScope` as an independent aggregate root. Previously it was a part of the to `ApiResource` aggregate. This requires manual operation. See the _Database Changes_ section.
As the **most critical breaking change**; Identity Server 4.x defines the `ApiScope` as an independent aggregate root. Previously, it was the child entity of the `ApiResource`. This change requires manual operation. See the _Database Changes_ section.
Also, added `Enabled(string)` and `Description(bool,true)` properties.
@ -57,40 +74,40 @@ Also, added `Enabled(string)` and `Description(bool,true)` properties.
#### Client
- Added `RequireRequestObject (bool)` and `AllowedIdentityTokenSigningAlgorithms (string)` properties.
- Changed default value of `RequireConsent` from `true` to `false`.
- Changed default value of `RequirePkce` from `false` to `true`.
- Added `RequireRequestObject <bool>` and `AllowedIdentityTokenSigningAlgorithms <string>` properties.
- Changed the default value of `RequireConsent` from `true` to `false`.
- Changed the default value of `RequirePkce` from `false` to `true`.
#### DeviceFlowCodes
- Added `SessionId (string)` and `Description (string)` properties.
- Added `SessionId <string>` and `Description <string>` properties.
#### PersistedGrant
- Added `SessionId (string)` and `Description(string)` and `ConsumedTime (DateTime?)` properties
- Added `SessionId <string>`, `Description <string>` and `ConsumedTime <DateTime?>` properties
### Database Changes
> Attention: **Please backup your database** before the migration!
**If you are upgrading from 3.x, then there are some change should be done in your database.**
**If you are upgrading from 3.x, then there are some steps should be done in your database.**
#### Database Schema Migration
If you are using **Entity Framework Core**, you need to add a new database migration, using the `Add-Migration` command, and apply changes to the database. Please **review the migration** script and read the sections below to understand if it affects your existing data. Otherwise, you may **loose some of your configuration**, which may not be easy to remember and re-configure.
If you are using **Entity Framework Core**, you need to add a new database migration, using the `Add-Migration` command, and apply changes to the database. Please **review the migration** script and read the sections below to understand if it affects your existing data. Otherwise, you may **lose some of your configuration**, which may not be easy to remember and re-configure.
#### Seed Code
If you haven't customize the `IdentityServerDataSeedContributor` and haven't customized the initial data inside the `IdentityServer*` tables;
If you haven't customized the `IdentityServerDataSeedContributor` and haven't customized the initial data inside the `IdentityServer*` tables;
1. Update `IdentityServerDataSeedContributor` class by comparing to [the latest code](https://github.com/abpframework/abp/blob/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/IdentityServer/IdentityServerDataSeedContributor.cs). You probably only need to add the `CreateApiScopesAsync` method and the code related to it.
2. Then you can simply clear all the **table data** in these tables then execute the `DbMigrator` application again to fill it with the new configuration.
2. Then you can simply clear all the **data** in these tables then execute the `DbMigrator` application to fill it with the new configuration.
#### Migrating the Configuration Data
If you've customize your IdentityServer configuration in the database or in the seed data, you should understand the changes and upgrade your code/data accordingly. Especially, the following changes will affect your application:
If you've customized your IdentityServer configuration in the database or in the seed data, you should understand the changes and upgrade your code/data accordingly. Especially, the following changes will affect your application:
- `IdentityServerApiScopes` table's `Enabled` field is dropped and re-created. So, you need to manually enable the api scopes again.
- `IdentityServerApiScopes` table's `Enabled` field is dropped and re-created. So, you need to enable the API scopes again manually.
- `IdentityServerApiResourceScopes` table is dropped and recreated. So, you need to backup and move your current data to the new table.
- `IdentityServerIdentityResourceClaims` table is dropped and recreated. So, you need to backup and move your current data to the new table.
@ -98,9 +115,9 @@ You may need to perform additional steps based on how much you made custom confi
### Other IdentityServer Changes
IdentityServer has removed the [public origin option](https://github.com/IdentityServer/IdentityServer4/pull/4335). It was resolving http/https conversion problems, but they decided to leave this to the developer. This is especially needed if you use a reverse proxy where your external protocol is HTTPS but internal protocol is HTTP.
IdentityServer has removed the [public origin option](https://github.com/IdentityServer/IdentityServer4/pull/4335). It was resolving HTTP/HTTPS conversion issues, but they decided to leave this to the developer. This is especially needed if you use a reverse proxy where your external protocol is HTTPS but internal protocol is HTTP.
One simple solution is to add such a middleware into your ASP.NET Core pipeline, at the beginning.
One simple solution is to add such a middleware at the begingning of your ASP.NET Core pipeline.
```csharp
app.Use((httpContext, next) =>
@ -117,9 +134,101 @@ app.Use((httpContext, next) =>
- https://leastprivilege.com/2020/06/19/announcing-identityserver4-v4-0/
- https://github.com/IdentityServer/IdentityServer4/issues/4592
## Blazor UI
## Auto API Controller Route Changes
The route calculation for the [Auto API Controllers](https://docs.abp.io/en/abp/latest/API/Auto-API-Controllers) is changing with the ABP Framework version 4.0 ([#5325](https://github.com/abpframework/abp/issues/5325)). Before v4.0 the route paths were **camelCase**. After version 4.0, it's changed to **kebab-case** route paths where it is possible.
### AbpCrudPageBase Changes
**A typical auto API before v4.0**
![route-before-4](images/route-before-4.png)
**camelCase route parts become kebab-case with 4.0**
![route-4](images/route-4.png)
### How to Fix?
You may not take any action for the MVC & Blazor UI projects.
For the Angular UI, this change may effect your client UI. If you have used the [ABP CLI Service Proxy Generation](../UI/Angular/Service-Proxies.md), you can run the server side and re-generate the service proxies. If you haven't used this tool, you should manually update the related URLs in your application.
If there are other type of clients (e.g. 3rd-party companies) using your APIs, they also need to update the URLs.
### Use the v3.x style URLs
If it is hard to change it in your application, you can still to use the version 3.x route strategy, by following one of the approaches;
- Set `UseV3UrlStyle` to `true` in the options of the `options.ConventionalControllers.Create(...)` method. Example:
```csharp
options.ConventionalControllers
.Create(typeof(BookStoreApplicationModule).Assembly, opts =>
{
opts.UseV3UrlStyle = true;
});
```
This approach affects only the controllers for the `BookStoreApplicationModule`.
- Set `UseV3UrlStyle` to `true` for the `AbpConventionalControllerOptions` to set it globally. Example:
```csharp
Configure<AbpConventionalControllerOptions>(options =>
{
options.UseV3UrlStyle = true;
});
```
Setting it globally affects all the modules in a modular application.
## Removed Retry for the Dynamic HTTP Client Proxies
[Dynamic C# HTTP Client Proxies](../API/Dynamic-CSharp-API-Clients.md) were trying up to 3 times if a request fails using the [Polly](https://github.com/App-vNext/Polly) library. Starting from the version 4.0, this logic has been removed. If you need it, you should configure it in your own application, by configuring the `AbpHttpClientBuilderOptions` in the `PreConfigureServices` method of your module.
**Example: Retry 3 times on failure by incremental waiting between tries**
````csharp
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<AbpHttpClientBuilderOptions>(options =>
{
options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) =>
{
clientBuilder.AddTransientHttpErrorPolicy(
policyBuilder => policyBuilder
.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i)))
);
});
});
}
````
This example uses the Microsoft.Extensions.Http.Polly NuGet package.
If you create a new solution, you can find the same configuration in the `.HttpApi.Client.ConsoleTestApp` project's module class, as an example.
## Creation Audit Properties Made Read-Only
Removed setters from the `IHasCreationTime.CreationTime`, ` IMustHaveCreator.CreatorId` and `IMayHaveCreator.CreatorId` properties to accidently set the creation properties while updating an existing entity.
Since the ABP Framework automatically sets these properties, you normally don't need to directly set them. If you want to set them, as a best practice, it is suggested to make it in the constructor to not provide a way to change it later.
These properties implemented with `protected set` in the `Entity` and `AggregateRoot` base classes. That means you can still set in a derived class, if you need it. Alternatively, you can use reflection to set them (Or use `ObjectHelper.TrySetProperty` which internally uses reflection) out of the class if you have to do.
## Changed type of the IHasExtraProperties.ExtraProperties
`IHasExtraProperties.ExtraProperties` was a regular `Dictionary<string, object>`. With the version 4.0, it is replaced with `ExtraPropertyDictionary` class which inherits the `Dictionary<string, object>`.
Most of the applications don't be affected by this change. If you've directly implemented this interface, replace the standard dictionary the the `ExtraPropertyDictionary`.
## ASP.NET Core MVC / Razor Pages UI
See the [ASP.NET Core MVC / Razor Pages UI Migration Guide](Abp-4_0-MVC-Razor-Pages.md).
## Angular UI
See the [Angular UI Migration Guide](Abp-4_0-Angular.md).
## Blazor UI
- `OpenEditModalAsync` method is requires `EntityDto` instead of id (`Guid`) parameter.
- `DeleteEntityAsync` method doesn't display confirmation dialog anymore. You can use the new `EntityActions` component in DataGrids to show confirmation messages. You can also inject `IUiMessageService` to your page or component and call `ConfirmAsync` explicitly.
See the [Blazor UI Migration Guide](Abp-4_0-Blazor.md).

11
docs/en/Road-Map.md

@ -1,17 +1,12 @@
# ABP Framework Road Map
You can always check the milestone planning and the prioritized backlog issues on [the GitHub repository](https://github.com/abpframework/abp/milestones) for a detailed road map.
While we will **continue to add other exciting features**, we will work on the following major items in the **middle term**:
* **Blazor UI** for the framework and all the pre-built modules (in progress).
* **.NET 5.0**! As Microsoft has announced that the .NET 5.0 will be released in November 2020, we will prepare for this change before and move to the .NET 5.0 just after Microsoft releases it. We hope a smooth transition.
Beside this middle term goals, there are many features in the [backlog](https://github.com/abpframework/abp/milestone/2). Here, a list of some major items in the backlog;
You can always check the milestone planning and the prioritized backlog issues on [the GitHub repository](https://github.com/abpframework/abp/milestones) for a detailed road map. Here, a list of some major items in the backlog;
* [#2882](https://github.com/abpframework/abp/issues/2882) / Providing a gRPC integration infrastructure (while it is [already possible](https://github.com/abpframework/abp-samples/tree/master/GrpcDemo) to create or consume gRPC endpoints for your application, we plan to create endpoints for the [standard application modules](https://docs.abp.io/en/abp/latest/Modules/Index))
* [#236](https://github.com/abpframework/abp/issues/236) Resource based authorization system
* [#6132](https://github.com/abpframework/abp/issues/6132) A New Theme alternative to the Basic Theme
* [#1754](https://github.com/abpframework/abp/issues/1754) / Multi-lingual entities
* [#497](https://github.com/abpframework/abp/issues/497) API Versioning system finalize & document
* [#633](https://github.com/abpframework/abp/issues/633) / Realtime notification system
* [#57](https://github.com/abpframework/abp/issues/57) / Built-in CQRS infrastructure
* [#336](https://github.com/abpframework/abp/issues/336) / Health Check abstraction

4
docs/en/UI/Angular/Component-Replacement.md

@ -547,7 +547,3 @@ The final UI looks like below:
## See Also
- [How to Replace PermissionManagementComponent](./Permission-Management-Component-Replacement.md)
## What's Next?
- [Custom Setting Page](./Custom-Setting-Page.md)

4
docs/en/UI/Angular/Config-State.md

@ -190,7 +190,3 @@ Please refer to `Config.Environment` type for all the properties you can pass to
- [Settings](./Settings.md)
- [Features](./Features.md)
## What's Next?
- [HTTP Requests](./Http-Requests)

5
docs/en/UI/Angular/Confirmation-Service.md

@ -180,8 +180,3 @@ clear(
```
- `status` parameter is the value of the confirmation closing event.
## What's Next?
- [Toast Overlay](./Toaster-Service.md)

5
docs/en/UI/Angular/Content-Projection-Service.md

@ -71,8 +71,3 @@ projectContent<T extends Type<any> | TemplateRef<any>>(
- `projectionStrategy` parameter is the primary focus here and is explained above.
- `injector` parameter is the `Injector` instance you can pass to the projected content. It is not used in `TemplateProjectionStrategy`.
## What's Next?
- [Confirmation Popup](./Confirmation-Service.md)

7
docs/en/UI/Angular/Cross-Origin-Strategy.md

@ -51,10 +51,3 @@ CROSS_ORIGIN_STRATEGY.UseCredentials(integrity?: string)
```
`crossorigin` will be set as `"use-credentials"` and `integrity` is optional.
## What's Next?
- [LoadingStrategy](./Loading-Strategy.md)

4
docs/en/UI/Angular/Dom-Insertion-Service.md

@ -134,7 +134,3 @@ has(content: string): boolean
The `has` method returns a boolean value that indicates the given content has already been added to the DOM or not.
- `content` parameter is the content of the inserted `HTMLScriptElement` or `HTMLStyleElement` element.
## What's Next?
- [Lazy Loading Scripts & Styles](./Lazy-Load-Service.md)

5
docs/en/UI/Angular/Environment.md

@ -101,8 +101,3 @@ export interface RemoteEnv {
* `customMergeFn`: You can also provide your own merge function as shown in the example. It will take two parameters, `localEnv: Partial<Config.Environment>` and `remoteEnv` and it needs to return a `Config.Environment` object.
* `method`: HTTP method to be used when retrieving environment config. Default: `GET`
* `headers`: If extra headers are needed for the request, it can be set through this field.
## What's Next?
- [About Feature Libraries](./Feature-Libraries.md)

6
docs/en/UI/Angular/Feature-Libraries.md

@ -90,9 +90,3 @@ Depending on the library, the `.forLazy` static method may also receive some opt
---
<sup id="f-modify-route"><b>1</b></sup> _Libraries expect to work at a predefined path. Please check [how to patch a navigation element](./Modifying-the-Menu.md#how-to-patch-or-remove-a-navigation-element), if you want to use a different path from the default one (e.g. '/identity')._ <sup>[↩](#a-modify-route)</sup>
---
## What's Next?
- [Service Proxies](./Service-Proxies.md)

4
docs/en/UI/Angular/Features.md

@ -31,7 +31,3 @@ const defaultLang = this.config.getFeature("Identity.TwoFactor");
```
You can then check the value of the feature to perform your logic. Please note that **feature keys are case-sensitive**.
## What's Next?
- [Permission Management](./Permission-Management.md)

140
docs/en/UI/Angular/Form-Validation.md

@ -0,0 +1,140 @@
# Form Validation
Reactive forms in ABP Angular UI are validated by [ngx-validate](https://www.npmjs.com/package/@ngx-validate/core) and helper texts are shown automatically based on validation rules and error blueprints. You do not have to add any elements or components to your templates. The library handles that for you. Here is how the experience is:
<img alt="The ngx-validate library validates an Angular reactive form and an error text appears under each wrong input based on the validation rule and the error blueprint." src="./images/form-validation---error-display-user-experience.gif" width="990px" style="max-width:100%">
## How to Add New Error Messages
You can add a new error message by providing the `VALIDATION_BLUEPRINTS` injection token from your root module.
```js
import { VALIDATION_BLUEPRINTS } from "@ngx-validate/core";
@NgModule({
// rest of the module metadata
providers: [
// other providers
{
provide: VALIDATION_BLUEPRINTS,
useValue: {
uniqueUsername: "::AlreadyExists[{%{{{ username }}}%}]",
},
},
],
})
export class AppModule {}
```
When a [validator](https://angular.io/guide/form-validation#defining-custom-validators) or an [async validator](https://angular.io/guide/form-validation#creating-asynchronous-validators) returns an error with the key given to the error blueprints (`uniqueUsername` here), the validation library will be able to display an error message after localizing according to the given key and interpolation params. The result will look like this:
<img alt="An already taken username is entered while creating new user and a custom error message appears under the input after validation." src="./images/form-validation---new-error-message.gif" width="990px" style="max-width:100%">
In this example;
- Localization key is `::AlreadyExists`.
- The interpolation param is `username`.
- Localization resource is defined as `"AlreadyExists": "Sorry, “{0}” already exists."`.
- And the validator should return `{ uniqueUsername: { username: "admin" } }` as the error object.
## How to Change Existing Error Messages
You can overwrite an existing error message by providing `VALIDATION_BLUEPRINTS` injection token from your root module. Let's imagine you have a custom localization resource for required inputs.
```json
"RequiredInput": "Oops! We need this input."
```
To use this instead of the built-in required input message, all you need to do is the following.
```js
import { VALIDATION_BLUEPRINTS } from "@ngx-validate/core";
@NgModule({
// rest of the module metadata
providers: [
// other providers
{
provide: VALIDATION_BLUEPRINTS,
useValue: {
required: "::RequiredInput",
},
},
],
})
export class AppModule {}
```
The error message will look like this:
<img alt="A required field is cleared and the custom error message appears under the input." src="./images/form-validation---overwrite-error-message.gif" width="990px" style="max-width:100%">
## How to Disable Validation on a Form
If you want to validate a form manually, you can always disable automatic validation on it. All you need to do is place `skipValidation` on the form element.
```html
<form [formGroup]="form" skipValidation>
<!-- form fields here -->
</form>
```
## How to Disable Validation on a Specific Field
Validation works on any element or component with a `formControl` or `formControlName` directive. You can disable automatic validation on a specific field by placing `skipValidation` on the input element or component.
```html
<input type="text" formControlName="name" skipValidation />
```
## How to Use a Custom Error Component
First, build a custom error component. Extending the existing `ValidationErrorComponent` would make it easier.
```js
import { ValidationErrorComponent } from "@abp/ng.theme.basic";
import { ChangeDetectionStrategy, Component } from "@angular/core";
@Component({
selector: "app-validation-error",
template: `
<div
class="font-weight-bold font-italic px-1 invalid-feedback"
*ngFor="let error of abpErrors; trackBy: trackByFn"
>
{%{{{ error.message | abpLocalization: error.interpoliteParams }}}%}
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ErrorComponent extends ValidationErrorComponent {}
```
Then, declare and provide it in your root module.
```js
import { VALIDATION_ERROR_TEMPLATE } from "@ngx-validate/core";
@NgModule({
// rest of the module metadata
declarations: [
// other declarables
ErrorComponent,
],
providers: [
// other providers
{
provide: VALIDATION_ERROR_TEMPLATE,
useValue: ErrorComponent,
},
],
})
export class AppModule {}
```
The error message will be bold and italic now:
<img alt="A required field is cleared and a bold and italic error message appears." src="./images/form-validation---custom-error-template.gif" width="990px" style="max-width:100%">

4
docs/en/UI/Angular/HTTP-Requests.md

@ -203,7 +203,3 @@ getSomeCustomHeaderValue() {
You may find `Rest.Observe` enum [here](https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/core/src/lib/models/rest.ts#L10).
## What's Next?
* [Localization](./Localization.md)

7
docs/en/UI/Angular/Lazy-Load-Service.md

@ -204,10 +204,3 @@ load(strategy: LoadingStrategy, retryTimes?: number, retryDelay?: number): Obser
- `strategy` parameter is the primary focus here and is explained above.
- `retryTimes` defines how many times the loading will be tried again before fail (_default: 2_).
- `retryDelay` defines how much delay there will be between retries (_default: 1000_).
## What's Next?
- [Projecting Angular Content](./Content-Projection-Service.md)

5
docs/en/UI/Angular/List-Service.md

@ -177,8 +177,3 @@ As of v3.0, with ngx-datatable, the `page` property has to be set as `0` for ini
```
**Important Note:** The `abp-table` is not removed, but is deprecated and will be removed in the future. Please consider switching to ngx-datatable.
## What's Next?
- [Easy *ngFor trackBy](./Track-By-Service.md)

8
docs/en/UI/Angular/Localization.md

@ -309,15 +309,13 @@ import { registerLocale } from './register-locale';
]
```
After this custom `registerLocale` function, only en and fr locale files will be created as chunks:
After this custom `registerLocale` function, since the en and fr added to the `webpackInclude`, only en and fr locale files will be created as chunks:
![locale chunks](https://user-images.githubusercontent.com/34455572/98203212-acaa2100-1f44-11eb-85af-4eb66d296326.png)
Which locale files you add to `webpackInclude` magic comment, they will be included in the bundle
## See Also
* [Localization in ASP.NET Core](../../Localization.md)
## What's Next?
* [Settings](./Settings.md)

5
docs/en/UI/Angular/Migration-Guide-v3.md

@ -470,8 +470,3 @@ Some interfaces have long been marked as deprecated and now they are removed.
- Please check if you are still using [anything listed in this issue](https://github.com/abpframework/abp/issues/4281)
## What's Next?
* [Quick Start](./Quick-Start.md)

5
docs/en/UI/Angular/Modifying-the-Menu.md

@ -271,8 +271,3 @@ export class AppComponent {
* Patched the languages dropdown element with new `requiredPolicy` and new `order`.
* Removed the current user dropdown element.
## What's Next
* [Component Replacement](./Component-Replacement.md)

4
docs/en/UI/Angular/Multi-Tenancy.md

@ -126,7 +126,3 @@ The app sends the `__tenant` header that contains the current tenant id on each
## See Also
- [Multi Tenancy in ABP](../../Multi-Tenancy.md)
## What's Next?
- [Managing RxJS Subscriptions](./Subscription-Service.md)

4
docs/en/UI/Angular/PWA-Configuration.md

@ -340,7 +340,3 @@ In case you want to cache other static files, please refer to the [service worke
### 3.2 Set Data Groups
This part is unique to your project. We recommend being very careful about which endpoints to cache. Please refer to [service worker configuration document](https://angular.io/guide/service-worker-config#datagroups) on Angular.io for details.
## What's Next?
- [Config State](./Config-State.md)

6
docs/en/UI/Angular/Permission-Management.md

@ -57,8 +57,4 @@ const routes: Routes = [
];
```
Granted Policies are stored in the `auth` property of `ConfigState`.
## What's Next?
* [Multi Tenancy](./Multi-Tenancy.md)
Granted Policies are stored in the `auth` property of `ConfigState`.

6
docs/en/UI/Angular/Quick-Start.md

@ -204,9 +204,3 @@ In addition, you can [deploy your application to certain targets using the Angul
---
<sup id="f-dist-folder-name"><b>1</b></sup> _The compiled output will be placed under `/dist` in a folder by the project name._ <sup>[↩](#a-dist-folder-name)</sup>
---
## What's Next?
- [Environment Variables](./Environment.md)

4
docs/en/UI/Angular/Service-Proxies.md

@ -137,7 +137,3 @@ export class BookComponent implements OnInit {
```
> Please [see this article](https://github.com/abpframework/abp/blob/dev/docs/en/Blog-Posts/2020-09-07%20Angular-Service-Proxies/POST.md) to learn more about service proxies.
## What's Next?
- [PWA Configuration](./PWA-Configuration.md)

4
docs/en/UI/Angular/Settings.md

@ -53,7 +53,3 @@ const localizationSettings = this.config.getSettings("Localization");
```
Beware though, **settings search is case-sensitive**.
## What's Next?
- [Features](./Features.md)

4
docs/en/UI/Angular/Subscription-Service.md

@ -197,7 +197,3 @@ class DemoComponent implements OnInit {
}
}
```
## What's Next?
- [Working with Lists](./List-Service.md)

4
docs/en/UI/Angular/Toaster-Service.md

@ -249,7 +249,3 @@ Removes all open toasts.
## See Also
- [Confirmation Popup](./Confirmation-Service.md)
## What's Next?
- [Modifying the Menu](./Modifying-the-Menu.md)

6
docs/en/UI/Angular/Track-By-Service.md

@ -111,9 +111,3 @@ class DemoComponent {
trackByTenantAccountId = trackByDeep<Item>('tenant', 'account', 'id');
}
```
## What's Next?
- [Inserting Scripts & Styles to DOM](./Dom-Insertion-Service.md)

BIN
docs/en/UI/Angular/images/form-validation---custom-error-template.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 KiB

BIN
docs/en/UI/Angular/images/form-validation---error-display-user-experience.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 KiB

BIN
docs/en/UI/Angular/images/form-validation---new-error-message.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 KiB

BIN
docs/en/UI/Angular/images/form-validation---overwrite-error-message.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 KiB

4
docs/en/UI/AspNetCore/Overall.md

@ -50,7 +50,7 @@ There are a set of standard JavaScript/CSS libraries that comes pre-installed an
- [FontAwesome](https://fontawesome.com/) as the fundamental CSS font library.
- [SweetAlert](https://sweetalert.js.org/) to show fancy alert message and confirmation dialogs.
- [Toastr](https://github.com/CodeSeven/toastr) to show toast notifications.
- [Lodesh](https://lodash.com/) as a utility library.
- [Lodash](https://lodash.com/) as a utility library.
- [Luxon](https://moment.github.io/luxon/) for date/time operations.
- [JQuery Form](https://github.com/jquery-form/form) for AJAX forms.
- [bootstrap-datepicker](https://github.com/uxsolutions/bootstrap-datepicker) to show date pickers.
@ -156,4 +156,4 @@ ABP Framework provides a lot of built-in solutions to common application require
## Customization
There are a lot of ways to customize the theme and the UIs of the pre-built modules. You can override components, pages, static resources, bundles and more. See the [User Interface Customization Guide](Customization-User-Interface.md).
There are a lot of ways to customize the theme and the UIs of the pre-built modules. You can override components, pages, static resources, bundles and more. See the [User Interface Customization Guide](Customization-User-Interface.md).

4
docs/en/docs-nav.json

@ -636,6 +636,10 @@
"text": "Localization",
"path": "UI/Angular/Localization.md"
},
{
"text": "Form Validation",
"path": "UI/Angular/Form-Validation.md"
},
{
"text": "Settings",
"path": "UI/Angular/Settings.md"

1
docs/zh-Hans/Customizing-Application-Modules-Overriding-Services.md

@ -59,7 +59,6 @@ context.Services.Replace(
### 示例: 重写服务方法
````csharp
//[RemoteService(IsEnabled = false)] // 如果你在使用动态控制器,为了避免为应用服务创建重复的控制器, 你可以禁用远程访问.
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IIdentityUserAppService), typeof(IdentityUserAppService), typeof(MyIdentityUserAppService))]
public class MyIdentityUserAppService : IdentityUserAppService

2
framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj

@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0" />
</ItemGroup>
</Project>

2
framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

4
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj

@ -21,8 +21,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
</ItemGroup>

4
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ExceptionHandling/UserExceptionInformer.cs

@ -31,11 +31,11 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling
if (errorInfo.Details.IsNullOrEmpty())
{
//TODO: Should we introduce MessageService.Error (sync) method instead of such a usage (without await)..?
MessageService.ErrorAsync(errorInfo.Message);
MessageService.Error(errorInfo.Message);
}
else
{
MessageService.ErrorAsync(errorInfo.Details, errorInfo.Message);
MessageService.Error(errorInfo.Details, errorInfo.Message);
}
}

10
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/Messages/SimpleUiMessageService.cs

@ -15,27 +15,27 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.Messages
JsRuntime = jsRuntime;
}
public async Task InfoAsync(string message, string title = null, Action<UiMessageOptions> options = null)
public async Task Info(string message, string title = null, Action<UiMessageOptions> options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task SuccessAsync(string message, string title = null, Action<UiMessageOptions> options = null)
public async Task Success(string message, string title = null, Action<UiMessageOptions> options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task WarnAsync(string message, string title = null, Action<UiMessageOptions> options = null)
public async Task Warn(string message, string title = null, Action<UiMessageOptions> options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task ErrorAsync(string message, string title = null, Action<UiMessageOptions> options = null)
public async Task Error(string message, string title = null, Action<UiMessageOptions> options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task<bool> ConfirmAsync(string message, string title = null, Action<UiMessageOptions> options = null)
public async Task<bool> Confirm(string message, string title = null, Action<UiMessageOptions> options = null)
{
return await JsRuntime.InvokeAsync<bool>("confirm", message);
}

2
framework/src/Volo.Abp.AspNetCore.Components/Volo.Abp.AspNetCore.Components.csproj

@ -21,7 +21,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.0" />
</ItemGroup>
</Project>

10
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/IUiMessageService.cs

@ -5,14 +5,14 @@ namespace Volo.Abp.AspNetCore.Components.Messages
{
public interface IUiMessageService
{
Task InfoAsync(string message, string title = null, Action<UiMessageOptions> options = null);
Task Info(string message, string title = null, Action<UiMessageOptions> options = null);
Task SuccessAsync(string message, string title = null, Action<UiMessageOptions> options = null);
Task Success(string message, string title = null, Action<UiMessageOptions> options = null);
Task WarnAsync(string message, string title = null, Action<UiMessageOptions> options = null);
Task Warn(string message, string title = null, Action<UiMessageOptions> options = null);
Task ErrorAsync(string message, string title = null, Action<UiMessageOptions> options = null);
Task Error(string message, string title = null, Action<UiMessageOptions> options = null);
Task<bool> ConfirmAsync(string message, string title = null, Action<UiMessageOptions> options = null);
Task<bool> Confirm(string message, string title = null, Action<UiMessageOptions> options = null);
}
}

3
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/IUiNotificationService.cs

@ -6,8 +6,11 @@ namespace Volo.Abp.AspNetCore.Components.Notifications
public interface IUiNotificationService
{
Task Info(string message, string title = null, Action<UiNotificationOptions> options = null);
Task Success(string message, string title = null, Action<UiNotificationOptions> options = null);
Task Warn(string message, string title = null, Action<UiNotificationOptions> options = null);
Task Error(string message, string title = null, Action<UiNotificationOptions> options = null);
}
}

15
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/VeeValidate/VeeValidateScriptContributor.cs

@ -0,0 +1,15 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Vue;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.VeeValidate
{
[DependsOn(typeof(VueScriptContributor))]
public class VeeValidateScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.Add("/libs/vee-validate.js/vee-validate.full.js");
}
}
}

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Vue/VueScriptContributor.cs

@ -0,0 +1,12 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Vue
{
public class VueScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.Add("/libs/vue.js/vue.js");
}
}
}

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.csproj

@ -26,7 +26,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

4
framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj

@ -27,8 +27,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.1.1" />
</ItemGroup>

4
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs

@ -1,5 +1,6 @@
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
@ -23,6 +24,9 @@ namespace Volo.Abp.AspNetCore.Mvc.Json
options.JsonSerializerOptions.Converters.Add(ServiceProvider.GetRequiredService<AbpDateTimeConverter>());
options.JsonSerializerOptions.Converters.Add(ServiceProvider.GetRequiredService<AbpNullableDateTimeConverter>());
options.JsonSerializerOptions.Converters.Add(new AbpStringToEnumConverter());
options.JsonSerializerOptions.Converters.Add(new AbpStringToBooleanConverter());
}
}
}

9
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/MvcCoreBuilderExtensions.cs

@ -8,6 +8,7 @@ using Microsoft.Extensions.Options;
using System.Text.Encodings.Web;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.ObjectPool;
using Volo.Abp.Json;
namespace Volo.Abp.AspNetCore.Mvc.Json
{
@ -15,6 +16,14 @@ namespace Volo.Abp.AspNetCore.Mvc.Json
{
public static IMvcCoreBuilder AddAbpHybridJson(this IMvcCoreBuilder builder)
{
var abpJsonOptions = builder.Services.ExecutePreConfiguredActions<AbpJsonOptions>();
if (!abpJsonOptions.UseHybridSerializer)
{
builder.Services.TryAddEnumerable(ServiceDescriptor.Transient<IConfigureOptions<MvcNewtonsoftJsonOptions>, AbpMvcNewtonsoftJsonOptionsSetup>());
builder.AddNewtonsoftJson();
return builder;
}
//SystemTextJsonInputFormatter
builder.Services.AddTransient(provider =>
{

3
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Response/AbpNoContentActionFilter.cs

@ -18,7 +18,8 @@ namespace Volo.Abp.AspNetCore.Mvc.Response
await next();
if (context.HttpContext.Response.StatusCode == (int)HttpStatusCode.OK)
if (context.HttpContext.Response.StatusCode == (int)HttpStatusCode.OK
&& context.Result == null)
{
var returnType = context.ActionDescriptor.GetReturnType();
if (returnType == typeof(Task) || returnType == typeof(void))

2
framework/src/Volo.Abp.AspNetCore.TestBase/Volo.Abp.AspNetCore.TestBase.csproj

@ -24,7 +24,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.0" />
</ItemGroup>
</Project>

2
framework/src/Volo.Abp.Authorization/Volo.Abp.Authorization.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

2
framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj

@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="Autofac.Extras.DynamicProxy" Version="5.0.0" />
<PackageReference Include="Autofac" Version="5.2.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

10
framework/src/Volo.Abp.BlazoriseUI/BlazoriseUiMessageService.cs

@ -30,7 +30,7 @@ namespace Volo.Abp.BlazoriseUI
Logger = NullLogger<BlazoriseUiMessageService>.Instance;
}
public Task InfoAsync(string message, string title = null, Action<UiMessageOptions> options = null)
public Task Info(string message, string title = null, Action<UiMessageOptions> options = null)
{
var uiMessageOptions = CreateDefaultOptions();
options?.Invoke(uiMessageOptions);
@ -40,7 +40,7 @@ namespace Volo.Abp.BlazoriseUI
return Task.CompletedTask;
}
public Task SuccessAsync(string message, string title = null, Action<UiMessageOptions> options = null)
public Task Success(string message, string title = null, Action<UiMessageOptions> options = null)
{
var uiMessageOptions = CreateDefaultOptions();
options?.Invoke(uiMessageOptions);
@ -50,7 +50,7 @@ namespace Volo.Abp.BlazoriseUI
return Task.CompletedTask;
}
public Task WarnAsync(string message, string title = null, Action<UiMessageOptions> options = null)
public Task Warn(string message, string title = null, Action<UiMessageOptions> options = null)
{
var uiMessageOptions = CreateDefaultOptions();
options?.Invoke(uiMessageOptions);
@ -60,7 +60,7 @@ namespace Volo.Abp.BlazoriseUI
return Task.CompletedTask;
}
public Task ErrorAsync(string message, string title = null, Action<UiMessageOptions> options = null)
public Task Error(string message, string title = null, Action<UiMessageOptions> options = null)
{
var uiMessageOptions = CreateDefaultOptions();
options?.Invoke(uiMessageOptions);
@ -70,7 +70,7 @@ namespace Volo.Abp.BlazoriseUI
return Task.CompletedTask;
}
public Task<bool> ConfirmAsync(string message, string title = null, Action<UiMessageOptions> options = null)
public Task<bool> Confirm(string message, string title = null, Action<UiMessageOptions> options = null)
{
var uiMessageOptions = CreateDefaultOptions();
options?.Invoke(uiMessageOptions);

2
framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs

@ -56,7 +56,7 @@ namespace Volo.Abp.BlazoriseUI.Components
{
if (ConfirmationMessage != null)
{
if (await UiMessageService.ConfirmAsync(ConfirmationMessage()))
if (await UiMessageService.Confirm(ConfirmationMessage()))
{
await Clicked.InvokeAsync();
}

6
framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj

@ -12,9 +12,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Blazorise" Version="0.9.2-rc2" />
<PackageReference Include="Blazorise.DataGrid" Version="0.9.2-rc2" />
<PackageReference Include="Blazorise.Snackbar" Version="0.9.2-rc2" />
<PackageReference Include="Blazorise" Version="0.9.2-rc3" />
<PackageReference Include="Blazorise.DataGrid" Version="0.9.2-rc3" />
<PackageReference Include="Blazorise.Snackbar" Version="0.9.2-rc3" />
</ItemGroup>
</Project>

2
framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo.Abp.Caching.StackExchangeRedis.csproj

@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.0" />
</ItemGroup>
</Project>

2
framework/src/Volo.Abp.Caching/Volo.Abp.Caching.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

17
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs

@ -5,6 +5,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System.Threading.Tasks;
using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule;
using Volo.Abp.Cli.ProjectModification;
using Volo.Abp.Cli.Utils;
using Volo.Abp.DependencyInjection;
@ -37,7 +38,10 @@ namespace Volo.Abp.Cli.Commands
}
var newTemplate = commandLineArgs.Options.ContainsKey(Options.NewTemplate.Long);
var newProTemplate = commandLineArgs.Options.ContainsKey(Options.NewProTemplate.Long);
var template = commandLineArgs.Options.GetOrNull(Options.Template.Short, Options.Template.Long);
var newProTemplate = !string.IsNullOrEmpty(template) && template == ModuleProTemplate.TemplateName;
var withSourceCode = newTemplate || newProTemplate || commandLineArgs.Options.ContainsKey(Options.SourceCode.Long);
var addSourceCodeToSolutionFile = withSourceCode && commandLineArgs.Options.ContainsKey("add-to-solution-file");
@ -91,8 +95,8 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore Adds the module to the given solution.");
sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore --skip-db-migrations false Adds the module to the given solution but doesn't create a database migration.");
sb.AppendLine(@" abp add-module Volo.Blogging -s Acme.BookStore -sp ..\Acme.BookStore.Web\Acme.BookStore.Web.csproj Adds the module to the given solution and specify migration startup project.");
sb.AppendLine(@" abp add-module ProductManagement --new-template -sp ..\Acme.BookStore.Web\Acme.BookStore.Web.csproj Crates a new module named `ProductManagement` and adds it to your solution.");
sb.AppendLine(@" abp add-module ProductManagement --new-template --add-to-solution-file -sp ..\Acme.BookStore.Web\Acme.BookStore.Web.csproj Crates a new module named `ProductManagement`, adds it to your solution & solution file.");
sb.AppendLine(@" abp add-module ProductManagement --new -sp ..\Acme.BookStore.Web\Acme.BookStore.Web.csproj Crates a new module named `ProductManagement` and adds it to your solution.");
sb.AppendLine(@" abp add-module ProductManagement --new --add-to-solution-file -sp ..\Acme.BookStore.Web\Acme.BookStore.Web.csproj Crates a new module named `ProductManagement`, adds it to your solution & solution file.");
sb.AppendLine("");
sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI");
@ -176,12 +180,13 @@ namespace Volo.Abp.Cli.Commands
public class NewTemplate
{
public const string Long = "new-template";
public const string Long = "new";
}
public class NewProTemplate
public class Template
{
public const string Long = "new-pro-template";
public const string Short = "t";
public const string Long = "template";
}
}
}

4
framework/src/Volo.Abp.Cli/Volo.Abp.Cli.csproj

@ -18,8 +18,8 @@
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

18
framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj

@ -16,15 +16,15 @@
<ItemGroup>
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Include="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.1.5" />
<PackageReference Include="System.Linq.Queryable" Version="4.3.0" />

2
framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo.Abp.EntityFrameworkCore.SqlServer.csproj

@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0" />
</ItemGroup>
</Project>

2
framework/src/Volo.Abp.EntityFrameworkCore.Sqlite/Volo.Abp.EntityFrameworkCore.Sqlite.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

4
framework/src/Volo.Abp.EntityFrameworkCore/Volo.Abp.EntityFrameworkCore.csproj

@ -20,8 +20,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0" />
</ItemGroup>
</Project>

2
framework/src/Volo.Abp.ExceptionHandling/Volo.Abp.ExceptionHandling.csproj

@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0" />
</ItemGroup>
</Project>

2
framework/src/Volo.Abp.Http.Client.IdentityModel.WebAssembly/Volo.Abp.Http.Client.IdentityModel.WebAssembly.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

17
framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs

@ -97,7 +97,7 @@ namespace Microsoft.Extensions.DependencyInjection
Check.NotNull(type, nameof(type));
Check.NotNullOrWhiteSpace(remoteServiceConfigurationName, nameof(remoteServiceConfigurationName));
AddHttpClientFactoryAndPolicy(services, remoteServiceConfigurationName);
AddHttpClientFactory(services, remoteServiceConfigurationName);
services.Configure<AbpHttpClientOptions>(options =>
{
@ -145,7 +145,7 @@ namespace Microsoft.Extensions.DependencyInjection
return services;
}
private static IServiceCollection AddHttpClientFactoryAndPolicy(
private static IServiceCollection AddHttpClientFactory(
[NotNull] this IServiceCollection services,
[NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName)
{
@ -156,14 +156,23 @@ namespace Microsoft.Extensions.DependencyInjection
return services;
}
var clientBuilder = services.AddHttpClient(remoteServiceConfigurationName);
var clientBuilder = services.AddHttpClient(remoteServiceConfigurationName, (provider, client) =>
{
foreach (var clientBuildAction in preOptions.ProxyClientActions)
{
clientBuildAction(remoteServiceConfigurationName, provider, client);
}
});
foreach (var clientBuildAction in preOptions.ProxyClientBuildActions)
{
clientBuildAction(remoteServiceConfigurationName, clientBuilder);
}
preOptions.ConfiguredProxyClients.Add(remoteServiceConfigurationName);
services.PreConfigure<AbpHttpClientBuilderOptions>(options =>
{
options.ConfiguredProxyClients.Add(remoteServiceConfigurationName);
});
return services;
}

2
framework/src/Volo.Abp.Http.Client/Volo.Abp.Http.Client.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

4
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientBuilderOptions.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using Microsoft.Extensions.DependencyInjection;
namespace Volo.Abp.Http.Client
@ -10,10 +11,13 @@ namespace Volo.Abp.Http.Client
internal HashSet<string> ConfiguredProxyClients { get; }
public List<Action<string, IServiceProvider, HttpClient>> ProxyClientActions { get; }
public AbpHttpClientBuilderOptions()
{
ProxyClientBuildActions = new List<Action<string, IHttpClientBuilder>>();
ConfiguredProxyClients = new HashSet<string>();
ProxyClientActions = new List<Action<string, IServiceProvider, HttpClient>>();
}
}
}

20
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientModule.cs

@ -1,11 +1,9 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Castle;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Threading;
using Volo.Abp.Validation;
using Polly;
using Volo.Abp.ExceptionHandling;
namespace Volo.Abp.Http.Client
@ -20,22 +18,6 @@ namespace Volo.Abp.Http.Client
)]
public class AbpHttpClientModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<AbpHttpClientBuilderOptions>(options =>
{
options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) =>
{
clientBuilder.AddTransientHttpErrorPolicy(policyBuilder =>
policyBuilder.WaitAndRetryAsync(
3,
i => TimeSpan.FromSeconds(Math.Pow(2, i))
)
);
});
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();

2
framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj

@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="IdentityModel" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<ProjectReference Include="..\Volo.Abp.Caching\Volo.Abp.Caching.csproj" />
<ProjectReference Include="..\Volo.Abp.MultiTenancy\Volo.Abp.MultiTenancy.csproj" />
<ProjectReference Include="..\Volo.Abp.Threading\Volo.Abp.Threading.csproj" />

7
framework/src/Volo.Abp.Json/Volo/Abp/Json/AbpJsonModule.cs

@ -19,7 +19,12 @@ namespace Volo.Abp.Json
Configure<AbpJsonOptions>(options =>
{
options.Providers.Add<AbpNewtonsoftJsonSerializerProvider>();
options.Providers.Add<AbpSystemTextJsonSerializerProvider>();
var abpJsonOptions = context.Services.ExecutePreConfiguredActions<AbpJsonOptions>();
if (abpJsonOptions.UseHybridSerializer)
{
options.Providers.Add<AbpSystemTextJsonSerializerProvider>();
}
});
Configure<AbpNewtonsoftJsonSerializerOptions>(options =>

9
framework/src/Volo.Abp.Json/Volo/Abp/Json/AbpJsonOptions.cs

@ -1,4 +1,5 @@
using Volo.Abp.Collections;
using Volo.Abp.Json.SystemTextJson;
namespace Volo.Abp.Json
{
@ -9,11 +10,19 @@ namespace Volo.Abp.Json
/// </summary>
public string DefaultDateTimeFormat { get; set; }
/// <summary>
/// It will try to use System.Json.Text to handle JSON if it can otherwise use Newtonsoft.
/// Affects both AbpJsonModule and AbpAspNetCoreMvcModule.
/// See <see cref="AbpSystemTextJsonUnsupportedTypeMatcher"/>
/// </summary>
public bool UseHybridSerializer { get; set; }
public ITypeList<IJsonSerializerProvider> Providers { get; }
public AbpJsonOptions()
{
Providers = new TypeList<IJsonSerializerProvider>();
UseHybridSerializer = true;
}
}
}

6
framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs

@ -1,10 +1,9 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Json.SystemTextJson.JsonConverters;
namespace Volo.Abp.Json
namespace Volo.Abp.Json.SystemTextJson
{
public class AbpSystemTextJsonSerializerOptionsSetup : IConfigureOptions<AbpSystemTextJsonSerializerOptions>
{
@ -19,6 +18,9 @@ namespace Volo.Abp.Json
{
options.JsonSerializerOptions.Converters.Add(ServiceProvider.GetRequiredService<AbpDateTimeConverter>());
options.JsonSerializerOptions.Converters.Add(ServiceProvider.GetRequiredService<AbpNullableDateTimeConverter>());
options.JsonSerializerOptions.Converters.Add(new AbpStringToEnumConverter());
options.JsonSerializerOptions.Converters.Add(new AbpStringToBooleanConverter());
}
}
}

38
framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToBooleanConverter.cs

@ -0,0 +1,38 @@
using System;
using System.Buffers;
using System.Buffers.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Volo.Abp.Json.SystemTextJson.JsonConverters
{
public class AbpStringToBooleanConverter : JsonConverter<bool>
{
public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.String)
{
var span = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan;
if (Utf8Parser.TryParse(span, out bool b1, out var bytesConsumed) && span.Length == bytesConsumed)
{
return b1;
}
if (bool.TryParse(reader.GetString(), out var b2))
{
return b2;
}
}
return reader.GetBoolean();
}
public override void Write(Utf8JsonWriter writer, bool value, JsonSerializerOptions options)
{
var newOptions = new JsonSerializerOptions(options);
newOptions.Converters.Remove(this);
var entityConverter = (JsonConverter<bool>)newOptions.GetConverter(typeof(bool));
entityConverter.Write(writer, value, newOptions);
}
}
}

41
framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs

@ -0,0 +1,41 @@
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Volo.Abp.Json.SystemTextJson.JsonConverters
{
public class AbpStringToEnumConverter : JsonConverter<object>
{
private readonly JsonStringEnumConverter _innerJsonStringEnumConverter;
public AbpStringToEnumConverter()
: this(namingPolicy: null, allowIntegerValues: true)
{
}
public AbpStringToEnumConverter(JsonNamingPolicy namingPolicy = null, bool allowIntegerValues = true)
{
_innerJsonStringEnumConverter = new JsonStringEnumConverter(namingPolicy, allowIntegerValues);
}
public override bool CanConvert(Type typeToConvert)
{
return typeToConvert.IsEnum;
}
public override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var newOptions = new JsonSerializerOptions(options);
newOptions.Converters.Remove(this);
newOptions.Converters.Add(_innerJsonStringEnumConverter.CreateConverter(typeToConvert, newOptions));
return JsonSerializer.Deserialize(ref reader, typeToConvert, newOptions);
}
public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options)
{
var newOptions = new JsonSerializerOptions(options);
newOptions.Converters.Remove(this);
JsonSerializer.Serialize(writer, value, newOptions);
}
}
}

1
framework/src/Volo.Abp.Swashbuckle/Microsoft/AspNetCore/Builder/AbpSwaggerUIBuilderExtensions.cs

@ -1,7 +1,6 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Swashbuckle.AspNetCore.SwaggerUI;
using Volo.Abp;
using Volo.Abp.Swashbuckle;
namespace Microsoft.AspNetCore.Builder

54
framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace Microsoft.Extensions.DependencyInjection
{
public static class AbpSwaggerGenServiceCollectionExtensions
{
public static IServiceCollection AddAbpSwaggerGenWithOAuth(
this IServiceCollection services,
[NotNull] string authority,
[NotNull] Dictionary<string, string> scopes,
Action<SwaggerGenOptions> setupAction = null)
{
return services.AddSwaggerGen(
options =>
{
options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
{
Type = SecuritySchemeType.OAuth2,
Flows = new OpenApiOAuthFlows
{
AuthorizationCode = new OpenApiOAuthFlow
{
AuthorizationUrl = new Uri($"{authority.EnsureEndsWith('/')}connect/authorize"),
Scopes = scopes,
TokenUrl = new Uri($"{authority.EnsureEndsWith('/')}connect/token")
}
}
});
options.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
new OpenApiSecurityScheme
{
Reference = new OpenApiReference
{
Type = ReferenceType.SecurityScheme,
Id = "oauth2"
}
},
Array.Empty<string>()
}
});
setupAction?.Invoke(options);
});
}
}
}

3
framework/src/Volo.Abp.Swashbuckle/wwwroot/swagger/ui/abp.swagger.js

@ -3,8 +3,7 @@
(function () {
abp.SwaggerUIBundle = function (configObject) {
configObject.requestInterceptor = function (request) {
var token = abp.auth.getToken();
request.headers.Authorization = token ? "Bearer " + token : null;
var antiForgeryToken = abp.security.antiForgery.getToken();
if (antiForgeryToken) {
request.headers[abp.security.antiForgery.tokenHeaderName] = antiForgeryToken;

6
framework/src/Volo.Abp.VirtualFileSystem/Volo.Abp.VirtualFileSystem.csproj

@ -15,9 +15,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Composite" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Composite" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

2
framework/test/SimpleConsoleDemo/SimpleConsoleDemo.csproj

@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

8
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Response/NoContentTestController.cs

@ -47,5 +47,13 @@ namespace Volo.Abp.AspNetCore.Mvc.Response
Response.Redirect("/");
await Task.CompletedTask;
}
[HttpGet]
[Route("TestAsyncMethodWithResultFilter")]
[TestResultFilter]
public async Task TestAsyncMethodWithResultFilter()
{
await Task.CompletedTask;
}
}
}

25
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Response/NoContentTestController_Tests.cs

@ -10,49 +10,50 @@ namespace Volo.Abp.AspNetCore.Mvc.Response
[Fact]
public async Task Should_Set_No_Content_For_Void_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestMethod", HttpStatusCode.NoContent)
;
var result = await GetResponseAsync("/api/NoContent-Test/TestMethod", HttpStatusCode.NoContent);
result.StatusCode.ShouldBe(HttpStatusCode.NoContent);
}
[Fact]
public async Task Should_Not_Set_No_Content_For_Not_Void_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestMethodWithReturn")
;
var result = await GetResponseAsync("/api/NoContent-Test/TestMethodWithReturn");
result.StatusCode.ShouldBe(HttpStatusCode.OK);
}
[Fact]
public async Task Should_Not_Set_No_Content_For_Custom_Http_Status_Code_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestCustomHttpStatusCodeMethod", HttpStatusCode.Redirect)
;
var result = await GetResponseAsync("/api/NoContent-Test/TestCustomHttpStatusCodeMethod", HttpStatusCode.Redirect);
result.StatusCode.ShouldBe(HttpStatusCode.Redirect);
}
[Fact]
public async Task Should_Set_No_Content_For_Task_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethod", HttpStatusCode.NoContent)
;
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethod", HttpStatusCode.NoContent);
result.StatusCode.ShouldBe(HttpStatusCode.NoContent);
}
[Fact]
public async Task Should_Not_Set_No_Content_For_Not_Task_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethodWithReturn")
;
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethodWithReturn");
result.StatusCode.ShouldBe(HttpStatusCode.OK);
}
[Fact]
public async Task Should_Not_Set_No_Content_For_Custom_Http_Status_Code_Async_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncCustomHttpStatusCodeMethod", HttpStatusCode.Redirect)
;
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncCustomHttpStatusCodeMethod", HttpStatusCode.Redirect);
result.StatusCode.ShouldBe(HttpStatusCode.Redirect);
}
[Fact]
public async Task Should_Not_Set_No_Content_For_Custom_Result_Filter_Async_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethodWithResultFilter");
result.StatusCode.ShouldBe(HttpStatusCode.OK);
}
}
}

19
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Response/TestResultFilter.cs

@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Volo.Abp.AspNetCore.Mvc.Response
{
public class TestResultFilter : Attribute, IAsyncActionFilter
{
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
await next();
context.Result = new ObjectResult("TestResultFilter");
}
}
}

2
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
</ItemGroup>

2
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.csproj

@ -15,7 +15,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
</ItemGroup>

2
framework/test/Volo.Abp.BlobStoring.Aliyun.Tests/Volo.Abp.BlobStoring.Aliyun.Tests.csproj

@ -12,7 +12,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.BlobStoring.Aliyun\Volo.Abp.BlobStoring.Aliyun.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<ProjectReference Include="..\Volo.Abp.BlobStoring.Tests\Volo.Abp.BlobStoring.Tests.csproj" />
</ItemGroup>

2
framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo.Abp.VirtualFileSystem.Tests.csproj

@ -16,7 +16,7 @@
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.VirtualFileSystem\Volo.Abp.VirtualFileSystem.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0" />
</ItemGroup>
</Project>

2
global.json

@ -1,6 +1,6 @@
{
"sdk": {
"version": "5.0.100-rc.2.20479.15",
"version": "5.0.100",
"rollForward": "latestFeature"
}
}

2
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj

@ -21,7 +21,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0" />
</ItemGroup>
</Project>

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

Loading…
Cancel
Save