diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
index c190a91470..a292da5f9b 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
@@ -198,6 +198,21 @@
"Language": "Language",
"Optional": "Optional",
"CreateArticleLanguageInfo": "The language in which the post is written",
- "Enum:ContentSource:2": "Video Post"
+ "Enum:ContentSource:2": "Video Post",
+ "VideoPreview": "Video Preview",
+ "VideoPreviewErrorMessage": "Given video url couldn't retrieve from Youtube. This can be caused by either video is private or the given URL is not available.",
+ "DeleteCoverImage": "Delete Cover Image",
+ "DeleteCoverImageConfirmationMessage": "Are you sure you want to delete the cover image for \"{0}\"?",
+ "DeleteCoverImageSuccessMessage": "Cover image successfully deleted",
+ "PaymentsOf": "Payments of",
+ "ShowPaymentsOfOrganization": "Show payments",
+ "Date": "Date",
+ "Products": "Products",
+ "TotalAmount": "Total amount",
+ "Currency": "Currency",
+ "Gateway": "Gateway",
+ "State": "State",
+ "FailReason": "Fail reason"
+
}
}
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/tr.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/tr.json
index 9ac7e39b9e..1884b0025f 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/tr.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/tr.json
@@ -159,6 +159,10 @@
"UnlimitedQuestionCount": "Sınırsız soru sayısı",
"Language": "Dil",
"Optional": "Opsiyonel",
- "CreateArticleLanguageInfo": "Makalenin yazıldığı dil"
+ "CreateArticleLanguageInfo": "Makalenin yazıldığı dil",
+ "Enum:ContentSource:2": "Video İçerik",
+ "DeleteCoverImage": "Kapak Fotoğrafını Sil",
+ "DeleteCoverImageConfirmationMessage": "Kapak fotoğrafını \"{0}\" isimli makale için silmek istediğinize emin misiniz?",
+ "DeleteCoverImageSuccessMessage": "Kapak fotoğrafı başarılı bir şekilde silinmiştir"
}
}
\ No newline at end of file
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json
index 5bf922f012..9c1e434ac1 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json
@@ -132,6 +132,10 @@
"ChooseYourContentType": "Please choose the way you want to add your content.",
"PostContentViaGithub": "I want to add my article with GitHub in accordance with the markdown rules.",
"PostContentViaYoutube": "I want to share my videos available on Youtube here.",
- "PostContentViaExternalSource": "I want to add the content I published on another platform here."
+ "PostContentViaExternalSource": "I want to add the content I published on another platform here.",
+ "GitHubUserNameValidationMessage": "Your Github username can not include whitespace, please be sure your Github username is correct.",
+ "PersonalSiteUrlValidationMessage": "Your personal site URL can not include whitespace, please be sure your personal site URL is correct.",
+ "TwitterUserNameValidationMessage": "Your Twitter username can not include whitespace, please be sure your Twitter username is correct.",
+ "LinkedinUrlValidationMessage": "Your Linkedin URL can not include whitespace, please be sure your Linkedin URL is correct."
}
}
diff --git a/common.props b/common.props
index f5db446396..593fe92213 100644
--- a/common.props
+++ b/common.props
@@ -1,7 +1,7 @@
- latest
- 4.2.0
+ latest
+ 4.3.0$(NoWarn);CS1591;CS0436https://abp.io/assets/abp_nupkg.pnghttps://abp.io/
diff --git a/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/POST.md b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/POST.md
new file mode 100644
index 0000000000..d16afb4244
--- /dev/null
+++ b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/POST.md
@@ -0,0 +1,241 @@
+# ABP Framework 4.2 RC Has Been Published
+
+Today, we have released the [ABP Framework](https://abp.io/) and the [ABP Commercial](https://commercial.abp.io/) 4.2.0 RC (Release Candidate). This blog post introduces the new features and important changes in this new version.
+
+> **The planned release date for the [4.2.0 final](https://github.com/abpframework/abp/milestone/48) version is January 28, 2021**.
+
+## Get Started with the 4.2 RC
+
+If you want to try the version `4.2.0` today, follow the steps below;
+
+1) **Upgrade** the ABP CLI to the version `4.2.0-rc.2` using a command line terminal:
+
+````bash
+dotnet tool update Volo.Abp.Cli -g --version 4.2.0-rc.2
+````
+
+**or install** if you haven't installed before:
+
+````bash
+dotnet tool install Volo.Abp.Cli -g --version 4.2.0-rc.2
+````
+
+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/latest/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**.
+
+## What's new with the ABP Framework 4.2
+
+## IRepository.GetQueryableAsync()
+
+> **This version comes with an important change about using `IQueryable` features over the [repositories](https://docs.abp.io/en/abp/4.2/Repositories). It is suggested to read this section carefully and apply in your applications.**
+
+`IRepository` interface inherits `IQueryable`, so you can directly use the standard LINQ extension methods, like `Where`, `OrderBy`, `First`, `Sum`... etc.
+
+**Example: Using LINQ directly over the repository object**
+
+````csharp
+public class BookAppService : ApplicationService, IBookAppService
+{
+ private readonly IRepository _bookRepository;
+
+ public BookAppService(IRepository bookRepository)
+ {
+ _bookRepository = bookRepository;
+ }
+
+ public async Task DoItInOldWayAsync()
+ {
+ //Apply any standard LINQ extension method
+ var query = _bookRepository
+ .Where(x => x.Price > 10)
+ .OrderBy(x => x.Name);
+
+ //Execute the query asynchronously
+ var books = await AsyncExecuter.ToListAsync(query);
+ }
+}
+````
+
+*See [the documentation](https://docs.abp.io/en/abp/4.2/Repositories#iqueryable-async-operations) if you wonder what is the `AsyncExecuter`.*
+
+Beginning from the version 4.2, the recommended way is using `IRepository.GetQueryableAsync()` to obtain an `IQueryable`, then use the LINQ extension methods over it.
+
+**Example: Using the new GetQueryableAsync method**
+
+````csharp
+public async Task DoItInNewWayAsync()
+{
+ //Use GetQueryableAsync to obtain the IQueryable first
+ var queryable = await _bookRepository.GetQueryableAsync();
+
+ //Then apply any standard LINQ extension method
+ var query = queryable
+ .Where(x => x.Price > 10)
+ .OrderBy(x => x.Name);
+
+ //Finally, execute the query asynchronously
+ var books = await AsyncExecuter.ToListAsync(query);
+}
+````
+
+ABP may start a database transaction when you get an `IQueryable` (If current [Unit Of Work](https://docs.abp.io/en/abp/latest/Unit-Of-Work) is transactional). In this new way, it is possible to **start the database transaction in an asynchronous way**. Previously, we could not get the advantage of asynchronous while starting the transactions.
+
+> **The new way has a significant performance and scalability gain. The old usage (directly using LINQ over the repositories) will be removed in the next major version.** You have a lot of time for the change, but we recommend to immediately take the action since the old usage has a big scalability problem.
+
+#### About IRepository Async Extension Methods
+
+Using IRepository Async Extension Methods has no such a problem. The examples below are pretty fine:
+
+````csharp
+var countAll = await _personRepository
+ .CountAsync();
+
+var count = await _personRepository
+ .CountAsync(x => x.Name.StartsWith("A"));
+
+var book1984 = await _bookRepository
+ .FirstOrDefaultAsync(x => x.Name == "John");
+````
+
+See the [repository documentation](https://docs.abp.io/en/abp/4.2/Repositories#iqueryable-async-operations) to understand the relation between `IQueryable` and asynchronous operations.
+
+### Repository Bulk Operations
+
+This version adds the following methods to the repositories:
+
+* `InsertManyAsync`
+* `UpdateManyAsync`
+* `DeleteManyAsync`
+
+The purpose of these methods to insert, update or delete many entities in one call with a better performance.
+
+Currently, **MongoDB** provider implements these methods as a single bulk operation since MongoDB API natively supports. But current **Entity Framework Core** implementation is not a real bulk operation. Instead, it does its best with the native API of the EF Core. If you want to implement in a more performant way, you can [customize the bulk operations](https://docs.abp.io/en/abp/4.2/Entity-Framework-Core#customize-bulk-operations) with your own implementation or by using a library. We could find a good open source library for EF Core 5.0 to implement it.
+
+### Selecting DBMS on Template Creation
+
+[ABP CLI](https://docs.abp.io/en/abp/4.2/CLI#new) now has an option to specify the DBMS when you use EF Core as the database provider.
+
+**Example: Select MySQL as the DBMS**
+
+````bash
+abp new BookStore -dbms mysql --preview
+````
+
+Available options: `SqlServer` (default), `MySQL`, `SQLite`, `Oracle-Devart`, `PostgreSQL`. See the [documentation](https://docs.abp.io/en/abp/latest/Entity-Framework-Core-Other-DBMS) to use any other DBMS or switch the DBMS later.
+
+One change related to this feature is that: Now, the startup template doesn't come with an **initial migration** file. This is because the database migrations are different based on your DBMS preference and should be re-created. However, when you first run the `.DbMigrator` application, it will create the initial migration and create the database just like before.
+
+> See The Initial Migration section in the [Getting Started](https://docs.abp.io/en/abp/4.2/Getting-Started-Running-Solution?DB=EF#database-migrations) document if you have problems on running the `.DbMigrator` application first time.
+
+### Swagger UI Login / Authorization
+
+Testing the swagger UI was requiring some additional work, especially your authentication server is separated from the application that hosts the Swagger UI.
+
+With the version 4.2, the startup templates come with the authorization pre-configured for you. An Authorize button is available when you open the Swagger UI:
+
+
+
+When you click, it opens a modal to authorize:
+
+
+
+When you click to the Authorize button here, you are redirected to the login page to login with your username and password (default username is `admin` and password is `1q2w3E*`).
+
+> Remember to select the Scopes (typically **select all**) you want to use before clicking to the Authorize button.
+
+### Angular Unit Testing
+
+We've improved the modules and the startup template to setup and write unit tests easier with the Angular UI. See the [Angular Unit Testing document](https://docs.abp.io/en/abp/4.2/UI/Angular/Testing) for details.
+
+### Other News
+
+* Improved HTTP **request-response performance** by resolving dependencies in a deferred way in the action/page filters, interceptors and some other services.
+* Removed `MultipleActiveResultSets` from connection strings for new templates for SQL Server, since the new EF Core gives a warning when using it. If you want to use it, you need to change the connection string yourself.
+* Added `HardDeleteAsync` extension method that takes a predicate to delete multiple entities. This extension method is available if the entity [Soft Delete](https://docs.abp.io/en/abp/latest/Data-Filtering).
+* Implemented the [Page Alerts](https://docs.abp.io/en/abp/4.2/UI/Angular/Page-Alerts) for the **Angular UI**.
+* Implemented [Page Progress](https://docs.abp.io/en/abp/4.2/UI/Blazor/Page-Progress) for the **Blazor UI**. It automatically shows an undetermined progress bar on top of the page while performing an AJAX request. It also proves an API to you if you need to show/hide the progress bar in your code.
+
+## What's new with the ABP Commercial 4.2
+
+### Microservice Startup Template
+
+The new [Microservice Startup Template](https://docs.abp.io/en/commercial/4.2/startup-templates/microservice/index) is a generic solution to start a new microservice solution.
+
+While we accept that every microservice solution will be different and every system has its own design requirements and trade-offs, we believe such a startup solution is a very useful starting point for most of the solutions, and a useful example for others.
+
+
+
+*Figure: A simplified overall diagram of the microservice solution.*
+
+You can [follow the documentation](https://docs.abp.io/en/commercial/4.2/startup-templates/microservice/index) to get started with this startup template. **This template should be considered as an early release**. We will improve it and write a lot of guides.
+
+If you want to use the ABP Suite to create your solution, then you need to first upgrade it:
+
+````bash
+abp suite update
+````
+
+If you want, you can directly create a new solution from the command line:
+
+````bash
+abp new Volosoft.MyMicroserviceSystem -t microservice-pro --preview
+````
+
+Company Name is optional. Solution name could be *MyMicroserviceSystem* for this example.
+
+### Public Website in the Startup Templates
+
+As mentioned in the previous release post, we've added a *Public Website* application to the startup templates. It is configured to authenticate through the IdentityServer with a single sign-on system.
+
+You can use this application to create a landing page for your actual application or a corporate website for your business. An example screenshot:
+
+
+
+It uses the same *Lepton Theme*, so you can apply [all the styles](https://commercial.abp.io/themes). The Public Website has a different layout and also has a different setting for the styling (that can be configured in the *Settings / Lepton Theme* page of the main web application).
+
+> *Public Website* is optional and you need to select the "Public Website" option while creating a new solution using the ABP Suite, or use the `--with-public-website` option while using the `abp new` CLI command.
+
+### Easy CRM Blazor UI
+
+[Easy CRM](https://docs.abp.io/en/commercial/latest/samples/easy-crm) is an example application built with the ABP Commercial. MVC (Razor Pages) and Angular UI implementations were already provided. With the version 4.2, we are providing the Blazor UI implementation for this application.
+
+
+
+### Other News
+
+* Implemented Iyzico as a payment gateway provider for the [payment module](https://commercial.abp.io/modules/Volo.Payment) in addition to Paypal, Stripe, 2Checkout and Payu providers.
+* ABP Suite supports the new microservice template creation, public website and DBMS selection options.
+* Swagger authorization and other features mentioned in the ABP Framework section are already implemented for the ABP Commercial too.
+
+## ABP Community News
+
+### Sharing Video Contents
+
+[community.abp.io](https://community.abp.io/) is a place to share ABP related contents. It started with publishing articles. Now, it supports to publish video contents. [See this example](https://community.abp.io/articles/be-a-superhero-on-day-1-with-abp.io-wvifcy9s). All you need to do is to create a video and upload to YouTube. Then you can [submit](https://community.abp.io/articles/submit) the YouTube link to the ABP Community website.
+
+### Multi-language support
+
+We planned ABP Community to publish English-only contents. However, we see that people want to share contents in other languages too. Now, **it is possible to submit a content in any language**. Just select the Language option while submitting your content.
+
+**When you submit a non-English content, it is not visible to all the visitors by default**. Visitors can see a non-English content only if their browser language or the selected language matches to the content language (there is a language selection at the end of the website).
+
+### External Contents
+
+If you want to publish your content anywhere else, but want to post a link of your content, you can select *External Content* option while submitting the post. For example, [this article](https://community.abp.io/articles/aspnet-boilerplate-to-abp-framework-xml-to-json-localization-conversion-0mxyjrzj) is an external article and also written in Chinese language.
+
+## About the Next Release
+
+The next feature version will be 4.3.0. It is planned to release the 4.3 RC (Release Candidate) on March 11 and the final version on March 25, 2021.
+
+We decided to slow down the feature development for the [next milestone](https://github.com/abpframework/abp/milestone/49). We will continue to improve the existing features and introduce new ones, sure, but wanted to have more time for the planning, documentation, creating guides and improving the development experience.
+
+## Feedback
+
+Please check out the ABP Framework 4.2.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.2.0 final](https://github.com/abpframework/abp/milestone/48) version is January 28, 2021**.
diff --git a/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/easy-crm.png b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/easy-crm.png
new file mode 100644
index 0000000000..02c47777a4
Binary files /dev/null and b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/easy-crm.png differ
diff --git a/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/microservice-template-diagram.png b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/microservice-template-diagram.png
new file mode 100644
index 0000000000..2c6df5ab74
Binary files /dev/null and b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/microservice-template-diagram.png differ
diff --git a/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/public-website.jpg b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/public-website.jpg
new file mode 100644
index 0000000000..b5784519bd
Binary files /dev/null and b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/public-website.jpg differ
diff --git a/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/swagger-authorize-modal.png b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/swagger-authorize-modal.png
new file mode 100644
index 0000000000..52b43f248e
Binary files /dev/null and b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/swagger-authorize-modal.png differ
diff --git a/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/swagger-authorize.png b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/swagger-authorize.png
new file mode 100644
index 0000000000..650a212fe5
Binary files /dev/null and b/docs/en/Blog-Posts/2021-01-14 v4_2_Preview/swagger-authorize.png differ
diff --git a/docs/en/Blog-Posts/2021-01-28 v4_2_Release_Stable/POST.md b/docs/en/Blog-Posts/2021-01-28 v4_2_Release_Stable/POST.md
new file mode 100644
index 0000000000..b5664d8de8
--- /dev/null
+++ b/docs/en/Blog-Posts/2021-01-28 v4_2_Release_Stable/POST.md
@@ -0,0 +1,53 @@
+# ABP.IO Platform 4.2 Final Has Been Released!
+
+[ABP Framework](https://abp.io/) and [ABP Commercial](https://commercial.abp.io/) 4.2 versions have been released today.
+
+## What's New With 4.2?
+
+Since all the new features are already explained in details with the [4.2 RC Announcement Post](https://blog.abp.io/abp/ABP-IO-Platform-v4-2-RC-Has-Been-Released), I will not repeat all the details again. See the [RC Blog Post](https://blog.abp.io/abp/ABP-IO-Platform-v4-2-RC-Has-Been-Released) for all the features and enhancements.
+
+## Creating New Solutions
+
+You can create a new solution with the ABP Framework version 4.2 by either using the `abp new` command or using the **direct download** tab on the [get started page](https://abp.io/get-started).
+
+> See the [getting started document](https://docs.abp.io/en/abp/latest/Getting-Started) for details.
+
+## How to Upgrade an Existing Solution
+
+### Install/Update the ABP CLI
+
+First of all, install the ABP CLI or upgrade to the latest version.
+
+If you haven't installed yet:
+
+```bash
+dotnet tool install -g Volo.Abp.Cli
+```
+
+To update an existing installation:
+
+```bash
+dotnet tool update -g Volo.Abp.Cli
+```
+
+### ABP UPDATE Command
+
+[ABP CLI](https://docs.abp.io/en/abp/latest/CLI) provides a handy command to update all the ABP related NuGet and NPM packages in your solution with a single command:
+
+```bash
+abp update
+```
+
+Run this command in the root folder of your solution.
+
+## Migration Guide
+
+Check [the migration guide](https://docs.abp.io/en/abp/4.2/Migration-Guides/Abp-4_2) for the applications with the version 4.x upgrading to the version 4.2.
+
+> It is strongly recommended to check the migration guide for this version. Especially, the new `IRepository.GetQueryableAsync()` method is a core change should be considered after upgrading the solution.
+
+## About the Next Version
+
+The next feature version will be 4.3. It is planned to release the 4.3 RC (Release Candidate) on March 11 and the final version on March 25, 2021.
+
+We decided to slow down the feature development for the [next milestone](https://github.com/abpframework/abp/milestone/49). We will continue to improve the existing features and introduce new ones, sure, but wanted to have more time for the planning, documentation, creating guides and improving the development experience.
\ No newline at end of file
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/POST.md b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/POST.md
new file mode 100644
index 0000000000..f30f31d541
--- /dev/null
+++ b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/POST.md
@@ -0,0 +1,103 @@
+## Using MatBlazor UI Components With the ABP Framework
+
+Hi, in this step by step article, I will show you how to integrate [MatBlazor](https://www.matblazor.com/), a blazor UI components into ABP Framework-based applications.
+
+
+
+*(A screenshot from the example application developed in this article)*
+
+## Create the Project
+
+> First thing is to create the project. ABP Framework offers startup templates to get into business faster.
+
+In this article, I will create a new startup template with EF Core as a database provider and Blazor for UI framework. But if you already have a project with Blazor UI, you don't need to create a new startup template, you can directly implement the following steps to your existing project.
+
+> If you already have a project with the Blazor UI, you can skip this section.
+
+* Before starting the development, we will create a new solution named `MatBlazorSample` (or whatever you want). We will create a new startup template with EF Core as a database provider and Blazor for UI framework by using [ABP CLI](https://docs.abp.io/en/abp/latest/CLI):
+
+````bash
+abp new MatBlazorSample -u blazor
+````
+
+This will create new project inside of `aspnet-core`, so:
+
+````bash
+cd aspnet-core
+````
+
+and
+
+````bash
+dotnet restore
+````
+
+* Our project boilerplate will be ready after the download is finished. Then, we can open the solution in the Visual Studio (or any other IDE) and run the `MatBlazorSample.DbMigrator` to create the database and seed initial data (which creates the admin user, admin role, permissions etc.)
+
+
+
+* After database and initial data created,
+* Run the `MatBlazorSample.HttpApi.Host` to see our server side working and
+* Run the `MatBlazorSample.Blazor` to see our UI working properly.
+
+> _Default login credentials for admin: username is **admin** and password is **1q2w3E\***_
+
+## Install MatBlazor
+
+You can follow [this documentation](https://www.matblazor.com/) to install MatBlazor packages into your computer.
+
+### Adding MatBlazor NuGet Packages
+
+```bash
+Install-Package MatBlazor
+```
+
+### Register MatBlazor Resources
+
+1. Add the following line to the HEAD section of the `wwwroot/index.html` file within the `MatBlazorSample.Blazor` project:
+
+ ```Razor
+
+
+
+
+
+ ```
+
+2. In the `MatBlazorSampleBlazorModule` class, call the `AddMatBlazor()` method from your project's `ConfigureServices()` method:
+
+ ```csharp
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ var environment = context.Services.GetSingletonInstance();
+ var builder = context.Services.GetSingletonInstance();
+ // ...
+ builder.Services.AddMatBlazor();
+ }
+ ```
+
+3. Register the **MatBlazorSample.Blazor** namespace in the `_Imports.razor` file:
+
+ ```Razor
+ @using MatBlazor
+ ```
+
+## The Sample Application
+
+We have created a sample application with [Table](https://www.matblazor.com/Table) example.
+
+### The Source Code
+
+You can download the source code from [here](https://github.com/abpframework/abp-samples/tree/master/MatBlazorSample).
+
+The related files for this example are marked in the following screenshots.
+
+
+
+
+
+
+
+## Conclusion
+
+In this article, I've explained how to use [MatBlazor](https://www.matblazor.com/) components in your application. ABP Framework is designed so that it can work with any UI library/framework.
\ No newline at end of file
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/example-result.png b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/example-result.png
new file mode 100644
index 0000000000..89a2fecdce
Binary files /dev/null and b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/example-result.png differ
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/initial-project.png b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/initial-project.png
new file mode 100644
index 0000000000..85e71d5692
Binary files /dev/null and b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/initial-project.png differ
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/table-app-contract.png b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/table-app-contract.png
new file mode 100644
index 0000000000..8108cdc606
Binary files /dev/null and b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/table-app-contract.png differ
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/table-application.png b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/table-application.png
new file mode 100644
index 0000000000..7f07af97e1
Binary files /dev/null and b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/table-application.png differ
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/table-web.png b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/table-web.png
new file mode 100644
index 0000000000..0034aec095
Binary files /dev/null and b/docs/en/Community-Articles/2021-01-20-How-to-Integrate-the-MatBlazor-Blazor-Component/table-web.png differ
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/POST.md b/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/POST.md
new file mode 100644
index 0000000000..7a854291d5
--- /dev/null
+++ b/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/POST.md
@@ -0,0 +1,343 @@
+# How to Use PrimeNG Components with the ABP Angular UI
+
+## Introduction
+
+In this article, we will use components of the [PrimeNG](https://www.primefaces.org/primeng/) that is a popular UI component library for Angular with the ABP Framework Angular UI that will be generated via [ABP CLI](https://docs.abp.io/en/abp/latest/CLI).
+
+We will create an organization units page and use PrimeNG's [OrganizationChart](https://primefaces.org/primeng/showcase/#/organizationchart) and [Table](https://primefaces.org/primeng/showcase/#/table) components on the page.
+
+
+
+The UI shown above contains many PrimeNG components. You can reach the source code of this rich UI. Take a look at the source code section below.
+
+> This article does not cover any backend code. I used mock data to provide data source to the components.
+
+## Pre-Requirements
+
+The following tools should be installed on your development machine:
+
+* [.NET Core 5.0+](https://www.microsoft.com/net/download/dotnet-core/)
+* [Node v12 or v14](https://nodejs.org/)
+* [VS Code](https://code.visualstudio.com/) or another IDE
+
+## Source Code
+
+I have prepared a sample project that contains more PrimeNG components than described in this article. You can download the source code [on GitHub](https://github.com/abpframework/abp-samples/tree/master/PrimengSample).
+
+## Creating a New Solution
+
+In this step, we will create a new solution that contains Angular UI and backend startup templates. If you have a startup template with Angular UI, you can skip this step.
+
+Run the following command to install the ABP CLI:
+
+```bash
+dotnet tool install -g Volo.Abp.Cli
+```
+
+...or update:
+
+```bash
+dotnet tool update -g Volo.Abp.Cli
+```
+
+Create a new solution named `AbpPrimengSample` by running the following command:
+
+```bash
+abp new AbpPrimengSample -u angular -csf
+```
+
+See the [ABP CLI documentation](https://docs.abp.io/en/abp/latest/CLI) for all available options.
+
+You can also use the Direct Download tab on the [Get Started](https://abp.io/get-started) page.
+
+## Running the Solution
+
+You can run the solution as described in [here](https://docs.abp.io/en/abp/latest/Getting-Started-Running-Solution?UI=NG&DB=EF&Tiered=No).
+
+## PrimeNG Setup
+
+Open the `angular` folder and run the following command to install packages:
+
+```bash
+npm install
+```
+
+Next, we need to install `primeng` and required packages (`primeicons` and `@angular/cdk`) for the library. Run the command below to install these packages:
+
+```bash
+npm install primeng primeicons @angular/cdk --save
+```
+
+The packages we have installed;
+
+ - `primeng` is the main package that is a component library.
+ - `primeicons` is an icon font library. Many PrimeNG components use this font internally.
+ - `@angular/cdk` is a component dev kit created by the Angular team. Some PrimeNG modules depend on it.
+
+As the last step of the setup, we should add the required style files for the library to `angular.json`:
+
+```js
+//angular.json
+
+"projects": {
+ "AbpPrimengSample": {
+ //...
+ "styles": {
+ "node_modules/primeicons/primeicons.css",
+ "node_modules/primeng/resources/themes/saga-blue/theme.css",
+ "node_modules/primeng/resources/primeng.min.css",
+ //...other styles
+ }
+ }
+}
+```
+
+We have added the `primeng.min.css`, Saga Blue theme's `theme.css`, and `primeicons.css` files to the project. You can choose another theme instead of the Sage Blue. See available themes on the [Get Started](https://www.primefaces.org/primeng/showcase/#/setup) document of the PrimeNG.
+
+
+> You have to restart the running `ng serve` process to see the effect of the changes you made in the `angular.json`.
+
+
+## Creating the Organization Units Page
+
+Run the following command to create a new module named `OrganizationUnits`:
+
+```bash
+npm run ng -- generate module organization-units --route organization-units --module app.module
+```
+
+Then open the `src/route.provider.ts` and add a new route as an array element to add a navigation link labeled "Organization Units" to the menu:
+
+```js
+//route.provider.ts
+
+import { eThemeSharedRouteNames } from '@abp/ng.theme.shared';
+//...
+
+routesService.add([
+ //...
+ {
+ path: '/organization-units',
+ name: 'Organization Units',
+ parentName: eThemeSharedRouteNames.Administration,
+ iconClass: 'fas fa-sitemap',
+ layout: eLayoutType.application,
+ },
+]);
+```
+
+We have created a lazy-loadable module and defined a menu navigation link. We can navigate to the page as shown below:
+
+
+
+## Using the PrimeNG Components
+
+### Implementing the Organization Chart Component
+
+When you would like to use any component from PrimeNG, you have to import the component's module to your module. Since we will use the `OrganizationChart` on the organization units page, we need to import `OrganizationChartModule` into `OrganizationUnitsModule`.
+
+Open the `src/organization-units/organization-units.module.ts` and add the `OrganizationChartModule` to the imports array as shown below:
+
+```js
+import { OrganizationChartModule } from 'primeng/organizationchart';
+//...
+
+@NgModule({
+ //...
+ imports: [
+ //...
+ OrganizationChartModule
+ ],
+})
+export class OrganizationUnitsModule {}
+```
+
+> Since NGCC need to work in some cases, restarting the `ng serve` process would be good when you import any modules from `primeng` package to your module.
+
+Let's define a mock data source for the `OrganizationChartComponent` and add the component to the page.
+
+Open the `src/organization-units/organization-units.component.ts` and add two variables as shown below:
+
+```js
+//...
+import { TreeNode } from 'primeng/api';
+
+@Component(/* component metadata*/)
+export class OrganizationUnitsComponent implements OnInit {
+ //...
+
+ organizationUnits: TreeNode[] = [
+ {
+ label: 'Management',
+ expanded: true,
+ children: [
+ {
+ label: 'Selling',
+ expanded: true,
+ children: [
+ {
+ label: 'Customer Relations',
+ },
+ {
+ label: 'Marketing',
+ },
+ ],
+ },
+ {
+ label: 'Supporting',
+ expanded: true,
+ children: [
+ {
+ label: 'Buying',
+ },
+ {
+ label: 'Human Resources',
+ },
+ ],
+ },
+ ],
+ },
+ ];
+
+ selectedUnit: TreeNode;
+```
+
+- First variable is `organizationUnits`. It provides mock data source to `OrganizationChartComponent`.
+- Second variable is `selectedUnit`. It keeps chosen unit on the chart.
+
+Then, open the `src/organization-units/organization-units.component.html` and replace the file content with the following:
+
+```html
+
+
+
Organization Units
+
+
+
+
+
+```
+
+We have implemented the `OrganizationChart`. The final UI looks like below:
+
+
+
+## Implementing the Table Component
+
+In order to use the `TableComponent`, we have to import the `TableModule` to the `OrganizationUnitsModule`.
+
+Open the `organization-units.module.ts` and add `TableModule` to the imports array as shown below:
+
+```js
+import { TableModule } from 'primeng/table';
+//...
+
+@NgModule({
+ //...
+ imports: [
+ //...
+ TableModule
+ ],
+})
+export class OrganizationUnitsModule {}
+```
+
+Open the `organization-units.component.ts` and add a variable named `members` with initial value and add a getter named `tableData` as shown below:
+
+```js
+//...
+export class OrganizationUnitsComponent implements OnInit {
+ //...
+
+ members = [
+ {
+ fullName: 'John Doe',
+ username: 'John.Doe',
+ phone: '+1-202-555-0125',
+ email: 'john.doe@example.com',
+ parent: 'Customer Relations',
+ },
+ {
+ fullName: 'Darrion Walter',
+ username: 'Darrion.Walter',
+ phone: '+1-262-155-0355',
+ email: 'Darrion_Walter@example.com',
+ parent: 'Marketing',
+ },
+ {
+ fullName: 'Rosa Labadie',
+ username: 'Rosa.Labadie',
+ phone: '+1-262-723-2255',
+ email: 'Rosa.Labadie@example.com',
+ parent: 'Marketing',
+ },
+ {
+ fullName: 'Adelle Hills',
+ username: 'Adelle.Hills',
+ phone: '+1-491-112-9011',
+ email: 'Adelle.Hills@example.com',
+ parent: 'Buying',
+ },
+ {
+ fullName: 'Brian Hane',
+ username: 'Brian.Hane',
+ phone: '+1-772-509-1823',
+ email: 'Brian.Hane@example.com',
+ parent: 'Human Resources',
+ },
+ ];
+
+ get tableData() {
+ return this.members.filter(user => user.parent === this.selectedUnit.label);
+ }
+```
+
+What we have done above?
+
+- We defined a variable named `members` to provide mock data to the table.
+- We have defined a getter named `tableData` to provide filtered data source to the table using `members` variable.
+
+We are now ready to add the table to the HTML template.
+
+Open the `organization-units.component.html`, find the `p-organizationChart` tag and place the following code to the bottom of this tag:
+
+```html
+
+
Members of {{ selectedUnit.label }}
+
+
+
+
+
Name
+
Username
+
Email
+
Phone
+
+
+
+
+
{{ member.fullName }}
+
{{ member.username }}
+
{{ member.email }}
+
{{ member.phone }}
+
+
+
+
+```
+
+We have added a new `div` that contains the `TableComponent`. The table appears when an organization unit is selected.
+The table contains 4 columns which are name, username, email, and phone for displaying the members' information.
+
+After adding the table, the final UI looks like this:
+
+
+
+
+## Conclusion
+
+We have implemented the PrimeNG component library on the ABP Angular UI project and used two components on a page in a short time. You can use any PrimeNG components by following the documentation. The ABP Angular UI will not block you in any case.
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/intro.gif b/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/intro.gif
new file mode 100644
index 0000000000..5f96a65422
Binary files /dev/null and b/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/intro.gif differ
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/organization-chart.jpg b/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/organization-chart.jpg
new file mode 100644
index 0000000000..9d18f35ba1
Binary files /dev/null and b/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/organization-chart.jpg differ
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/organization-units-menu-item.jpg b/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/organization-units-menu-item.jpg
new file mode 100644
index 0000000000..dc6111f553
Binary files /dev/null and b/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/organization-units-menu-item.jpg differ
diff --git a/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/table.gif b/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/table.gif
new file mode 100644
index 0000000000..d27dcb26bd
Binary files /dev/null and b/docs/en/Community-Articles/2021-01-20-How-to-Use-PrimeNG-Components-with-the-ABP-Angular-UI/table.gif differ
diff --git a/docs/en/MongoDB.md b/docs/en/MongoDB.md
index 60b6a94823..a12d216b3d 100644
--- a/docs/en/MongoDB.md
+++ b/docs/en/MongoDB.md
@@ -254,7 +254,7 @@ public async override Task DeleteAsync(
### Access to the MongoDB API
-In most cases, you want to hide MongoDB APIs behind a repository (this is the main purpose of the repository). However, if you want to access the MongoDB API over the repository, you can use `GetDatabaseAsync()` or `GetCollectionAsync()` extension methods. Example:
+In most cases, you want to hide MongoDB APIs behind a repository (this is the main purpose of the repository). However, if you want to access the MongoDB API over the repository, you can use `GetDatabaseAsync()`, `GetCollectionAsync()` or `GetAggregateAsync()` extension methods. Example:
```csharp
public class BookService
@@ -270,6 +270,7 @@ public class BookService
{
IMongoDatabase database = await _bookRepository.GetDatabaseAsync();
IMongoCollection books = await _bookRepository.GetCollectionAsync();
+ IAggregateFluent bookAggregate = await _bookRepository.GetAggregateAsync();
}
}
```
diff --git a/docs/en/UI/Angular/Ellipsis-Directive.md b/docs/en/UI/Angular/Ellipsis-Directive.md
new file mode 100644
index 0000000000..c462331574
--- /dev/null
+++ b/docs/en/UI/Angular/Ellipsis-Directive.md
@@ -0,0 +1,83 @@
+# Ellipsis
+
+Text inside an HTML element can be truncated easily with an ellipsis by using CSS. To make this even easier, you can use the `EllipsisDirective` which has been exposed by the `@abp/ng.theme.shared` package.
+
+
+## Getting Started
+
+In order to use the `EllipsisDirective` in an HTML template, the **`ThemeSharedModule`** should be imported into your module like this:
+
+```js
+// ...
+import { ThemeSharedModule } from '@abp/ng.theme.shared';
+
+@NgModule({
+ //...
+ imports: [..., ThemeSharedModule],
+})
+export class MyFeatureModule {}
+```
+
+or **if you would not like to import** the `ThemeSharedModule`, you can import the **`EllipsisModule`** as shown below:
+
+
+```js
+// ...
+import { EllipsisModule } from '@abp/ng.theme.shared';
+
+@NgModule({
+ //...
+ imports: [..., EllipsisModule],
+})
+export class MyFeatureModule {}
+```
+
+## Usage
+
+The `EllipsisDirective` is very easy to use. The directive's selector is **`abpEllipsis`**. By adding the `abpEllipsis` attribute to an HTML element, you can activate the `EllipsisDirective` for the HTML element.
+
+See an example usage:
+
+```html
+
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laboriosam commodi quae aspernatur,
+ corporis velit et suscipit id consequuntur amet minima expedita cum reiciendis dolorum
+ cupiditate? Voluptas eaque voluptatum odio deleniti quo vel illum nemo accusamus nulla ratione
+ impedit dolorum expedita necessitatibus fugiat ullam beatae, optio eum cupiditate ducimus
+ architecto.
+
+```
+
+The `abpEllipsis` attribute has been added to the `
` element that containing very long text inside to activate the `EllipsisDirective`.
+
+See the result:
+
+
+
+The long text has been truncated by using the directive.
+
+The UI before using the directive looks like this:
+
+
+
+### Specifying Max Width of an HTML Element
+
+An HTML element max width can be specified as shown below:
+
+```html
+
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque, optio!
+
+
+
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque, optio!
+
+
+
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque, optio!
+
+```
+
+See the result:
+
+
\ No newline at end of file
diff --git a/docs/en/UI/Angular/Modal.md b/docs/en/UI/Angular/Modal.md
new file mode 100644
index 0000000000..f1583d4813
--- /dev/null
+++ b/docs/en/UI/Angular/Modal.md
@@ -0,0 +1,248 @@
+# Modal
+
+`ModalComponent` is a pre-built component exposed by `@abp/ng.theme.shared` package to show modals. The component uses the [`ng-bootstrap`](https://ng-bootstrap.github.io/)'s modal service inside to render a modal.
+
+The `abp-modal` provides some additional benefits:
+
+ - It is **flexible**. You can pass header, body, footer templates easily by adding the templates to the `abp-modal` content. It can also be implemented quickly.
+ - Provides several inputs be able to customize the modal and several outputs be able to listen to some events.
+ - Automatically detects the close button which has a `#abpClose` template variable and closes the modal when pressed this button.
+ - Automatically detects the `abp-button` and triggers its loading spinner when the `busy` input value of the modal component is true.
+ - Automatically checks if the form inside the modal **has changed, but not saved**. It warns the user by displaying a [confirmation popup](Confirmation-Service) in this case when a user tries to close the modal or refresh/close the tab of the browser.
+
+
+> Note: A modal can also be rendered by using the `ng-bootstrap` modal. For further information, see [Modal doc](https://ng-bootstrap.github.io/#/components/modal) on the `ng-bootstrap` documentation.
+
+## Getting Started
+
+In order to use the `abp-modal` in an HTML template, the **`ThemeSharedModule`** should be imported into your module like this:
+
+```js
+// ...
+import { ThemeSharedModule } from '@abp/ng.theme.shared';
+
+@NgModule({
+ //...
+ imports: [..., ThemeSharedModule],
+})
+export class MyFeatureModule {}
+```
+
+## Usage
+
+You can add the `abp-modal` to your component very quickly. See an example:
+
+```html
+
+
+
+
+
+
+
Modal Title
+
+
+
+
Modal content
+
+
+
+
+
+
+```
+
+```js
+// sample.component.ts
+
+@Component(/* component metadata */)
+export class SampleComponent {
+ isModelOpen = false
+}
+```
+
+
+
+
+See an example form inside a modal:
+
+```html
+
+
+
+
+
Book
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+```ts
+// book.component.ts
+
+import { Component } from '@angular/core';
+import { FormBuilder, Validators } from '@angular/forms';
+
+@Component(/* component metadata */)
+export class BookComponent {
+ form = this.fb.group({
+ author: [null, [Validators.required]],
+ name: [null, [Validators.required]],
+ price: [null, [Validators.required, Validators.min(0)]],
+ type: [null, [Validators.required]],
+ publishDate: [null, [Validators.required]],
+ });
+
+ inProgress: boolean;
+
+ isModalOpen: boolean;
+
+ constructor(private fb: FormBuilder, private service: BookService) {}
+
+ save() {
+ if (this.form.invalid) return;
+
+ this.inProgress = true;
+
+ this.service.save(this.form.value).subscribe(() => {
+ this.inProgress = false;
+ });
+ }
+}
+```
+
+The modal with form looks like this:
+
+
+
+## API
+
+### Inputs
+
+#### visible
+
+```js
+@Input() visible: boolean
+```
+
+**`visible`** is a boolean input that determines whether the modal is open. It is also can be used two-way binding.
+
+#### busy
+
+```js
+@Input() busy: boolean
+```
+
+**`busy`** is a boolean input that determines whether the busy status of the modal is true. When `busy` is true, the modal cannot be closed and the `abp-button` loading spinner is triggered.
+
+
+#### options
+
+```js
+@Input() options: NgbModalOptions
+```
+
+**`options`** is an input typed [NgbModalOptions](https://ng-bootstrap.github.io/#/components/modal/api#NgbModalOptions). It is configuration for the `ng-bootstrap` modal.
+
+#### suppressUnsavedChangesWarning
+
+```js
+@Input() suppressUnsavedChangesWarning: boolean
+```
+
+**`suppressUnsavedChangesWarning`** is a boolean input that determines whether the confirmation popup triggering active or not. It can also be set globally as shown below:
+
+```ts
+//app.module.ts
+
+// app.module.ts
+
+import { SUPPRESS_UNSAVED_CHANGES_WARNING } from '@abp/ng.theme.shared';
+
+// ...
+
+@NgModule({
+ // ...
+ providers: [{provide: SUPPRESS_UNSAVED_CHANGES_WARNING, useValue: true}]
+})
+export class AppModule {}
+```
+
+Note: The `suppressUnsavedChangesWarning` input of `abp-modal` value overrides the `SUPPRESS_UNSAVED_CHANGES_WARNING` injection token value.
+
+### Outputs
+
+#### visibleChange
+
+```js
+@Output() readonly visibleChange = new EventEmitter();
+```
+
+**`visibleChange`** is an event emitted when the modal visibility has changed. The event payload is a boolean.
+
+#### appear
+
+```js
+ @Output() readonly appear = new EventEmitter();
+```
+
+**`appear`** is an event emitted when the modal has opened.
+
+#### disappear
+
+```js
+ @Output() readonly disappear = new EventEmitter();
+```
+
+**`disappear`** is an event emitted when the modal has closed.
diff --git a/docs/en/UI/Angular/images/ellipsis-directive-before.jpg b/docs/en/UI/Angular/images/ellipsis-directive-before.jpg
new file mode 100644
index 0000000000..dc534d9a97
Binary files /dev/null and b/docs/en/UI/Angular/images/ellipsis-directive-before.jpg differ
diff --git a/docs/en/UI/Angular/images/ellipsis-directive-result1.jpg b/docs/en/UI/Angular/images/ellipsis-directive-result1.jpg
new file mode 100644
index 0000000000..fe693f4c8c
Binary files /dev/null and b/docs/en/UI/Angular/images/ellipsis-directive-result1.jpg differ
diff --git a/docs/en/UI/Angular/images/ellipsis-directive-result2.jpg b/docs/en/UI/Angular/images/ellipsis-directive-result2.jpg
new file mode 100644
index 0000000000..3a416bbc05
Binary files /dev/null and b/docs/en/UI/Angular/images/ellipsis-directive-result2.jpg differ
diff --git a/docs/en/UI/Angular/images/modal-result-1.jpg b/docs/en/UI/Angular/images/modal-result-1.jpg
new file mode 100644
index 0000000000..89dbbc0cb1
Binary files /dev/null and b/docs/en/UI/Angular/images/modal-result-1.jpg differ
diff --git a/docs/en/UI/Angular/images/modal-result-2.jpg b/docs/en/UI/Angular/images/modal-result-2.jpg
new file mode 100644
index 0000000000..e17f2631ab
Binary files /dev/null and b/docs/en/UI/Angular/images/modal-result-2.jpg differ
diff --git a/docs/en/UI/AspNetCore/Bundling-Minification.md b/docs/en/UI/AspNetCore/Bundling-Minification.md
index 9d88a37135..aeaea6c2e6 100644
--- a/docs/en/UI/AspNetCore/Bundling-Minification.md
+++ b/docs/en/UI/AspNetCore/Bundling-Minification.md
@@ -165,7 +165,27 @@ public class MyWebExtensionModule : AbpModule
}
````
-> It's not possible to configure unnamed bundle tag helpers by code, because their name are not known at the development time. It's suggested to always use a name for a bundle tag helper.
+You can also use the `ConfigureAll` method to configure all existing bundles:
+
+````C#
+[DependsOn(typeof(MyWebModule))]
+public class MyWebExtensionModule : AbpModule
+{
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ Configure(options =>
+ {
+ options
+ .ScriptBundles
+ .ConfigureAll(bundle => {
+ bundle.AddFiles(
+ "/scripts/my-extension-script.js"
+ );
+ });
+ });
+ }
+}
+````
## Bundle Contributors
diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json
index 3fff6d67c1..f855338d13 100644
--- a/docs/en/docs-nav.json
+++ b/docs/en/docs-nav.json
@@ -819,6 +819,10 @@
"text": "Projecting Angular Content",
"path": "UI/Angular/Content-Projection-Service.md"
},
+ {
+ "text": "Modal",
+ "path": "UI/Angular/Modal.md"
+ },
{
"text": "Confirmation Popup",
"path": "UI/Angular/Confirmation-Service.md"
@@ -830,6 +834,10 @@
{
"text": "Page Alerts",
"path": "UI/Angular/Page-Alerts.md"
+ },
+ {
+ "text": "Ellipsis",
+ "path": "UI/Angular/Ellipsis-Directive.md"
}
]
},
diff --git a/docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md b/docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md
index db434ab365..81755fbf0d 100644
--- a/docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md
+++ b/docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md
@@ -1767,7 +1767,7 @@ public async Task ChangeTitleAsync(Issue issue, string title)
如前所述,领域驱动设计中的*业务逻辑*分为两部分(各层):领域逻辑和应用逻辑
-
+
领域逻辑是系统的*核心领域规则*组成,而应用逻辑则满足特定的*用例*.
@@ -1783,7 +1783,7 @@ public async Task ChangeTitleAsync(Issue issue, string title)
* 一个**后台管理系统**,UI使用Angular,通过REST API请求数据.内部员工使用这个系统来维护数据(例如,编辑商品说明).
* 一个**移动端应用程序**,它比公开的网站UI上更加简洁.它通过REST API或其它技术(例如,TCP sockets)请求数据.
-
+
每个应用程序都有不同的**需求**,不同的**用例**(应用服务方法),不同的DTO,不同的**验证**和**授权**规则等.
diff --git a/docs/zh-Hans/MongoDB.md b/docs/zh-Hans/MongoDB.md
index 2ceeb1e00c..af63642a41 100644
--- a/docs/zh-Hans/MongoDB.md
+++ b/docs/zh-Hans/MongoDB.md
@@ -211,7 +211,7 @@ public async override Task DeleteAsync(
#### 访问MongoDB API
-大多数情况下,你想要将MongoDB API隐藏在仓储后面(这是仓储的主要目的).如果你想在仓储之上访问MongoDB API,你可以使用`GetDatabase()`或`GetCollection()`方法.例如:
+大多数情况下,你想要将MongoDB API隐藏在仓储后面(这是仓储的主要目的).如果你想在仓储之上访问MongoDB API,你可以使用`GetDatabaseAsync()`, `GetAggregateAsync()` 或`GetCollectionAsync()`方法.例如:
```csharp
public class BookService
@@ -223,10 +223,11 @@ public class BookService
_bookRepository = bookRepository;
}
- public void Foo()
+ public async Task FooAsync()
{
- IMongoDatabase database = _bookRepository.GetDatabase();
- IMongoCollection books = _bookRepository.GetCollection();
+ IMongoDatabase database = await _bookRepository.GetDatabaseAsync();
+ IMongoCollection books = await _bookRepository.GetCollectionAsync();
+ IAggregateFluent bookAggregate = await _bookRepository.GetAggregateAsync();
}
}
```
diff --git a/docs/zh-Hans/UI/AspNetCore/Bundling-Minification.md b/docs/zh-Hans/UI/AspNetCore/Bundling-Minification.md
index 6a229714c1..dd688f256c 100644
--- a/docs/zh-Hans/UI/AspNetCore/Bundling-Minification.md
+++ b/docs/zh-Hans/UI/AspNetCore/Bundling-Minification.md
@@ -167,7 +167,27 @@ public class MyWebExtensionModule : AbpModule
}
````
-> 无法通过代码配置未命名的bundle tag helpers, 因为它们的名称在开发时是未知的. 建议始终使用bundle tag helper的名称.
+你也可以使用 `ConfigureAll` 方法配置所有现有的捆绑包:
+
+````C#
+[DependsOn(typeof(MyWebModule))]
+public class MyWebExtensionModule : AbpModule
+{
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ Configure(options =>
+ {
+ options
+ .ScriptBundles
+ .ConfigureAll(bundle => {
+ bundle.AddFiles(
+ "/scripts/my-extension-script.js"
+ );
+ });
+ });
+ }
+}
+````
### Bundle 贡献者
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleConfigurationCollection.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleConfigurationCollection.cs
index afc4ec6a4a..acb2ae9fac 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleConfigurationCollection.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleConfigurationCollection.cs
@@ -9,11 +9,13 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling
{
private readonly ConcurrentDictionary _bundles;
private readonly ConcurrentDictionary>> _lazyBundleConfigurationActions;
+ private readonly List> _lazyAllBundleConfigurationActions;
public BundleConfigurationCollection()
{
_bundles = new ConcurrentDictionary();
_lazyBundleConfigurationActions = new ConcurrentDictionary>>();
+ _lazyAllBundleConfigurationActions = new List>();
}
///
@@ -90,6 +92,12 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling
}
}
+ lock (_lazyAllBundleConfigurationActions)
+ {
+ _lazyAllBundleConfigurationActions.ForEach(c => c.Invoke(bundle));
+ }
+
+
return bundle;
}
@@ -123,6 +131,29 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling
return this;
}
+ ///
+ /// Configures all bundles.
+ /// This method also works for lazy bundles (those are created using razor tag helpers).
+ ///
+ /// Configure action
+ /// Returns this object for chained calls.
+ public BundleConfigurationCollection ConfigureAll([NotNull] Action configureAction)
+ {
+ Check.NotNull(configureAction, nameof(configureAction));
+
+ foreach (var bundle in _bundles)
+ {
+ configureAction.Invoke(bundle.Value);
+ }
+
+ lock (_lazyAllBundleConfigurationActions)
+ {
+ _lazyAllBundleConfigurationActions.Add(configureAction);
+ }
+
+ return this;
+ }
+
///
/// Gets a bundle.
///
@@ -140,4 +171,4 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling
return bundle;
}
}
-}
\ No newline at end of file
+}
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/RazorPages/AbpPageModel.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/RazorPages/AbpPageModel.cs
index 449747d0cc..a2d02bb3fe 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/RazorPages/AbpPageModel.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/RazorPages/AbpPageModel.cs
@@ -27,6 +27,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.RazorPages
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
+ [Obsolete("Use LazyServiceProvider instead.")]
public IServiceProvider ServiceProvider { get; set; }
protected IClock Clock => LazyServiceProvider.LazyGetRequiredService();
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs
index 52f1d251cb..85822414cf 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs
@@ -25,6 +25,7 @@ namespace Volo.Abp.AspNetCore.Mvc
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
+ [Obsolete("Use LazyServiceProvider instead.")]
public IServiceProvider ServiceProvider { get; set; }
protected IUnitOfWorkManager UnitOfWorkManager => LazyServiceProvider.LazyGetRequiredService();
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs
index 8cbba0fc46..873c532ba3 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Auditing;
-using Volo.Abp.AspNetCore.Mvc.Content;
+using Volo.Abp.AspNetCore.Mvc.ContentFormatters;
using Volo.Abp.AspNetCore.Mvc.Conventions;
using Volo.Abp.AspNetCore.Mvc.ExceptionHandling;
using Volo.Abp.AspNetCore.Mvc.Features;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpViewComponent.cs
index 2ac02b8ac5..215f31b855 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpViewComponent.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpViewComponent.cs
@@ -10,6 +10,7 @@ namespace Volo.Abp.AspNetCore.Mvc
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
+ [Obsolete("Use LazyServiceProvider instead.")]
public IServiceProvider ServiceProvider { get; set; }
protected Type ObjectMapperContext { get; set; }
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs
index 5cd1333f34..135b506e69 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs
@@ -25,17 +25,20 @@ namespace Volo.Abp.AspNetCore.Mvc
{
public ILogger Logger { get; set; }
+ private readonly AspNetCoreApiDescriptionModelProviderOptions _options;
private readonly IApiDescriptionGroupCollectionProvider _descriptionProvider;
- private readonly AbpAspNetCoreMvcOptions _options;
+ private readonly AbpAspNetCoreMvcOptions _abpAspNetCoreMvcOptions;
private readonly AbpApiDescriptionModelOptions _modelOptions;
public AspNetCoreApiDescriptionModelProvider(
+ IOptions options,
IApiDescriptionGroupCollectionProvider descriptionProvider,
- IOptions options,
+ IOptions abpAspNetCoreMvcOptions,
IOptions modelOptions)
{
- _descriptionProvider = descriptionProvider;
_options = options.Value;
+ _descriptionProvider = descriptionProvider;
+ _abpAspNetCoreMvcOptions = abpAspNetCoreMvcOptions.Value;
_modelOptions = modelOptions.Value;
Logger = NullLogger.Instance;
@@ -82,14 +85,14 @@ namespace Volo.Abp.AspNetCore.Mvc
var controllerModel = moduleModel.GetOrAddController(
controllerType.FullName,
- CalculateControllerName(controllerType, setting),
+ _options.ControllerNameGenerator(controllerType, setting),
controllerType,
_modelOptions.IgnoredInterfaces
);
var method = apiDescription.ActionDescriptor.GetMethodInfo();
- var uniqueMethodName = GetUniqueActionName(method);
+ var uniqueMethodName = _options.ActionNameGenerator(method);
if (controllerModel.Actions.ContainsKey(uniqueMethodName))
{
Logger.LogWarning(
@@ -119,44 +122,6 @@ namespace Volo.Abp.AspNetCore.Mvc
AddParameterDescriptionsToModel(actionModel, method, apiDescription);
}
- private static string CalculateControllerName(Type controllerType, ConventionalControllerSetting setting)
- {
- var controllerName = controllerType.Name.RemovePostFix("Controller")
- .RemovePostFix(ApplicationService.CommonPostfixes);
-
- if (setting?.UrlControllerNameNormalizer != null)
- {
- controllerName =
- setting.UrlControllerNameNormalizer(
- new UrlControllerNameNormalizerContext(setting.RootPath, controllerName));
- }
-
- return controllerName;
- }
-
- private static string GetUniqueActionName(MethodInfo method)
- {
- var methodNameBuilder = new StringBuilder(method.Name);
-
- var parameters = method.GetParameters();
- if (parameters.Any())
- {
- methodNameBuilder.Append("By");
-
- for (var i = 0; i < parameters.Length; i++)
- {
- if (i > 0)
- {
- methodNameBuilder.Append("And");
- }
-
- methodNameBuilder.Append(parameters[i].Name.ToPascalCase());
- }
- }
-
- return methodNameBuilder.ToString();
- }
-
private static List GetSupportedVersions(Type controllerType, MethodInfo method,
ConventionalControllerSetting setting)
{
@@ -377,7 +342,7 @@ namespace Volo.Abp.AspNetCore.Mvc
[CanBeNull]
private ConventionalControllerSetting FindSetting(Type controllerType)
{
- foreach (var controllerSetting in _options.ConventionalControllers.ConventionalControllerSettings)
+ foreach (var controllerSetting in _abpAspNetCoreMvcOptions.ConventionalControllers.ConventionalControllerSettings)
{
if (controllerSetting.ControllerTypes.Contains(controllerType))
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProviderOptions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProviderOptions.cs
new file mode 100644
index 0000000000..4cd607e07a
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProviderOptions.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using Volo.Abp.Application.Services;
+using Volo.Abp.AspNetCore.Mvc.Conventions;
+
+namespace Volo.Abp.AspNetCore.Mvc
+{
+ public class AspNetCoreApiDescriptionModelProviderOptions
+ {
+ public Func ControllerNameGenerator { get; set; }
+
+ public Func ActionNameGenerator { get; set; }
+
+ public AspNetCoreApiDescriptionModelProviderOptions()
+ {
+ ControllerNameGenerator = (controllerType, setting) =>
+ {
+ var controllerName = controllerType.Name.RemovePostFix("Controller")
+ .RemovePostFix(ApplicationService.CommonPostfixes);
+
+ if (setting?.UrlControllerNameNormalizer != null)
+ {
+ controllerName =
+ setting.UrlControllerNameNormalizer(
+ new UrlControllerNameNormalizerContext(setting.RootPath, controllerName));
+ }
+
+ return controllerName;
+ };
+
+ ActionNameGenerator = (method) =>
+ {
+ var methodNameBuilder = new StringBuilder(method.Name);
+
+ var parameters = method.GetParameters();
+ if (parameters.Any())
+ {
+ methodNameBuilder.Append("By");
+
+ for (var i = 0; i < parameters.Length; i++)
+ {
+ if (i > 0)
+ {
+ methodNameBuilder.Append("And");
+ }
+
+ methodNameBuilder.Append(parameters[i].Name.ToPascalCase());
+ }
+ }
+
+ return methodNameBuilder.ToString();
+ };
+ }
+ }
+}
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/InternalRemoteStreamContent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/InternalRemoteStreamContent.cs
deleted file mode 100644
index aaaa849f4f..0000000000
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/InternalRemoteStreamContent.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System.IO;
-using Microsoft.AspNetCore.Http;
-using Volo.Abp.Content;
-
-namespace Volo.Abp.AspNetCore.Mvc.Content
-{
- internal class InternalRemoteStreamContent : IRemoteStreamContent
- {
- private readonly HttpContext _httpContext;
-
- public InternalRemoteStreamContent(HttpContext httpContext)
- {
- _httpContext = httpContext;
- }
-
- public string ContentType => _httpContext.Request.ContentType;
-
- public long? ContentLength => _httpContext.Request.ContentLength;
-
- public Stream GetStream()
- {
- return _httpContext.Request.Body;
- }
- }
-}
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/RemoteStreamContentInputFormatter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentInputFormatter.cs
similarity index 70%
rename from framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/RemoteStreamContentInputFormatter.cs
rename to framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentInputFormatter.cs
index a4f5668b7d..ba07e28f77 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/RemoteStreamContentInputFormatter.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentInputFormatter.cs
@@ -1,10 +1,10 @@
using System;
using System.Threading.Tasks;
-using Microsoft.Net.Http.Headers;
using Microsoft.AspNetCore.Mvc.Formatters;
+using Microsoft.Net.Http.Headers;
using Volo.Abp.Content;
-namespace Volo.Abp.AspNetCore.Mvc.Content
+namespace Volo.Abp.AspNetCore.Mvc.ContentFormatters
{
public class RemoteStreamContentInputFormatter : InputFormatter
{
@@ -20,9 +20,10 @@ namespace Volo.Abp.AspNetCore.Mvc.Content
public override Task ReadRequestBodyAsync(InputFormatterContext context)
{
- return InputFormatterResult.SuccessAsync(
- new InternalRemoteStreamContent(context.HttpContext)
- );
+ return InputFormatterResult.SuccessAsync(new RemoteStreamContent(context.HttpContext.Request.Body)
+ {
+ ContentType = context.HttpContext.Request.ContentType
+ });
}
}
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/RemoteStreamContentOutputFormatter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs
similarity index 65%
rename from framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/RemoteStreamContentOutputFormatter.cs
rename to framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs
index 706e514254..685822a4b6 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/RemoteStreamContentOutputFormatter.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs
@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Net.Http.Headers;
using Volo.Abp.Content;
-namespace Volo.Abp.AspNetCore.Mvc.Content
+namespace Volo.Abp.AspNetCore.Mvc.ContentFormatters
{
public class RemoteStreamContentOutputFormatter : OutputFormatter
{
@@ -21,9 +21,16 @@ namespace Volo.Abp.AspNetCore.Mvc.Content
public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context)
{
var remoteStream = (IRemoteStreamContent)context.Object;
- using (var stream = remoteStream.GetStream())
+
+ if (remoteStream != null)
{
- await stream.CopyToAsync(context.HttpContext.Response.Body);
+ context.HttpContext.Response.ContentType = remoteStream.ContentType;
+
+ using (var stream = remoteStream.GetStream())
+ {
+ stream.Position = 0;
+ await stream.CopyToAsync(context.HttpContext.Response.Body);
+ }
}
}
}
diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs
index a9d9316f41..616cbd3706 100644
--- a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs
+++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs
@@ -17,6 +17,7 @@ namespace Volo.Abp.AspNetCore.SignalR
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
+ [Obsolete("Use LazyServiceProvider instead.")]
public IServiceProvider ServiceProvider { get; set; }
protected ILoggerFactory LoggerFactory => LazyServiceProvider.LazyGetService();
diff --git a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs
index 4a4d4df722..99d0f2a4c3 100644
--- a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs
+++ b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs
@@ -269,7 +269,7 @@ namespace Volo.Abp.BlazoriseUI
await GetEntitiesAsync();
- StateHasChanged();
+ await InvokeAsync(StateHasChanged);
}
protected virtual async Task OnDataGridReadAsync(DataGridReadDataEventArgs e)
@@ -282,7 +282,7 @@ namespace Volo.Abp.BlazoriseUI
await GetEntitiesAsync();
- StateHasChanged();
+ await InvokeAsync(StateHasChanged);
}
protected virtual async Task OpenCreateModalAsync()
@@ -295,7 +295,7 @@ namespace Volo.Abp.BlazoriseUI
// Mapper will not notify Blazor that binded values are changed
// so we need to notify it manually by calling StateHasChanged
- await InvokeAsync(() => StateHasChanged());
+ await InvokeAsync(StateHasChanged);
CreateModal.Show();
}
@@ -317,7 +317,7 @@ namespace Volo.Abp.BlazoriseUI
EditingEntityId = entity.Id;
EditingEntity = MapToEditingEntity(entityDto);
- await InvokeAsync(() => StateHasChanged());
+ await InvokeAsync(StateHasChanged);
EditModal.Show();
}
@@ -362,11 +362,8 @@ namespace Volo.Abp.BlazoriseUI
await CheckCreatePolicyAsync();
var createInput = MapToCreateInput(NewEntity);
await AppService.CreateAsync(createInput);
- await GetEntitiesAsync();
await OnCreatedEntityAsync();
-
- CreateModal.Hide();
}
}
@@ -375,9 +372,11 @@ namespace Volo.Abp.BlazoriseUI
return Task.CompletedTask;
}
- protected virtual Task OnCreatedEntityAsync()
+ protected virtual async Task OnCreatedEntityAsync()
{
- return Task.CompletedTask;
+ await GetEntitiesAsync();
+
+ CreateModal.Hide();
}
protected virtual async Task UpdateEntityAsync()
@@ -389,11 +388,8 @@ namespace Volo.Abp.BlazoriseUI
await CheckUpdatePolicyAsync();
var updateInput = MapToUpdateInput(EditingEntity);
await AppService.UpdateAsync(EditingEntityId, updateInput);
- await GetEntitiesAsync();
await OnUpdatedEntityAsync();
-
- EditModal.Hide();
}
}
@@ -402,9 +398,11 @@ namespace Volo.Abp.BlazoriseUI
return Task.CompletedTask;
}
- protected virtual Task OnUpdatedEntityAsync()
+ protected virtual async Task OnUpdatedEntityAsync()
{
- return Task.CompletedTask;
+ await GetEntitiesAsync();
+
+ EditModal.Hide();
}
protected virtual async Task DeleteEntityAsync(TListViewModel entity)
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs
index 9125a0c8ab..f3cb291f56 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs
@@ -22,7 +22,7 @@ namespace Volo.Abp.Cli.Auth
{
var configuration = new IdentityClientConfiguration(
CliUrls.AccountAbpIo,
- "role email abpio abpio_www abpio_commercial offline_access",
+ "role email abpio abpio_www abpio_commercial offline_access",
"abp-cli",
"1q2w3e*",
OidcConstants.GrantTypes.Password,
@@ -43,6 +43,7 @@ namespace Volo.Abp.Cli.Auth
public Task LogoutAsync()
{
FileHelper.DeleteIfExists(CliPaths.AccessToken);
+ FileHelper.DeleteIfExists(CliPaths.Lic);
return Task.CompletedTask;
}
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliPaths.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliPaths.cs
index 2b422446ca..068911ac8c 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliPaths.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliPaths.cs
@@ -1,5 +1,6 @@
using System;
using System.IO;
+using System.Text;
namespace Volo.Abp.Cli
{
@@ -10,7 +11,8 @@ namespace Volo.Abp.Cli
public static string Root => Path.Combine(AbpRootPath, "cli");
public static string AccessToken => Path.Combine(AbpRootPath, "cli", "access-token.bin");
public static string Build => Path.Combine(AbpRootPath, "build");
-
+ public static string Lic => Path.Combine(Path.GetTempPath(), Encoding.ASCII.GetString(new byte[] { 65, 98, 112, 76, 105, 99, 101, 110, 115, 101, 46, 98, 105, 110 }));
+
private static readonly string AbpRootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".abp");
}
-}
+}
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
index 90f0af8b7e..c82c434916 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
@@ -12,6 +12,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.Auth;
+using Volo.Abp.Cli.Commands.Services;
using Volo.Abp.Cli.Http;
using Volo.Abp.Cli.ProjectBuilding;
using Volo.Abp.Cli.ProjectBuilding.Building;
@@ -32,14 +33,17 @@ namespace Volo.Abp.Cli.Commands
protected TemplateProjectBuilder TemplateProjectBuilder { get; }
public ITemplateInfoProvider TemplateInfoProvider { get; }
+ public ConnectionStringProvider ConnectionStringProvider { get; }
public NewCommand(TemplateProjectBuilder templateProjectBuilder
, ITemplateInfoProvider templateInfoProvider,
- EfCoreMigrationManager efCoreMigrationManager)
+ EfCoreMigrationManager efCoreMigrationManager,
+ ConnectionStringProvider connectionStringProvider)
{
_efCoreMigrationManager = efCoreMigrationManager;
TemplateProjectBuilder = templateProjectBuilder;
TemplateInfoProvider = templateInfoProvider;
+ ConnectionStringProvider = connectionStringProvider;
Logger = NullLogger.Instance;
}
@@ -165,7 +169,7 @@ namespace Volo.Abp.Cli.Commands
databaseManagementSystem != DatabaseManagementSystem.NotSpecified &&
databaseManagementSystem != DatabaseManagementSystem.SQLServer)
{
- connectionString = GetNewConnectionStringByDbms(databaseManagementSystem, outputFolder);
+ connectionString = ConnectionStringProvider.GetByDbms(databaseManagementSystem, outputFolder);
}
commandLineArgs.Options.Add(CliConsts.Command, commandLineArgs.Command);
@@ -241,24 +245,6 @@ namespace Volo.Abp.Cli.Commands
}
}
- private string GetNewConnectionStringByDbms(DatabaseManagementSystem databaseManagementSystem, string outputFolder)
- {
- switch (databaseManagementSystem)
- {
- case DatabaseManagementSystem.MySQL:
- return "Server=localhost;Port=3306;Database=MyProjectName;Uid=root;Pwd=myPassword;";
- case DatabaseManagementSystem.PostgreSQL:
- return "User ID=root;Password=myPassword;Host=localhost;Port=5432;Database=MyProjectName;Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;";
- //case DatabaseManagementSystem.Oracle:
- case DatabaseManagementSystem.OracleDevart:
- return "Data Source=MyProjectName;Integrated Security=yes;";
- case DatabaseManagementSystem.SQLite:
- return $"Data Source={Path.Combine(outputFolder , "MyProjectName.db")};".Replace("\\", "\\\\");
- default:
- return null;
- }
- }
-
private void OpenThanksPage(UiFramework uiFramework, DatabaseProvider databaseProvider, bool tiered, bool commercial)
{
uiFramework = uiFramework == UiFramework.NotSpecified || uiFramework == UiFramework.None ? UiFramework.Mvc : uiFramework;
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/ConnectionStringProvider.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/ConnectionStringProvider.cs
new file mode 100644
index 0000000000..32e09b3339
--- /dev/null
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/ConnectionStringProvider.cs
@@ -0,0 +1,30 @@
+using System.IO;
+using Volo.Abp.Cli.ProjectBuilding.Building;
+using Volo.Abp.DependencyInjection;
+
+namespace Volo.Abp.Cli.Commands.Services
+{
+ public class ConnectionStringProvider : ITransientDependency
+ {
+ public string GetByDbms(DatabaseManagementSystem databaseManagementSystem, string outputFolder = "")
+ {
+ switch (databaseManagementSystem)
+ {
+ case DatabaseManagementSystem.NotSpecified:
+ case DatabaseManagementSystem.SQLServer:
+ return "Server=localhost;Database=MyProjectName;Trusted_Connection=True";
+ case DatabaseManagementSystem.MySQL:
+ return "Server=localhost;Port=3306;Database=MyProjectName;Uid=root;Pwd=myPassword;";
+ case DatabaseManagementSystem.PostgreSQL:
+ return "User ID=root;Password=myPassword;Host=localhost;Port=5432;Database=MyProjectName;Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;";
+ //case DatabaseManagementSystem.Oracle:
+ case DatabaseManagementSystem.OracleDevart:
+ return "Data Source=MyProjectName;Integrated Security=yes;";
+ case DatabaseManagementSystem.SQLite:
+ return $"Data Source={Path.Combine(outputFolder , "MyProjectName.db")};".Replace("\\", "\\\\");
+ default:
+ return null;
+ }
+ }
+ }
+}
diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs
index 232afb4280..4ac41663e4 100644
--- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs
+++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs
@@ -35,6 +35,7 @@ namespace Volo.Abp.Application.Services
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
+ [Obsolete("Use LazyServiceProvider instead.")]
public IServiceProvider ServiceProvider { get; set; }
public static string[] CommonPostfixes { get; set; } = { "AppService", "ApplicationService", "Service" };
@@ -51,7 +52,7 @@ namespace Volo.Abp.Application.Services
? provider.GetRequiredService()
: (IObjectMapper) provider.GetRequiredService(typeof(IObjectMapper<>).MakeGenericType(ObjectMapperContext)));
- public IGuidGenerator GuidGenerator => LazyServiceProvider.LazyGetService(SimpleGuidGenerator.Instance);
+ protected IGuidGenerator GuidGenerator => LazyServiceProvider.LazyGetService(SimpleGuidGenerator.Instance);
protected ILoggerFactory LoggerFactory => LazyServiceProvider.LazyGetRequiredService();
diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Services/DomainService.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Services/DomainService.cs
index 751b938f1d..39938b081a 100644
--- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Services/DomainService.cs
+++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Services/DomainService.cs
@@ -13,11 +13,12 @@ namespace Volo.Abp.Domain.Services
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
+ [Obsolete("Use LazyServiceProvider instead.")]
public IServiceProvider ServiceProvider { get; set; }
protected IClock Clock => LazyServiceProvider.LazyGetRequiredService();
- public IGuidGenerator GuidGenerator => LazyServiceProvider.LazyGetService(SimpleGuidGenerator.Instance);
+ protected IGuidGenerator GuidGenerator => LazyServiceProvider.LazyGetService(SimpleGuidGenerator.Instance);
protected ILoggerFactory LoggerFactory => LazyServiceProvider.LazyGetRequiredService();
diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo.Abp.EntityFrameworkCore.PostgreSql.csproj b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo.Abp.EntityFrameworkCore.PostgreSql.csproj
index 8616838cc0..e8c90ccf13 100644
--- a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo.Abp.EntityFrameworkCore.PostgreSql.csproj
+++ b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo.Abp.EntityFrameworkCore.PostgreSql.csproj
@@ -19,7 +19,7 @@
-
+
diff --git a/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs b/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs
index eb8c4eb804..6c0c8ef193 100644
--- a/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs
+++ b/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs
@@ -141,7 +141,7 @@ namespace Volo.Abp.AspNetCore.ExceptionHandling
{
foreach (var key in exception.Data.Keys)
{
- localizedValue = localizedValue.Replace("{" + key + "}", exception.Data[key].ToString());
+ localizedValue = localizedValue.Replace("{" + key + "}", exception.Data[key]?.ToString());
}
}
diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Content/ReferencedRemoteStreamContent.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Content/ReferencedRemoteStreamContent.cs
deleted file mode 100644
index b99cec8a51..0000000000
--- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Content/ReferencedRemoteStreamContent.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System.IO;
-using Volo.Abp.Content;
-
-namespace Volo.Abp.Http.Client.Content
-{
- internal class ReferencedRemoteStreamContent : RemoteStreamContent
- {
- private readonly object[] _references;
-
- public ReferencedRemoteStreamContent(Stream stream, params object[] references)
- : base(stream)
- {
- this._references = references;
- }
- }
-}
diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs
index 7eb4e5ad78..dd4a681ba5 100644
--- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs
+++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs
@@ -14,7 +14,6 @@ using Volo.Abp.Content;
using Volo.Abp.DependencyInjection;
using Volo.Abp.DynamicProxy;
using Volo.Abp.Http.Client.Authentication;
-using Volo.Abp.Http.Client.Content;
using Volo.Abp.Http.Modeling;
using Volo.Abp.Http.ProxyScripting.Generators;
using Volo.Abp.Json;
@@ -112,7 +111,10 @@ namespace Volo.Abp.Http.Client.DynamicProxying
/* returning a class that holds a reference to response
* content just to be sure that GC does not dispose of
* it before we finish doing our work with the stream */
- return (T)((object)new ReferencedRemoteStreamContent(await responseContent.ReadAsStreamAsync(), responseContent));
+ return (T)(object)new RemoteStreamContent(await responseContent.ReadAsStreamAsync())
+ {
+ ContentType = responseContent.Headers.ContentType?.ToString()
+ };
}
var stringContent = await responseContent.ReadAsStringAsync();
diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/UrlBuilder.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/UrlBuilder.cs
index e4b82b21e1..5bee246bd0 100644
--- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/UrlBuilder.cs
+++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/UrlBuilder.cs
@@ -8,7 +8,6 @@ using JetBrains.Annotations;
using Volo.Abp.Http.Modeling;
using Volo.Abp.Http.ProxyScripting.Generators;
using Volo.Abp.Localization;
-using Volo.Abp.Reflection;
namespace Volo.Abp.Http.Client.DynamicProxying
{
@@ -82,9 +81,10 @@ namespace Volo.Abp.Http.Client.DynamicProxying
continue;
}
- AddQueryStringParameter(urlBuilder, isFirstParam, queryStringParameter.Name, value);
-
- isFirstParam = false;
+ if (AddQueryStringParameter(urlBuilder, isFirstParam, queryStringParameter.Name, value))
+ {
+ isFirstParam = false;
+ }
}
if (apiVersion.ShouldSendInQueryString())
@@ -93,28 +93,37 @@ namespace Volo.Abp.Http.Client.DynamicProxying
}
}
- private static void AddQueryStringParameter(
+ private static bool AddQueryStringParameter(
StringBuilder urlBuilder,
bool isFirstParam,
string name,
[NotNull] object value)
{
- urlBuilder.Append(isFirstParam ? "?" : "&");
-
if (value.GetType().IsArray || (value.GetType().IsGenericType && value is IEnumerable))
{
var index = 0;
foreach (var item in (IEnumerable) value)
{
+ if (index == 0)
+ {
+ urlBuilder.Append(isFirstParam ? "?" : "&");
+ }
urlBuilder.Append(name + $"[{index++}]=" + System.Net.WebUtility.UrlEncode(ConvertValueToString(item)) + "&");
}
- //remove & at the end of the urlBuilder.
- urlBuilder.Remove(urlBuilder.Length - 1, 1);
- }
- else
- {
- urlBuilder.Append(name + "=" + System.Net.WebUtility.UrlEncode(ConvertValueToString(value)));
+
+ if (index > 0)
+ {
+ //remove & at the end of the urlBuilder.
+ urlBuilder.Remove(urlBuilder.Length - 1, 1);
+ return true;
+ }
+
+ return false;
}
+
+ urlBuilder.Append(isFirstParam ? "?" : "&");
+ urlBuilder.Append(name + "=" + System.Net.WebUtility.UrlEncode(ConvertValueToString(value)));
+ return true;
}
private static string ConvertValueToString([NotNull] object value)
diff --git a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs
index 8ae81a2a26..bb7e2d66a3 100644
--- a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs
+++ b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs
@@ -86,7 +86,7 @@ namespace Volo.Abp.Kafka
}
catch (CreateTopicsException e)
{
- if (!e.Error.Reason.Contains($"Topic '{TopicName}' already exists"))
+ if(e.Results.First().Error.Code != ErrorCode.TopicAlreadyExists)
{
throw;
}
diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs
index 960222679f..12e5987777 100644
--- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs
+++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs
@@ -24,6 +24,8 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
IMongoQueryable GetMongoQueryable();
Task> GetMongoQueryableAsync(CancellationToken cancellationToken = default);
+
+ Task> GetAggregateAsync(CancellationToken cancellationToken = default);
}
public interface IMongoDbRepository : IMongoDbRepository, IRepository
diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs
index b252c48999..6894dc90a2 100644
--- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs
+++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs
@@ -16,6 +16,7 @@ using Volo.Abp.EventBus.Distributed;
using Volo.Abp.EventBus.Local;
using Volo.Abp.Guids;
using Volo.Abp.MongoDB;
+using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Domain.Repositories.MongoDB
{
@@ -314,16 +315,26 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
}
public override async Task DeleteManyAsync(
- IEnumerable entities,
- bool autoSave = false,
- CancellationToken cancellationToken = default)
+ IEnumerable entities,
+ bool autoSave = false,
+ CancellationToken cancellationToken = default)
{
- var entityArray = entities.ToArray();
+ var softDeletedEntities = new List();
+ var hardDeletedEntities = new List();
- foreach (var entity in entityArray)
+ foreach (var entity in entities)
{
await ApplyAbpConceptsForDeletedEntityAsync(entity);
SetNewConcurrencyStamp(entity);
+
+ if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)) && !IsHardDeleted(entity))
+ {
+ softDeletedEntities.Add(entity);
+ }
+ else
+ {
+ hardDeletedEntities.Add(entity);
+ }
}
var dbContext = await GetDbContextAsync(GetCancellationToken(cancellationToken));
@@ -331,54 +342,57 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
if (BulkOperationProvider != null)
{
- await BulkOperationProvider.DeleteManyAsync(this, entityArray, dbContext.SessionHandle, autoSave, cancellationToken);
+ await BulkOperationProvider.DeleteManyAsync(this, entities.ToArray(), dbContext.SessionHandle, autoSave, cancellationToken);
return;
}
- var entitiesCount = entityArray.Count();
-
- if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)))
+ if (softDeletedEntities.Count > 0)
{
UpdateResult updateResult;
+ var softDeleteEntitiesCount = softDeletedEntities.Count;
+
if (dbContext.SessionHandle != null)
{
updateResult = await collection.UpdateManyAsync(
dbContext.SessionHandle,
- CreateEntitiesFilter(entityArray),
+ CreateEntitiesFilter(softDeletedEntities),
Builders.Update.Set(x => ((ISoftDelete)x).IsDeleted, true)
);
}
else
{
updateResult = await collection.UpdateManyAsync(
- CreateEntitiesFilter(entityArray),
+ CreateEntitiesFilter(softDeletedEntities),
Builders.Update.Set(x => ((ISoftDelete)x).IsDeleted, true)
);
}
- if (updateResult.MatchedCount < entitiesCount)
+ if (updateResult.MatchedCount < softDeleteEntitiesCount)
{
ThrowOptimisticConcurrencyException();
}
}
- else
+
+ if (hardDeletedEntities.Count > 0)
{
DeleteResult deleteResult;
+ var hardDeletedEntitiesCount = hardDeletedEntities.Count;
+
if (dbContext.SessionHandle != null)
{
deleteResult = await collection.DeleteManyAsync(
dbContext.SessionHandle,
- CreateEntitiesFilter(entityArray)
+ CreateEntitiesFilter(hardDeletedEntities)
);
}
else
{
deleteResult = await collection.DeleteManyAsync(
- CreateEntitiesFilter(entityArray)
+ CreateEntitiesFilter(hardDeletedEntities)
);
}
- if (deleteResult.DeletedCount < entitiesCount)
+ if (deleteResult.DeletedCount < hardDeletedEntitiesCount)
{
ThrowOptimisticConcurrencyException();
}
@@ -473,6 +487,17 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
);
}
+ public async Task> GetAggregateAsync(CancellationToken cancellationToken = default)
+ {
+ var dbContext = await GetDbContextAsync(cancellationToken);
+ var collection = await GetCollectionAsync(cancellationToken);
+
+ return ApplyDataFilters(
+ dbContext.SessionHandle != null
+ ? collection.Aggregate(dbContext.SessionHandle)
+ : collection.Aggregate());
+ }
+
protected virtual bool IsHardDeleted(TEntity entity)
{
var hardDeletedEntities = UnitOfWorkManager?.Current?.Items.GetOrDefault(UnitOfWorkItemNames.HardDeletedEntities) as HashSet;
@@ -621,6 +646,22 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
throw new AbpDbConcurrencyException("Database operation expected to affect 1 row but actually affected 0 row. Data may have been modified or deleted since entities were loaded. This exception has been thrown on optimistic concurrency check.");
}
+ protected virtual IAggregateFluent ApplyDataFilters(IAggregateFluent aggregate)
+ {
+ if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)) && DataFilter.IsEnabled())
+ {
+ aggregate = aggregate.Match(e => ((ISoftDelete)e).IsDeleted == false);
+ }
+
+ if (typeof(IMultiTenant).IsAssignableFrom(typeof(TEntity)) && DataFilter.IsEnabled())
+ {
+ var tenantId = CurrentTenant.Id;
+ aggregate = aggregate.Match(e => ((IMultiTenant)e).TenantId == tenantId);
+ }
+
+ return aggregate;
+ }
+
[Obsolete("This method will be removed in future versions.")]
public QueryableExecutionModel GetExecutionModel()
{
diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs
index 90605f416e..bcbdc00d9e 100644
--- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs
+++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading;
using System.Threading.Tasks;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
@@ -16,10 +17,10 @@ namespace Volo.Abp.Domain.Repositories
return repository.ToMongoDbRepository().Database;
}
- public static Task GetDatabaseAsync(this IBasicRepository repository)
+ public static Task GetDatabaseAsync(this IBasicRepository repository, CancellationToken cancellationToken = default)
where TEntity : class, IEntity
{
- return repository.ToMongoDbRepository().GetDatabaseAsync();
+ return repository.ToMongoDbRepository().GetDatabaseAsync(cancellationToken);
}
[Obsolete("Use GetCollectionAsync method.")]
@@ -29,10 +30,10 @@ namespace Volo.Abp.Domain.Repositories
return repository.ToMongoDbRepository().Collection;
}
- public static Task> GetCollectionAsync(this IBasicRepository repository)
+ public static Task> GetCollectionAsync(this IBasicRepository repository, CancellationToken cancellationToken = default)
where TEntity : class, IEntity
{
- return repository.ToMongoDbRepository().GetCollectionAsync();
+ return repository.ToMongoDbRepository().GetCollectionAsync(cancellationToken);
}
[Obsolete("Use GetMongoQueryableAsync method.")]
@@ -42,10 +43,16 @@ namespace Volo.Abp.Domain.Repositories
return repository.ToMongoDbRepository().GetMongoQueryable();
}
- public static Task> GetMongoQueryableAsync(this IBasicRepository repository)
+ public static Task> GetMongoQueryableAsync(this IBasicRepository repository, CancellationToken cancellationToken = default)
where TEntity : class, IEntity
{
- return repository.ToMongoDbRepository().GetMongoQueryableAsync();
+ return repository.ToMongoDbRepository().GetMongoQueryableAsync(cancellationToken);
+ }
+
+ public static Task> GetAggregateAsync(this IBasicRepository repository, CancellationToken cancellationToken = default)
+ where TEntity : class, IEntity
+ {
+ return repository.ToMongoDbRepository().GetAggregateAsync(cancellationToken);
}
public static IMongoDbRepository ToMongoDbRepository(this IBasicRepository repository)
diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationHelper.cs b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationHelper.cs
index d46281d2e9..9f6cec23e5 100644
--- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationHelper.cs
+++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationHelper.cs
@@ -4,7 +4,9 @@ namespace Volo.Abp.Validation
{
public class ValidationHelper
{
- private const string EmailRegEx = @"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?";
+ // Taken from W3C as an alternative to the RFC5322 specification: https://html.spec.whatwg.org/#valid-e-mail-address
+ // The RFC5322 regex can be found here: https://emailregex.com/
+ public static string EmailRegEx { get; set; } = @"^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$";
public static bool IsValidEmailAddress(string email)
{
@@ -13,7 +15,6 @@ namespace Volo.Abp.Validation
return false;
}
- /*RFC 2822 (simplified)*/
return Regex.IsMatch(email, EmailRegEx, RegexOptions.Compiled | RegexOptions.IgnoreCase);
}
}
diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController.cs
new file mode 100644
index 0000000000..15491f9b21
--- /dev/null
+++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController.cs
@@ -0,0 +1,36 @@
+using System.IO;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Shouldly;
+using Volo.Abp.Content;
+
+namespace Volo.Abp.AspNetCore.Mvc.ContentFormatters
+{
+ [Route("api/remote-stream-content-test")]
+ public class RemoteStreamContentTestController : AbpController
+ {
+ [HttpGet]
+ [Route("Download")]
+ public async Task DownloadAsync()
+ {
+ var memoryStream = new MemoryStream();
+ await memoryStream.WriteAsync(Encoding.UTF8.GetBytes("DownloadAsync"));
+
+ return new RemoteStreamContent(memoryStream)
+ {
+ ContentType = "application/rtf"
+ };
+ }
+
+ [HttpPost]
+ [Route("Upload")]
+ public async Task UploadAsync([FromBody]IRemoteStreamContent streamContent)
+ {
+ using (var reader = new StreamReader(streamContent.GetStream()))
+ {
+ return await reader.ReadToEndAsync() + ":" + streamContent.ContentType;
+ }
+ }
+ }
+}
diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController_Tests.cs
new file mode 100644
index 0000000000..3d49a5b3ff
--- /dev/null
+++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController_Tests.cs
@@ -0,0 +1,37 @@
+using System.IO;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+using Shouldly;
+using Xunit;
+
+namespace Volo.Abp.AspNetCore.Mvc.ContentFormatters
+{
+ public class RemoteStreamContentTestController_Tests : AspNetCoreMvcTestBase
+ {
+ [Fact]
+ public async Task DownloadAsync()
+ {
+ var result = await GetResponseAsync("/api/remote-stream-content-test/download");
+ result.Content.Headers.ContentType?.ToString().ShouldBe("application/rtf");
+ (await result.Content.ReadAsStringAsync()).ShouldBe("DownloadAsync");
+ }
+
+ [Fact]
+ public async Task UploadAsync()
+ {
+ using (var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/api/remote-stream-content-test/upload"))
+ {
+ var memoryStream = new MemoryStream();
+ await memoryStream.WriteAsync(Encoding.UTF8.GetBytes("UploadAsync"));
+ memoryStream.Position = 0;
+ requestMessage.Content = new StreamContent(memoryStream);
+ requestMessage.Content.Headers.Add("Content-Type", "application/rtf");
+
+ var response = await Client.SendAsync(requestMessage);
+
+ (await response.Content.ReadAsStringAsync()).ShouldBe("UploadAsync:application/rtf");
+ }
+ }
+ }
+}
diff --git a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs
index e53e3cabbf..c2fc5ea4b3 100644
--- a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs
+++ b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
+using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using NSubstitute.Extensions;
using Shouldly;
using Volo.Abp.Application.Dtos;
+using Volo.Abp.Content;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Http.Client;
using Volo.Abp.TestApp.Application;
@@ -168,5 +171,31 @@ namespace Volo.Abp.Http.DynamicProxying
result.Inner1.Value2.ShouldBe("value two");
result.Inner1.Inner2.Value3.ShouldBe("value three");
}
+
+ [Fact]
+ public async Task DownloadAsync()
+ {
+ var result = await _peopleAppService.DownloadAsync();
+
+ result.ContentType.ShouldBe("application/rtf");
+ using (var reader = new StreamReader(result.GetStream()))
+ {
+ var str = await reader.ReadToEndAsync();
+ str.ShouldBe("DownloadAsync");
+ }
+ }
+
+ [Fact]
+ public async Task UploadAsync()
+ {
+ var memoryStream = new MemoryStream();
+ await memoryStream.WriteAsync(Encoding.UTF8.GetBytes("UploadAsync"));
+ memoryStream.Position = 0;
+ var result = await _peopleAppService.UploadAsync(new RemoteStreamContent(memoryStream)
+ {
+ ContentType = "application/rtf"
+ });
+ result.ShouldBe("UploadAsync:application/rtf");
+ }
}
}
diff --git a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs
index da61333d4e..e18c2f8f4a 100644
--- a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs
+++ b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
@@ -140,5 +141,13 @@ namespace Volo.Abp.Http.DynamicProxying
[FromQuery]
public DateTime FirstReleaseDate { get; set; }
+
+ [FromQuery]
+ public List Colors { get; set; }
+
+ public Car()
+ {
+ Colors = new List();
+ }
}
}
diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleAppService.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleAppService.cs
index a34cd19ebb..2344cb7c9b 100644
--- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleAppService.cs
+++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleAppService.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
+using Volo.Abp.Content;
using Volo.Abp.TestApp.Application.Dto;
namespace Volo.Abp.TestApp.Application
@@ -20,5 +21,9 @@ namespace Volo.Abp.TestApp.Application
Task GetWithAuthorized();
Task GetWithComplexType(GetWithComplexTypeInput input);
+
+ Task DownloadAsync();
+
+ Task UploadAsync(IRemoteStreamContent streamContent);
}
}
diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs
index cff72c7869..788304900d 100644
--- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs
+++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs
@@ -1,12 +1,15 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
+using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Dtos;
using Volo.Abp.TestApp.Domain;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Application.Services;
+using Volo.Abp.Content;
using Volo.Abp.TestApp.Application.Dto;
namespace Volo.Abp.TestApp.Application
@@ -64,5 +67,24 @@ namespace Volo.Abp.TestApp.Application
{
return Task.FromResult(input);
}
+
+ public async Task DownloadAsync()
+ {
+ var memoryStream = new MemoryStream();
+ await memoryStream.WriteAsync(Encoding.UTF8.GetBytes("DownloadAsync"));
+
+ return new RemoteStreamContent(memoryStream)
+ {
+ ContentType = "application/rtf"
+ };
+ }
+
+ public async Task UploadAsync(IRemoteStreamContent streamContent)
+ {
+ using (var reader = new StreamReader(streamContent.GetStream()))
+ {
+ return await reader.ReadToEndAsync() + ":" + streamContent.ContentType;
+ }
+ }
}
}
diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/HardDelete_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/HardDelete_Tests.cs
index 3d9b324da8..e31b64f6e4 100644
--- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/HardDelete_Tests.cs
+++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/HardDelete_Tests.cs
@@ -1,7 +1,9 @@
using Shouldly;
using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Data;
+using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Modularity;
using Volo.Abp.TestApp.Domain;
@@ -119,5 +121,40 @@ namespace Volo.Abp.TestApp.Testing
john.ShouldBeNull();
}
}
+
+ [Fact]
+ public async Task Should_HardDelete_WithDeleteMany()
+ {
+ var persons = await PersonRepository.GetListAsync();
+
+ await WithUnitOfWorkAsync(async () =>
+ {
+ var hardDeleteEntities = (HashSet)UnitOfWorkManager.Current.Items.GetOrAdd(
+ UnitOfWorkItemNames.HardDeletedEntities,
+ () => new HashSet()
+ );
+ hardDeleteEntities.UnionWith(persons);
+ await PersonRepository.DeleteManyAsync(persons);
+ });
+
+ var personsCount = await PersonRepository.GetCountAsync();
+
+ personsCount.ShouldBe(0);
+ }
+
+ [Fact]
+ public async Task Should_HardDelete_WithDeleteMany_WithPredicate()
+ {
+ await WithUnitOfWorkAsync(async () =>
+ {
+ await PersonRepository.HardDeleteAsync(x => x.Id == TestDataBuilder.UserDouglasId);
+
+ await PersonRepository.DeleteManyAsync(new[] { TestDataBuilder.UserDouglasId });
+ });
+
+ var douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId);
+
+ douglas.ShouldBeNull();
+ }
}
}
diff --git a/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs b/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs
index de9067e2f7..cd602c07af 100644
--- a/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs
+++ b/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs
@@ -180,15 +180,19 @@ namespace Volo.Abp.Validation
{
//Valid
ValidationHelper.IsValidEmailAddress("john.doe@domain.com").ShouldBe(true);
+ ValidationHelper.IsValidEmailAddress("john-doe1@domain.co").ShouldBe(true);
ValidationHelper.IsValidEmailAddress("ip@1.2.3.123").ShouldBe(true);
ValidationHelper.IsValidEmailAddress("pharaoh@egyptian.museum").ShouldBe(true);
ValidationHelper.IsValidEmailAddress("john.doe+regexbuddy@gmail.com").ShouldBe(true);
ValidationHelper.IsValidEmailAddress("Mike.O'Dell@ireland.com").ShouldBe(true);
+ ValidationHelper.IsValidEmailAddress("admin@localhost").ShouldBe(true);
+ ValidationHelper.IsValidEmailAddress("j@h.c").ShouldBe(true);
//Invalid
- ValidationHelper.IsValidEmailAddress("1024x768@60Hz").ShouldBe(false);
ValidationHelper.IsValidEmailAddress("not.a.valid.email").ShouldBe(false);
ValidationHelper.IsValidEmailAddress("john@aol...com").ShouldBe(false);
+ ValidationHelper.IsValidEmailAddress("john@aol@domain.com").ShouldBe(false);
+ ValidationHelper.IsValidEmailAddress("jack@domain.").ShouldBe(false);
}
[DependsOn(typeof(AbpAutofacModule))]
diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json
index 755cd5674b..459d115398 100644
--- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json
+++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json
@@ -60,6 +60,8 @@
"Volo.Account:InvalidEmailAddress": "Can not find the given email address: {0}",
"PasswordReset": "Password reset",
"PasswordResetInfoInEmail": "We received an account recovery request! If you initiated this request, click the following link to reset your password.",
- "ResetMyPassword": "Reset my password"
+ "ResetMyPassword": "Reset my password",
+ "AccessDenied": "Access denied!",
+ "AccessDeniedMessage": "You do not have access to this resource."
}
}
diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json
index d8cf5dd74f..a1c899357b 100644
--- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json
+++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json
@@ -60,6 +60,8 @@
"Volo.Account:InvalidEmailAddress": "Email adresi bulunamadı: {0}",
"PasswordReset": "Şifre Sıfırlama",
"PasswordResetInfoInEmail": "Şifrenizi sıfırlamanız için bir talep aldık! Eğer bu talebi siz gerçekleştirmişseniz, şifrenizi sıfırlamak için bağlantıya tıklayın.",
- "ResetMyPassword": "Şifremi sıfırla"
+ "ResetMyPassword": "Şifremi sıfırla",
+ "AccessDenied": "Erişim reddedildi!",
+ "AccessDeniedMessage": "Bu kaynağa erişiminiz yok."
}
}
diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json
index 53fe6135f2..26c6fc3337 100644
--- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json
+++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json
@@ -60,6 +60,8 @@
"Volo.Account:InvalidEmailAddress": "找不到给定的电子邮件地址:{0}",
"PasswordReset": "重设密码",
"PasswordResetInfoInEmail": "我们收到了帐户恢复请求!如果你发起了此请求,请单击以下链接以重置密码.",
- "ResetMyPassword": "重置我的密码"
+ "ResetMyPassword": "重置我的密码",
+ "AccessDenied": "拒绝访问!",
+ "AccessDeniedMessage": "你无权访问此资源."
}
}
diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hant.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hant.json
index a67ea8d63f..8a57429344 100644
--- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hant.json
+++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hant.json
@@ -58,6 +58,8 @@
"ReturnToApplication": "返回到應用程序",
"PasswordReset": "重設密碼",
"PasswordResetInfoInEmail": "我們收到了帳戶恢復請求!如果你發起了此請求,請單擊以下鏈接以重置密碼.",
- "ResetMyPassword": "重置我的密碼"
+ "ResetMyPassword": "重置我的密碼",
+ "AccessDenied": "拒絕訪問!",
+ "AccessDeniedMessage": "您無權訪問此資源."
}
}
diff --git a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLoginModel.cs b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLoginModel.cs
index 3d7381d2c3..4dab1f9761 100644
--- a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLoginModel.cs
+++ b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLoginModel.cs
@@ -103,9 +103,9 @@ namespace Volo.Abp.Account.Web.Pages.Account
public override async Task OnPostAsync(string action)
{
+ var context = await Interaction.GetAuthorizationContextAsync(ReturnUrl);
if (action == "Cancel")
{
- var context = await Interaction.GetAuthorizationContextAsync(ReturnUrl);
if (context == null)
{
return Redirect("~/");
@@ -142,7 +142,8 @@ namespace Volo.Abp.Account.Web.Pages.Account
{
Identity = IdentitySecurityLogIdentityConsts.Identity,
Action = result.ToIdentitySecurityLogAction(),
- UserName = LoginInput.UserNameOrEmailAddress
+ UserName = LoginInput.UserNameOrEmailAddress,
+ ClientId = context?.Client?.ClientId
});
if (result.RequiresTwoFactor)
diff --git a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs
index 26ee0d4c34..94860e80c1 100644
--- a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs
+++ b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs
@@ -20,12 +20,6 @@ namespace Volo.Abp.Account.Web.Pages.Account
public async override Task OnGetAsync()
{
- await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext()
- {
- Identity = IdentitySecurityLogIdentityConsts.Identity,
- Action = IdentitySecurityLogActionConsts.Logout
- });
-
await SignInManager.SignOutAsync();
var logoutId = Request.Query["logoutId"].ToString();
@@ -33,11 +27,14 @@ namespace Volo.Abp.Account.Web.Pages.Account
if (!string.IsNullOrEmpty(logoutId))
{
var logoutContext = await Interaction.GetLogoutContextAsync(logoutId);
+
+ await SaveSecurityLogAsync(logoutContext?.ClientId);
+
await SignInManager.SignOutAsync();
HttpContext.User = new ClaimsPrincipal(new ClaimsIdentity());
- LoggedOutModel vm = new LoggedOutModel()
+ var vm = new LoggedOutModel()
{
PostLogoutRedirectUri = logoutContext?.PostLogoutRedirectUri,
ClientName = logoutContext?.ClientName,
@@ -49,6 +46,8 @@ namespace Volo.Abp.Account.Web.Pages.Account
return RedirectToPage("./LoggedOut", vm);
}
+ await SaveSecurityLogAsync();
+
if (ReturnUrl != null)
{
return LocalRedirect(ReturnUrl);
@@ -58,5 +57,18 @@ namespace Volo.Abp.Account.Web.Pages.Account
$"IdentityServerSupportedLogoutModel couldn't find postLogoutUri... Redirecting to:/Account/Login..");
return RedirectToPage("/Account/Login");
}
+
+ protected virtual async Task SaveSecurityLogAsync(string clientId = null)
+ {
+ if (CurrentUser.IsAuthenticated)
+ {
+ await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext()
+ {
+ Identity = IdentitySecurityLogIdentityConsts.Identity,
+ Action = IdentitySecurityLogActionConsts.Logout,
+ ClientId = clientId
+ });
+ }
+ }
}
}
diff --git a/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs b/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs
index 303963d24f..4a806b9ae2 100644
--- a/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs
+++ b/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs
@@ -8,6 +8,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Toolbars;
using Volo.Abp.AutoMapper;
+using Volo.Abp.ExceptionHandling;
using Volo.Abp.Identity.AspNetCore;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
@@ -19,7 +20,8 @@ namespace Volo.Abp.Account.Web
typeof(AbpAccountHttpApiModule),
typeof(AbpIdentityAspNetCoreModule),
typeof(AbpAutoMapperModule),
- typeof(AbpAspNetCoreMvcUiThemeSharedModule)
+ typeof(AbpAspNetCoreMvcUiThemeSharedModule),
+ typeof(AbpExceptionHandlingModule)
)]
public class AbpAccountWebModule : AbpModule
{
diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccessDenied.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccessDenied.cshtml
new file mode 100644
index 0000000000..28608ff883
--- /dev/null
+++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccessDenied.cshtml
@@ -0,0 +1,15 @@
+@page
+@model Volo.Abp.Account.Web.Pages.Account.AccessDeniedModel
+@using Microsoft.AspNetCore.Mvc.Localization
+@using Volo.Abp.Account.Localization
+@inject IHtmlLocalizer L
+
+