diff --git a/.gitignore b/.gitignore
index 407241c7fc..3c5c4f89da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -269,6 +269,7 @@ modules/blog/app/Volo.BlogTestApp/Logs/*.*
modules/blogging/app/Volo.BloggingTestApp/Logs/*.*
modules/blogging/app/Volo.BloggingTestApp/wwwroot/files/*.*
modules/docs/app/VoloDocs.Web/Logs/*.*
+modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/Logs/*.*
templates/module/app/MyCompanyName.MyProjectName.DemoApp/Logs/*.*
templates/mvc/src/MyCompanyName.MyProjectName.Web/Logs/*.*
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
index fad5ba7f3b..c02e6e13de 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
@@ -199,6 +199,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/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
index c6eb1ad645..4de287778f 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
@@ -34,6 +34,13 @@
"JoinOurMarketingNewsletter": "Join our marketing newsletter",
"WouldLikeToReceiveMarketingMaterials": "I would like to receive marketing materials like product deals & special offers.",
"StartUsingYourLicenseNow": "Start using your license now!",
- "WelcomePage": "Welcome Page"
+ "WelcomePage": "Welcome Page",
+ "UnsubscriptionExpireEmail": "Unsubscribe from license expire date reminder emails",
+ "UnsubscribeLicenseExpireEmailReminderMessage": "This email subscription only contains reminding your license expiration date.",
+ "UnsubscribeFromLicenseExpireEmails": "If you don't want to receive the emails about your license expiration date, you can unsubscribe at any time you want.",
+ "Unsubscribe": "Unsubscribe",
+ "NotOrganizationMember": "You are not member of any organization.",
+ "UnsubscribeLicenseExpirationEmailSuccessTitle": "Successfully unsubscribed",
+ "UnsubscribeLicenseExpirationEmailSuccessMessage": "You will not receive license expiration date reminder emails anymore."
}
}
\ 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 268e4c8b1d..593fe92213 100644
--- a/common.props
+++ b/common.props
@@ -1,7 +1,7 @@
- latest
- 4.2.1
+ 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..fac8484411
--- /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/latest/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/Caching.md b/docs/en/Caching.md
index 042f13ffe0..7dbf02d875 100644
--- a/docs/en/Caching.md
+++ b/docs/en/Caching.md
@@ -242,12 +242,15 @@ In addition, all of the `IDistributedCache` (and `IDistributedCache<
## Batch Operations
-ABP's distributed cache interfaces provide methods to perform batch get/set methods those improves the performance when you want to get or set multiple cache items in a single method call.
+ABP's distributed cache interfaces provide methods to perform batch methods those improves the performance when you want to batch operation multiple cache items in a single method call.
* `SetManyAsync` and `SetMany` methods can be used to set multiple values to the cache.
* `GetManyAsync` and `GetMany` methods can be used to retrieve multiple values from the cache.
+* `GetOrAddManyAsync` and `GetOrAddMany` methods can be used to retrieve multiple values and set missing values from the cache
+* `RefreshManyAsync` and `RefreshMany` methods can be used to resets the sliding expiration timeout of multiple values from the cache
+* `RemoveManyAsync` and `RemoveMany` methods can be used to remove multiple values from the cache
-> These are not standard methods of the ASP.NET Core caching. So, some providers may not support them. They are supported by the [ABP Redis Cache integration package](Redis-Cache.md). If the provider doesn't support, it fallbacks to `SetAsync` and `GetAsync` methods (called once for each item).
+> These are not standard methods of the ASP.NET Core caching. So, some providers may not support them. They are supported by the [ABP Redis Cache integration package](Redis-Cache.md). If the provider doesn't support, it fallbacks to `SetAsync` and `GetAsync` ... methods (called once for each item).
## Advanced Topics
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/Startup-Templates/Module.md b/docs/en/Startup-Templates/Module.md
index 2dc0896c65..84b7525944 100644
--- a/docs/en/Startup-Templates/Module.md
+++ b/docs/en/Startup-Templates/Module.md
@@ -1,4 +1,4 @@
-# MVC Module Startup Template
+# Module Startup Template
This template can be used to create a **reusable [application module](../Modules/Index.md)** based on the [module development best practices & conventions](../Best-Practices/Index.md). It is also suitable for creating **microservices** (with or without UI).
@@ -20,6 +20,20 @@ abp new Acme.IssueManagement -t module
- `Acme.IssueManagement` is the solution name, like *YourCompany.YourProduct*. You can use single level, two-levels or three-levels naming.
+### Specify the UI Framework
+
+This template provides multiple UI frameworks:
+
+* `mvc`: ASP.NET Core MVC UI with Razor Pages (default)
+* `blazor`: Blazor UI
+* `angular`: Angular UI
+
+Use `-u` or `--ui` option to specify the UI framework:
+
+````bash
+abp new Acme.IssueManagement -t module -u angular
+````
+
### Without User Interface
The template comes with an MVC UI by default. You can use `--no-ui` option to not include the UI layer.
@@ -160,3 +174,91 @@ You should run the application with the given order:
- First, run the `.IdentityServer` since other applications depends on it.
- Then run the `.HttpApi.Host` since it is used by the `.Web.Host` application.
- Finally, you can run the `.Web.Host` project and login to the application using `admin` as the username and `1q2w3E*` as the password.
+
+## UI
+
+### Angular UI
+
+If you choose `Angular` as the UI framework (using the `-u angular` option), the solution will have a folder called `angular` in it. This is where the client-side code is located. When you open that folder in an IDE, the folder structure will look like below:
+
+
+
+* _angular/projects/issue-management_ folder contains the Angular module project.
+* _angular/projects/dev-app_ folder contains a development application that runs your module.
+
+The server-side is similar to the solution described above. `*.HttpApi.Host` project serves the API and the `Angular` demo application consumes it. You will not need to run the `.Web.Host` project though.
+
+#### How to Run the Angular Development App
+
+For module development, you will need the `dev-app` project up and running. So, here is how we can start the development server.
+
+First, we need to install dependencies:
+
+1. Open your terminal at the root folder, i.e. `angular`.
+2. Run `yarn` or `npm install`.
+
+The dependencies will be installed and some of them are ABP modules published as NPM packages. To see all ABP packages, you can run the following command in the `angular` folder:
+
+```bash
+yarn list --pattern abp
+```
+
+> There is no equivalent of this command in npm.
+
+The module you will develop depends on two of these ABP packages: _@abp/ng.core_ and _@abp/ng.theme.shared_. Rest of the ABP modules are included in _package.json_ because of the `dev-app` project.
+
+Once all dependencies are installed, follow the steps below to serve your development app:
+
+1. Make sure `.IdentityServer` and `*.HttpApi.Host` projects are up and running.
+2. Open your terminal at the root folder, i.e. `angular`.
+3. Run `yarn start` or `npm start`.
+
+
+
+The issue management page is empty in the beginning. You may change the content in `IssueManagementComponent` at the _angular/projects/issue-management/src/lib/issue-management.component.ts_ path and observe that the view changes accordingly.
+
+Now, let's have a closer look at some key elements of your project.
+
+#### Main Module
+
+`IssueManagementModule` at the _angular/projects/issue-management/src/lib/issue-management.module.ts_ path is the main module of your module project. There are a few things worth mentioning in it:
+
+- Essential ABP modules, i.e. `CoreModule` and `ThemeSharedModule`, are imported.
+- `IssueManagementRoutingModule` is imported.
+- `IssueManagementComponent` is declared.
+- It is prepared for configurability. The `forLazy` static method enables [a configuration to be passed to the module when it is loaded by the router](https://volosoft.com/blog/how-to-configure-angular-modules-loaded-by-the-router).
+
+
+#### Main Routing Module
+
+`IssueManagementRoutingModule` at the _angular/projects/issue-management/src/lib/issue-management-routing.module.ts_ path is the main routing module of your module project. It currently does two things:
+
+- Loads `DynamicLayoutComponent` at base path it is given.
+- Loads `IssueManagementComponent` as child to the layout, again at the given base path.
+
+You can rearrange this module to load more than one component at different routes, but you need to update the route provider at _angular/projects/issue-management/config/src/providers/route.provider.ts_ to match the new routing structure with the routes in the menu. Please check [Modifying the Menu](../UI/Angular/Modifying-the-Menu.md) to see how route providers work.
+
+#### Config Module
+
+There is a config module at the _angular/projects/issue-management/config/src/issue-management-config.module.ts_ path. The static `forRoot` method of this module is supposed to be called at the route level. So, you may assume the following will take place:
+
+```js
+@NgModule({
+ imports: [
+ /* other imports */
+
+ IssueManagementConfigModule.forRoot(),
+ ],
+
+ /* rest of the module meta data */
+})
+export class AppModule {}
+```
+
+You can use this static method to configure an application that uses your module project. An example of such configuration is already implemented and the `ISSUE_MANAGEMENT_ROUTE_PROVIDERS` token is provided here. The method can take options which enables further configuration possibilities.
+
+The difference between the `forRoot` method of the config module and the `forLazy` method of the main module is that, for smallest bundle size, the former should only be used when you have to configure an app before your module is even loaded.
+
+#### Testing Angular UI
+
+Please see the [testing document](../UI/Angular/Testing.md).
diff --git a/docs/en/Tutorials/Part-1.md b/docs/en/Tutorials/Part-1.md
index 3348679420..4667b8e539 100644
--- a/docs/en/Tutorials/Part-1.md
+++ b/docs/en/Tutorials/Part-1.md
@@ -189,6 +189,8 @@ Add-Migration "Created_Book_Entity"

+> If you get an error like "*Your startup project ... doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work*", right click to the `Acme.BookStore.EntityFrameworkCore.DbMigrations` project and **Set as the Startup Project** and try again.
+
This will create a new migration class inside the `Migrations` folder of the `Acme.BookStore.EntityFrameworkCore.DbMigrations` project.
Before updating the database, read the section below to learn how to seed some initial data to the database.
diff --git a/docs/en/Tutorials/Part-7.md b/docs/en/Tutorials/Part-7.md
index ec3ad9a8e0..e14237fd59 100644
--- a/docs/en/Tutorials/Part-7.md
+++ b/docs/en/Tutorials/Part-7.md
@@ -70,7 +70,7 @@ This is just like done for the `Book` entity before, so no need to explain again
## Create a new Database Migration
-Open the **Package Manager Console** on Visual Studio and ensure that the **Default project** is `Acme.BookStore.EntityFrameworkCore.DbMigrations` in the Package Manager Console, as shown on the picture below. Also, set the `Acme.BookStore.Web` (or `Acme.BookStore.HttpApi.Host`, depending on your solution) as the **startup project** (right click it on the solution explorer and click to "Set as Startup Project").
+Open the **Package Manager Console** on Visual Studio and ensure that the **Default project** is `Acme.BookStore.EntityFrameworkCore.DbMigrations` in the Package Manager Console, as shown on the picture below. Also, set this project as the **startup project** (right click it on the solution explorer and click to "Set as Startup Project").
Run the following command to create a new database migration:
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/Router-Events.md b/docs/en/UI/Angular/Router-Events.md
new file mode 100644
index 0000000000..011d405b22
--- /dev/null
+++ b/docs/en/UI/Angular/Router-Events.md
@@ -0,0 +1,146 @@
+# Router Events Simplified
+
+`RouterEvents` is a utility service to provide an easy implementation for one of the most frequent needs in Angular templates: `TrackByFunction`. Please see [this page in Angular docs](https://angular.io/guide/template-syntax#ngfor-with-trackby) for its purpose.
+
+
+
+
+## Benefit
+
+You can use router events directly and filter them as seen below:
+
+```js
+import {
+ NavigationEnd,
+ NavigationError,
+ NavigationCancel,
+ Router,
+} from '@angular/router';
+import { filter } from 'rxjs/operators';
+
+@Injectable()
+class SomeService {
+ navigationFinish$ = this.router.events.pipe(
+ filter(
+ event =>
+ event instanceof NavigationEnd ||
+ event instanceof NavigationError ||
+ event instanceof NavigationCancel,
+ ),
+ );
+ /* Observable */
+
+ constructor(private router: Router) {}
+}
+```
+
+However, `RouterEvents` makes filtering router events easier.
+
+```js
+import { RouterEvents } from '@abp/ng.core';
+
+@Injectable()
+class SomeService {
+ navigationFinish$ = this.routerEvents.getNavigationEvents('End', 'Error', 'Cancel');
+ /* Observable */
+
+ constructor(private routerEvents: RouterEvents) {}
+}
+```
+
+`RouterEvents` also delivers improved type-safety. In the example above, `navigationFinish$` has inferred type of `Observable` whereas it would have `Observable` when router events are filtered directly.
+
+
+
+
+## Usage
+
+You do not have to provide `RouterEvents` at the module or component level, because it is already **provided in root**. You can inject and start using it immediately in your components.
+
+
+### How to Get Specific Navigation Events
+
+You can use `getNavigationEvents` to get a stream of navigation events matching given event keys.
+
+```js
+import { RouterEvents } from '@abp/ng.core';
+import { merge } from 'rxjs';
+import { mapTo } from 'rxjs/operators';
+
+@Injectable()
+class SomeService {
+ navigationStart$ = this.routerEvents.getNavigationEvents('Start');
+ /* Observable */
+
+ navigationFinish$ = this.routerEvents.getNavigationEvents('End', 'Error', 'Cancel');
+ /* Observable */
+
+ loading$ = merge(
+ this.navigationStart$.pipe(mapTo(true)),
+ this.navigationFinish$.pipe(mapTo(false)),
+ );
+ /* Observable */
+
+ constructor(private routerEvents: RouterEvents) {}
+}
+```
+
+
+### How to Get All Navigation Events
+
+You can use `getAllNavigationEvents` to get a stream of all navigation events without passing any keys.
+
+```js
+import { RouterEvents, NavigationStart } from '@abp/ng.core';
+import { map } from 'rxjs/operators';
+
+@Injectable()
+class SomeService {
+ navigationEvent$ = this.routerEvents.getAllNavigationEvents();
+ /* Observable */
+
+ loading$ = this.navigationEvent$.pipe(
+ map(event => event instanceof NavigationStart),
+ );
+ /* Observable */
+
+ constructor(private routerEvents: RouterEvents) {}
+}
+```
+
+
+### How to Get Specific Router Events
+
+You can use `getEvents` to get a stream of router events matching given event constructors.
+
+```js
+import { RouterEvents } from '@abp/ng.core';
+import { ActivationEnd, ChildActivationEnd } from '@angular/router';
+
+@Injectable()
+class SomeService {
+ moduleActivation$ = this.routerEvents.getEvents(ActivationEnd, ChildActivationEnd);
+ /* Observable */
+
+ constructor(private routerEvents: RouterEvents) {}
+}
+```
+
+
+### How to Get All Router Events
+
+You can use `getEvents` to get a stream of all router events without passing any event constructors. This is nothing different from accessing `events` property of `Router` and is added to the service just for convenience.
+
+```js
+import { RouterEvents } from '@abp/ng.core';
+import { ActivationEnd, ChildActivationEnd } from '@angular/router';
+
+@Injectable()
+class SomeService {
+ routerEvent$ = this.routerEvents.getAllEvents();
+ /* Observable */
+
+ constructor(private routerEvents: RouterEvents) {}
+}
+```
+
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/UI/AspNetCore/Data-Tables.md b/docs/en/UI/AspNetCore/Data-Tables.md
index b97d49d562..d5181b2da9 100644
--- a/docs/en/UI/AspNetCore/Data-Tables.md
+++ b/docs/en/UI/AspNetCore/Data-Tables.md
@@ -110,7 +110,7 @@ The `createAjax` also supports you to customize request parameters and handle th
**Example:**
````csharp
-var inputAction = function () {
+var inputAction = function (requestData, dataTableSettings) {
return {
id: $('#Id').val(),
name: $('#Name').val(),
@@ -131,6 +131,15 @@ var responseCallback = function(result) {
ajax: abp.libs.datatables.createAjax(acme.bookStore.books.book.getList, inputAction, responseCallback)
````
+If you don't need access or modify the `requestData` or the `dataTableSettings`, you can specify a simple object as the second parameter.
+
+````js
+ajax: abp.libs.datatables.createAjax(
+ acme.bookStore.books.book.getList,
+ { id: $('#Id').val(), name: $('#Name').val() }
+)
+````
+
### Row Actions
`rowAction` is an option defined by the ABP Framework to the column definitions to show a drop down button to take actions for a row in the table.
diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json
index c0a4d4d2bc..7fd7762ad4 100644
--- a/docs/en/docs-nav.json
+++ b/docs/en/docs-nav.json
@@ -807,6 +807,10 @@
"text": "Easy *ngFor trackBy",
"path": "UI/Angular/Track-By-Service.md"
},
+ {
+ "text": "Router Events",
+ "path": "UI/Angular/Router-Events.md"
+ },
{
"text": "Inserting Scripts & Styles to DOM",
"path": "UI/Angular/Dom-Insertion-Service.md"
@@ -819,6 +823,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 +838,10 @@
{
"text": "Page Alerts",
"path": "UI/Angular/Page-Alerts.md"
+ },
+ {
+ "text": "Ellipsis",
+ "path": "UI/Angular/Ellipsis-Directive.md"
}
]
},
diff --git a/docs/en/images/angular-module-dev-app-project.png b/docs/en/images/angular-module-dev-app-project.png
new file mode 100644
index 0000000000..08e0e9fd6c
Binary files /dev/null and b/docs/en/images/angular-module-dev-app-project.png differ
diff --git a/docs/en/images/angular-module-folder-structure.png b/docs/en/images/angular-module-folder-structure.png
new file mode 100644
index 0000000000..ae2333b295
Binary files /dev/null and b/docs/en/images/angular-module-folder-structure.png differ
diff --git a/docs/zh-Hans/Best-Practices/Application-Services.md b/docs/zh-Hans/Best-Practices/Application-Services.md
index 82a5dc8aba..c99d67d518 100644
--- a/docs/zh-Hans/Best-Practices/Application-Services.md
+++ b/docs/zh-Hans/Best-Practices/Application-Services.md
@@ -199,7 +199,7 @@ Task VoteAsync(Guid id, VoteType type);
#### 查询数据
-* **不推荐** 在应用程序服务方法中使用linq/sql查询来自数据库的数据. 让仓储负责从数据源执行linq/sql查询.
+* **不推荐** 在应用服务方法中使用linq/sql查询来自数据库的数据. 让仓储负责从数据源执行linq/sql查询.
#### 额外的属性
@@ -210,11 +210,16 @@ Task VoteAsync(Guid id, VoteType type);
* **推荐** 总是从数据库中获取所有的相关实体以对他们执行操作.
* **推荐** 更新实体后调用存储的Update/UpdateAsync方法.因为并非所有数据库API都支持更改跟踪和自动更新.
+#### 处理文件
+
+* **不推荐** 在应用服务中使用任何web组件, 例如`IFormFile`和`Stream`. 如果你想接收一个文件, 可以使用`byte[]`.
+* **推荐** 使用`Controller`来处理文件上传, 然后将文件的`byte[]`传递给应用服务的方法。
+
#### 使用其他应用服务
-* **不推荐** 使用相同 **模块/应用程序** 的其他应用服务. 相反;
+* **不推荐** 在同一个模块/应用中使用其他应用服务. 相反;
* 使用领域层执行所需的任务.
- * 提取新类并在应用程序服务之间共享, 在必要时代码重用. 但要小心不要结合两个用例. 它们在开始时可能看起来相似, 但可能会随时间演变为不同的方向. 请谨慎使用代码共享.
+ * 提取新类并在应用服务之间共享, 在必要时代码重用. 但要小心不要结合两个用例. 它们在开始时可能看起来相似, 但可能会随时间演变为不同的方向. 请谨慎使用代码共享.
* **可以** 在以下情况下使用其他应用服务;
* 它们是另一个模块/微服务的一部分.
- * 当前模块仅引用已使用模块的application contracts.
\ No newline at end of file
+ * 当前模块仅引用已使用模块的application contracts.
diff --git a/docs/zh-Hans/Caching.md b/docs/zh-Hans/Caching.md
index 0557ddcb4d..a75199ce47 100644
--- a/docs/zh-Hans/Caching.md
+++ b/docs/zh-Hans/Caching.md
@@ -192,6 +192,18 @@ public class BookService : ITransientDependency
}
````
+## 批量操作
+
+ABP的分布式缓存接口定义了以下批量操作方法,当你需要在一个方法中调用多次缓存操作时,这些方法可以提高性能
+
+* `SetManyAsync` 和 `SetMany` 方法可以用来设置多个值.
+* `GetManyAsync` 和 `GetMany` 方法可以用来从缓存中获取多个值.
+* `GetOrAddManyAsync` 和 `GetOrAddMany` 方法可以用来从缓存中获取并添加缺少的值.
+* `RefreshManyAsync` 和 `RefreshMany` 方法可以来用重置多个值的滚动过期时间.
+* `RemoveManyAsync` 和 `RemoveMany` 方法呆以用来删除多个值.
+
+> 这些不是标准的ASP.NET Core缓存方法, 所以某些提供程序可能不支持. [ABP Redis集成包](Redis-Cache.md)实现了它们. 如果提供程序不支持,会回退到 `SetAsync` 和 `GetAsync` ... 方法(循环调用).
+
### DistributedCacheOptions
TODO
\ No newline at end of file
diff --git a/docs/zh-Hans/Customizing-Application-Modules-Overriding-Services.md b/docs/zh-Hans/Customizing-Application-Modules-Overriding-Services.md
index b8abe99cdc..1e9ae77f36 100644
--- a/docs/zh-Hans/Customizing-Application-Modules-Overriding-Services.md
+++ b/docs/zh-Hans/Customizing-Application-Modules-Overriding-Services.md
@@ -243,7 +243,7 @@ ObjectExtensionManager.Instance
这是定义实体属性的另一种方法( 有关 `ObjectExtensionManager` 更多信息,请参阅[文档](Object-Extensions.md)). 这次我们设置了 `CheckPairDefinitionOnMapping` 为false,在将实体映射到DTO时会跳过定义检查.
-如果你不喜欢这种方法,但想简单的向多个对象(DTO)添加单个属, `AddOrUpdateProperty` 可以使用类型数组添加额外的属性:
+如果你不喜欢这种方法,但想简单的向多个对象(DTO)添加单个属性, `AddOrUpdateProperty` 可以使用类型数组添加额外的属性:
````csharp
ObjectExtensionManager.Instance
diff --git a/docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md b/docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md
index e59f96ce56..47cab8c02e 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/PlugIn-Modules.md b/docs/zh-Hans/PlugIn-Modules.md
new file mode 100644
index 0000000000..48a507ac7d
--- /dev/null
+++ b/docs/zh-Hans/PlugIn-Modules.md
@@ -0,0 +1,233 @@
+# 模块化插件
+
+可以将[模块](Module-Development-Basics.md)加载为插件.这意味着你可能不需要在解决方案中引用模块的程序集,就可以像其它模块一样在启动应用时加载该模块.
+
+## 基本用法
+
+`IServiceCollection.AddApplication()` 扩展方法可以获取配置插件源的选项.
+
+**示例: 从文件夹加载插件**
+
+````csharp
+using Microsoft.AspNetCore.Builder;
+using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp.Modularity.PlugIns;
+
+namespace MyPlugInDemo.Web
+{
+ public class Startup
+ {
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddApplication(options =>
+ {
+ options.PlugInSources.AddFolder(@"D:\Temp\MyPlugIns");
+ });
+ }
+
+ public void Configure(IApplicationBuilder app)
+ {
+ app.InitializeApplication();
+ }
+ }
+}
+````
+
+* 这是典型的ASP.NET Core应用程序的`Startup`类.
+* `PlugInSources.AddFolder`从指定的目录中加载程序集(通常为dll).
+
+就这样.ABP将在这个目录中发现这些模块,像其它常规一样配置和初始化它们.
+
+### 插件源
+
+`options.PlugInSources`类实际上是`IPlugInSource`接口的一系列实现并且 `AddFolder`方法仅仅是以下表达式的便捷方法:
+
+````csharp
+options.PlugInSources.Add(new FolderPlugInSource(@"D:\Temp\MyPlugIns"));
+````
+
+> `AddFolder()`方法仅在给定目录下查找程序集文件,而不在子目录中查找.你可以传递一个`SearchOption.AllDirectories`参数作为第二个参数,来递归地查找它的子目录.
+
+这里有两个内置插件源的示例:
+
+* `PlugInSources.AddFiles()`方法获取程序集(通常是dll)文件列表.这是使用`FilePlugInSource`类的快捷方式.
+* `PlugInSources.AddTypes()`方法获取模块类类型的列表.如果实用化此方法,则需要自己加载模块的程序集,但是在需要时它提供了灵活性.这是使用`TypePlugInSource`类的快捷方式.
+
+如果需要,你可以创建自己的`IPlugInSource`的接口实现,并像其它方法一样添加到`options.PlugInSources`中.
+
+## 示例:创建一个简单的插件
+
+在一个解决方案中创建一个简单的**类库项目**
+
+
+
+你可以在模块中添加需要使用的ABP框架包.至少,你应该为这个项目添加包`Volo.Abp.Core`:
+
+````
+Install-Package Volo.Abp.Core
+````
+
+每个[模块](Module-Development-Basics.md)必须声明为一个继承自`AbpModule`的类.这里是一个简单的模块类,用于解析一个服务并在应用启动时对其初始化:
+
+````csharp
+using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp;
+using Volo.Abp.Modularity;
+
+namespace MyPlugIn
+{
+ public class MyPlungInModule : AbpModule
+ {
+ public override void OnApplicationInitialization(ApplicationInitializationContext context)
+ {
+ var myService = context.ServiceProvider
+ .GetRequiredService();
+
+ myService.Initialize();
+ }
+ }
+}
+````
+
+`MyService`可以是注册在[依赖注入](Dependency-Injection.md)系统中的任意类,如下所示:
+
+````csharp
+using Microsoft.Extensions.Logging;
+using Volo.Abp.DependencyInjection;
+
+namespace MyPlugIn
+{
+ public class MyService : ITransientDependency
+ {
+ private readonly ILogger _logger;
+
+ public MyService(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+ public void Initialize()
+ {
+ _logger.LogInformation("MyService has been initialized");
+ }
+ }
+}
+````
+
+编译这个项目,打开build目录,找到`MyPlugIn.dll`:
+
+
+
+将`MyPlugIn.dll`复制到到插件目录中(此实例为`D:\Temp\MyPlugIns`).
+
+如果你已经按照上述方式配置了主应用程序(参见“基础用法”部分),那么在应用程序启动时,你可以看到“MyService has been initialized(MyService已经初始化)的日志.
+
+## 示例:创建一个Razor Pages插件
+
+创建内部带视图的插件需要更多的注意.
+
+> 这个示例假设你已经使用应用程序启动模板和MVC / Razor Pages UI[创建了一个新的Web应用程序](https://abp.io/get-started).
+
+在解决方案中创建一个新的**类库**项目:
+
+
+
+编辑这个`.csproj`文件内容:
+
+````xml
+
+
+
+ net5.0
+ Library
+ true
+
+
+
+
+
+
+
+````
+
+* 将`Sdk`修改为`Microsoft.NET.Sdk.Web`.
+* 添加了`OutputType`和`IsPackable`属性.
+* 添加了`Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared`NuGet包.
+
+> 不需要[Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared) 包.你可以引用更基础的程序包,例如[Volo.Abp.AspNetCore.Mvc](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc/). 但是,如果需要构建一个UI视图/组件,建议参考[Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)程序包,因为它是最高级的程序包,不依赖于特定[theme](UI/AspNetCore/Theming.md).如果依赖特定主题没有问题,则可以直接引用该主题的程序包,以便能够使用插件中特定于主题的功能.
+
+接下来在插件中创建模块类:
+
+````csharp
+using System.IO;
+using System.Reflection;
+using Microsoft.AspNetCore.Mvc.ApplicationParts;
+using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
+using Volo.Abp.Modularity;
+
+namespace MyMvcUIPlugIn
+{
+ [DependsOn(typeof(AbpAspNetCoreMvcUiThemeSharedModule))]
+ public class MyMvcUIPlugInModule : AbpModule
+ {
+ public override void PreConfigureServices(ServiceConfigurationContext context)
+ {
+ PreConfigure(mvcBuilder =>
+ {
+ // 添加插件程序集
+ mvcBuilder.PartManager.ApplicationParts.Add(new AssemblyPart(typeof(MyMvcUIPlugInModule).Assembly));
+
+ // 添加视图程序集
+ var viewDllPath = Path.Combine(Path.GetDirectoryName(typeof(MyMvcUIPlugInModule).Assembly.Location), "MyMvcUIPlugIn.Views.dll");
+ var viewAssembly = new CompiledRazorAssemblyPart(Assembly.LoadFrom(viewDllPath));
+ mvcBuilder.PartManager.ApplicationParts.Add(viewAssembly);
+ });
+ }
+ }
+}
+````
+
+* 由于我们添加了相关的NuGet包,因此取决于`AbpAspNetCoreMvcUiThemeSharedModule`.
+* 添加插件程序集到ASP.NET Core MVC的`PartManager`中.这是ASP.NET Core所必需的.否则,你插件中的控制器将无法正常工作.
+* 添加插件的视图程序集到ASP.NET Core MVC的`PartManager`中.这是ASP.NET Core所必需的.否则,你在插件中的视图将不起作用.
+
+现在,你可以在`Pages`目录下添加一个razor页面,例如`MyPlugInPage.cshtml`:
+
+````html
+@page
+@model MyMvcUIPlugIn.Pages.MyPlugInPage
+