Merge branch 'dev' into maliming-upgrade-jquery

pull/8371/head
Alper Ebicoglu 5 years ago committed by GitHub
commit 2585390e48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -23,7 +23,7 @@
<xUnitRunnerVisualstudioPackageVersion>2.4.3</xUnitRunnerVisualstudioPackageVersion>
<!-- Mongo2Go https://www.nuget.org/packages/Mongo2Go -->
<Mongo2GoPackageVersion>3.0.0</Mongo2GoPackageVersion>
<Mongo2GoPackageVersion>3.1.1</Mongo2GoPackageVersion>
</PropertyGroup>
</Project>

@ -271,6 +271,12 @@
"PaymentDetails": "Payment Details",
"PaymentProduct": "Payment Product",
"ProductName": "Product Name",
"Code": "Code"
"Code": "Code",
"GenerateInvoice": "Generate Invoice",
"ExportOrganizationsToExcel": "Export to Excel",
"ThisExtensionIsNotAllowed": "This extension is not allowed.",
"TheFileIsTooLarge": "The file is too large!",
"ArticleDeletionConfirmationMessage": "Are you sure you want to hard delete this article?",
"ChooseCoverImage": "Choose a cover image..."
}
}

@ -220,6 +220,13 @@
"PaymentDetails": "Ödeme Detayları",
"PaymentProduct": "Ödeme Ürünü",
"ProductName": "Ürün İsmi",
"Code": "Kod"
"Code": "Kod",
"GenerateInvoice": "Fatura Oluştur",
"ExportOrganizationsToExcel": "Excel'e aktar",
"ThisExtensionIsNotAllowed": "Bu uzantıya izin verilmiyor.",
"TheFileIsTooLarge": "Dosya çok büyük.",
"ArticleDeletionConfirmationMessage": "Bu makaleyi kalıcı olarak silmek istediğinizden emin misiniz?",
"ChooseCoverImage": "Bir kapak resmi seçin...",
"CoverImage": "Kapak Resmi"
}
}
}

@ -255,6 +255,12 @@
"PaymentDetails": "付款详情",
"PaymentProduct": "付款产品",
"ProductName": "产品名称",
"Code": "代码"
"Code": "代码",
"GenerateInvoice": "生成发票",
"ExportOrganizationsToExcel": "将组织导出到Excel",
"ThisExtensionIsNotAllowed": "不允许此扩展名.",
"TheFileIsTooLarge": "文件过大.",
"ArticleDeletionConfirmationMessage": "您确定要硬删除这篇文章吗?",
"ChooseCoverImage": "选项一张封面图片"
}
}

@ -7,7 +7,7 @@
"OrganizationNotFoundMessage": "No organization found!",
"DeveloperCount": "Allocated / total developers",
"QuestionCount": "Remaining / total questions",
"Unlimited": "Unlimited",
"Unlimited": "Unlimited",
"Owners": "Owners",
"AddMember": "Add member",
"AddOwner": "Add owner",
@ -179,7 +179,9 @@
"LicenseExtendUpgradeDiff": "What is the difference between license extend and upgrade?",
"LicenseExtendUpgradeDiffExplanation": "<strong>Extending:</strong> By extending/renewing your license, you will continue to get premium support and get major updates for the modules and themes. Besides, you will be able to continue creating new projects. And you will still be able to use ABP Suite which speeds up your development.<hr/><strong>Upgrading:</strong> By upgrading your license, you will promote to a higher license plan which will allow you to get additional benefits. See the <a href=\"/pricing\">license comparison table</a> to check the differences between the license plans.<strong>On the other hand, when you upgrade, your license expiry date will not change!</strong>To extend your license end date, you need to extend your license.",
"LicenseRenewalCost": "What is the license renewal cost after 1 year?",
"LicenseRenewalCostExplanation": "You can renew (extend) your license by paying %80 of the current license price. For example; Standard ABP Team License is <span class=\"text-muted\">$</span>{0} and renewal price of the Team License is <span class=\"text-muted\">$</span>{1}.",
"LicenseRenewalCostExplanation": "The renewal (extend) rate of all ABP Commercial perpetual licenses is {0} of the license list price. The renewal price of the standard Team License is ${1}, standard Business License is ${2} and standard Enterprise License is ${3}. If you are already a customer, <a href='{4}' target='_blank'>log into your account</a> to review the available renewal pricing.",
"HowDoIRenewMyLicense": "How do I renew my license?",
"HowDoIRenewMyLicenseExplanation": "You can renew your license by navigating to the <a href='{0}' target='_blank'>organization management page</a>. In order to take advantage of our discounted Early Renewal rates, make sure you renew before your license expires. Don't worry about not knowing when your Early Renewal opportunity closes, however. You'll receive 2 reminder e-mails before your subscription expires. We'll send them at 30 days, 7 days before expiration.",
"IsSourceCodeIncluded": "Does my license include the source code of the commercial modules and themes?",
"IsSourceCodeIncludedExplanation1": "Depends on the license type you've purchased:",
"IsSourceCodeIncludedExplanation2": "<strong>Team</strong>: Your solution uses the modules and the themes as NuGet and NPM packages. It doesn't include their source code. In this way, you can easily upgrade these modules and themes whenever a new version is available. However, you can not get the source code of the modules and the themes.",
@ -188,7 +190,7 @@
"ChangingDevelopers": "Can I change the registered developers of my organization in the future?",
"ChangingDevelopersExplanation": "In addition to add new developers to your license, you can also change the existing developers (you can remove a developer and add a new one to the same seat) without any additional cost.",
"WhatHappensWhenLicenseEnds": "What happens when my license period ends?",
"WhatHappensWhenLicenseEndsExplanation1": "ABP Commercial has <a href=\"{0}\" target=\"_blank\">perpetual license type</a>.After your license expires, you can continue developing your project. And you are not obliged to renew your license. After your license expires;",
"WhatHappensWhenLicenseEndsExplanation1": "ABP Commercial license type is <a href=\"{0}\" target=\"_blank\">perpetual license</a>. After your license expires, you can continue developing your project. And you are not obliged to renew your license. Your license comes with a one-year Updates and Support plan out of the box. To continue to receive new features, performance enhancements, bug fixes, support and continue to use ABP Suite, make sure to renew your plan each year. When your license expires, you will not be able to get more of the following benefits;",
"WhatHappensWhenLicenseEndsExplanation2": "You can not create new solutions using the ABP Commercial, but you can continue to develop your existing applications forever.",
"WhatHappensWhenLicenseEndsExplanation3": "You will be able to get updates for the modules and themes within your MAJOR version. For example; if you are using v3.2.0 of a module, you can still get updates for v3.x.x (v3.3.0, v3.5.2... etc.) of that module. But you cannot get updates for the next major version (like v4.x, v5.x)",
"WhatHappensWhenLicenseEndsExplanation4": "You can not install new modules and themes added to the ABP Commercial platform after your license ends.",
@ -228,7 +230,7 @@
"HowCanIRefundVatExplanation2": "Log in into your <a href=\"https://secure.2checkout.com/cpanel/login.php\" target=\"_blank\">2Checkout</a> account",
"HowCanIRefundVatExplanation3": "Find the appropriate order and press \"Refund Belated VAT\" (enter your VAT ID)",
"HowCanIGetMyInvoice": "How can I get my invoice?",
"HowCanIGetMyInvoiceExplanation": "There are 2 payment gateways for purchasing a license: PayU and 2Checkout. If you purchase your license through 2Checkout gateway, it sends the PDF invoice to your email address, see <a href=\"https://knowledgecenter.2checkout.com/Documentation/03Billing-and-payments/Payment-operations/How-do-invoices-work\">2Checkout invoicing.</a> If you purchase through the PayU gateway or via bank wire transfer, we will prepare and send your invoice. You can request your invoice from the <a href=\"{0}\">organization management page.</a>",
"HowCanIGetMyInvoiceExplanation": "There are 2 payment gateways for purchasing a license: PayU and 2Checkout. If you purchase your license through 2Checkout gateway, it sends the PDF invoice to your email address, see <a href=\"https://knowledgecenter.2checkout.com/Documentation/03Billing-and-payments/Payment-operations/How-do-invoices-work\">2Checkout invoicing.</a> If you purchase through the PayU gateway or via bank wire transfer, we will prepare and send your invoice. You can request your invoice from the <a href=\"{0}\">organization management page.</a>",
"Forum": "Forum",
"SupportExplanation": "ABP Commercial licenses provides a premium forum support by a team consists of the ABP Framework experts.",
"PrivateTicket": "Private Ticket",

@ -179,7 +179,9 @@
"LicenseExtendUpgradeDiff": "许可扩展和升级有什么区别?",
"LicenseExtendUpgradeDiffExplanation": "<strong>扩展:</strong> 通过扩展/更新许可,你将继续获得高级支持,并获得有关模块和主题的重大更新. 此外你将能够继续创建新项目. 而且你仍然可以使用ABP Suite来加快开发速度.<hr/><strong>升级:</strong> 通过升级许可,你将升级到更高的许可计划,这将使你获得更多好处. 查看 <a href=\"/pricing\">许可比较表</a>来检查许可计划之间的差异. <strong>另一方面,当你升级时你的许可到期日期不会改变!</strong>要延长你的许可终止日期,你需要延长你的许可.",
"LicenseRenewalCost": "一年后的许可续期费用是多少?",
"LicenseRenewalCostExplanation": "你可以通过支付当前许可价格的%80来续订(扩展)你的许可. 例如; 标准ABP团队许可为 <span class=\"text-muted\">$</span>{0} 续订价格是 <span class=\"text-muted\">$</span>{1}.",
"LicenseRenewalCostExplanation": "ABP商业版的续费价格均为原价的{0}. Team版本的续费价格是${1}, Business版本的续订价格是${2}, Enterprise版本的续订价格是${3}. 如果你已经购买了, 请<a href='{4}' target='_blank'>登录帐户</a>以查看续订价格.",
"HowDoIRenewMyLicense": "如何续费我的许可证?",
"HowDoIRenewMyLicenseExplanation": "你可以<a href='{0} target='_blank'>登录</a>以进行续费. 为了享受我们的续费折扣, 请确保在许可证到期之前进行续费, 我们会在到期前7天和30天发送2封续费提醒邮件.",
"IsSourceCodeIncluded": "我的许可是否包括商业模块和主题的源代码?",
"IsSourceCodeIncludedExplanation1": "取决于你购买的许可类型:",
"IsSourceCodeIncludedExplanation2": "<strong>团队</strong>: 你的解决方案将这些模块和主题作为NuGet和NPM包使用. 它不包括其源代码. 这样,只要有新版本可用,你就可以轻松升级这些模块和主题. 但是,你无法获取模块和主题的源代码.",
@ -228,7 +230,7 @@
"HowCanIRefundVatExplanation2": "登录到你的<a href=\"https://secure.2checkout.com/cpanel/login.php\" target=\"_blank\">2Checkout</a>账户",
"HowCanIRefundVatExplanation3": "找到适当的订单,然后按\"退还已延期的增值税\"输入你的增值税ID",
"HowCanIGetMyInvoice": "我如何获得发票?",
"HowCanIGetMyInvoiceExplanation": "有两个用于购买许可的支付网关:PayU和2Checkout. 如果你通过2Checkout网关购买许可,则它将PDF发票发送到你的电子邮件地址,请参阅<a href=\"https://knowledgecenter.2checkout.com/Documentation/03Billing-and-payments/Payment-operations/How-do-invoices-work>2Checkout发票.</a>如果你是通过PayU网关或通过银行电汇购买的,我们将准备并发送你的发票. 你可以从<a href=\"{0}\">组织管理页面</a>索取发票.",
"HowCanIGetMyInvoiceExplanation": "有两个用于购买许可的支付网关:PayU和2Checkout. 如果你通过2Checkout网关购买许可,则它将PDF发票发送到你的电子邮件地址,请参阅<a href=\"https://knowledgecenter.2checkout.com/Documentation/03Billing-and-payments/Payment-operations/How-do-invoices-work>2Checkout发票.</a>如果你是通过PayU网关或通过银行电汇购买的,我们将准备并发送你的发票. 你可以从<a href=\"{0}\">组织管理页面</a>索取发票.",
"Forum": "论坛",
"SupportExplanation": "ABP商业版许可包含由ABP框架专家组成的团队提供的高级论坛支持.",
"PrivateTicket": "私有票",

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>4.4.0</Version>
<LangVersion>latest</LangVersion>
<Version>4.4.0</Version>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
<PackageIconUrl>https://abp.io/assets/abp_nupkg.png</PackageIconUrl>
<PackageProjectUrl>https://abp.io/</PackageProjectUrl>

@ -167,7 +167,7 @@ ABP CLI always uses the latest version. In order to create a solution from a pre
## Choose database management system
The default database management system (DBMS) is `Entity Framework Core` / ` SQL Server`. You can choose a DBMS by passing `--database-management-system` parameter. Accepted values are `SqlServer`, `MySQL`, `SQLite`, `Oracle-Devart`, `PostgreSQL`. The default value is `SqlServer`.
The default database management system (DBMS) is `Entity Framework Core` / ` SQL Server`. You can choose a DBMS by passing `--database-management-system` parameter. [Accepted values](https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/DatabaseManagementSystem.cs) are `SqlServer`, `MySQL`, `SQLite`, `Oracle`, `Oracle-Devart`, `PostgreSQL`. The default value is `SqlServer`.
* Angular UI, **PostgreSQL** database, creates the project in a new folder:

@ -262,7 +262,7 @@ Distributed cache service provides an interesting feature. Assume that you've up
### IDistributedCacheSerializer
`IDistributedCacheSerializer` service is used to serialize and deserialize the cache items. Default implementation is the `Utf8JsonDistributedCacheSerializer` class that uses `IJsonSerializer` service to convert objects to [JSON](Json.md) and vice verse. Then it uses UTC8 encoding to convert the JSON string to a byte array which is accepted by the distributed cache.
`IDistributedCacheSerializer` service is used to serialize and deserialize the cache items. Default implementation is the `Utf8JsonDistributedCacheSerializer` class that uses `IJsonSerializer` service to convert objects to [JSON](Json-Serialization.md) and vice verse. Then it uses UTC8 encoding to convert the JSON string to a byte array which is accepted by the distributed cache.
You can [replace](Dependency-Injection.md) this service by your own implementation if you want to implement your own serialization logic.

@ -0,0 +1,71 @@
# Cancellation Token Provider
A `CancellationToken` enables cooperative cancellation between threads, thread pool work items, or `Task` objects. To handle the possible cancellation of the operation, ABP Framework provides `ICancellationTokenProvider` to obtain the `CancellationToken` itself from the source.
> To get more information about `CancellationToken`, see [Microsoft Documentation](https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken).
## ICancellationTokenProvider
`ICancellationTokenProvider` is an abstraction to provide `CancellationToken` for different scenarios.
Generally, you should pass the `CancellationToken` as a parameter for your method to use it. With the `ICancellationTokenProvider` you don't need to pass `CancellationToken` for every method. `ICancellationTokenProvider` can be injected with the **dependency injection** and provides the token from it's source.
**Example:**
```csharp
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Threading;
namespace MyProject
{
public class MyService : ITransientDependency
{
private readonly ICancellationTokenProvider _cancellationTokenProvider;
public MyService(ICancellationTokenProvider cancellationTokenProvider)
{
_cancellationTokenProvider = cancellationTokenProvider;
}
public async Task DoItAsync()
{
while (_cancellationTokenProvider.Token.IsCancellationRequested == false)
{
// ...
}
}
}
}
```
## Built-in providers
- `NullCancellationTokenProvider`
The `NullCancellationTokenProvider` is a built in provider and it supply always `CancellationToken.None`.
- `HttpContextCancellationTokenProvider`
The `HttpContextCancellationTokenProvider` is a built in default provider for ABP Web applications. It simply provides a `CancellationToken` that is source of the web request from the `HttpContext`.
## Implementing the ICancellationTokenProvider
You can easily create your CancellationTokenProvider by creating a class that implements the `ICancellationTokenProvider` interface, as shown below:
```csharp
using System.Threading;
namespace AbpDemo
{
public class MyCancellationTokenProvider : ICancellationTokenProvider
{
public CancellationToken Token { get; }
private MyCancellationTokenProvider()
{
}
}
}
```

@ -75,6 +75,7 @@ There are some low level systems that you can control entity actions, table colu
Entity action extension system allows you to add a new action to the action menu for an entity on the user interface;
* [Entity Action Extensions for ASP.NET Core UI](UI/AspNetCore/Entity-Action-Extensions.md)
* [Entity Action Extensions for Blazor UI](UI/Blazor/Entity-Action-Extensions.md)
* [Entity Action Extensions for Angular](UI/Angular/Entity-Action-Extensions.md)
#### Data Table Column Extensions
@ -82,6 +83,7 @@ Entity action extension system allows you to add a new action to the action menu
Data table column extension system allows you to add a new column in the data table on the user interface;
* [Data Table Column Extensions for ASP.NET Core UI](UI/AspNetCore/Data-Table-Column-Extensions.md)
* [Data Table Column Extensions for Blazor UI](UI/Blazor/Data-Table-Column-Extensions.md)
* [Data Table Column Extensions for Angular](UI/Angular/Data-Table-Column-Extensions.md)
#### Page Toolbar
@ -89,6 +91,7 @@ Data table column extension system allows you to add a new column in the data ta
Page toolbar system allows you to add components to the toolbar of a page;
* [Page Toolbar Extensions for ASP.NET Core UI](UI/AspNetCore/Page-Toolbar-Extensions.md)
* [Page Toolbar Extensions for Blazor UI](UI/Blazor/Page-Toolbar-Extensions.md)
* [Page Toolbar Extensions for Angular](UI/Angular/Page-Toolbar-Extensions.md)
#### Others

@ -94,7 +94,13 @@ Email sending uses the [setting system](Settings.md) to define settings and get
* **Abp.Mailing.Smtp.EnableSsl**: A value that indicates if the SMTP server uses SSL or not ("true" or "false". Default: "false").
* **Abp.Mailing.Smtp.UseDefaultCredentials**: If true, uses default credentials instead of the provided username and password ("true" or "false". Default: "true").
The easiest way to define these settings it to add them to the `appsettings.json` file. The [application startup template](Startup-Templates/Application.md) already has these settings in the `appsettings.json`:
Email settings can be managed from the *Settings Page* of the [Setting Management](Modules/Setting-Management.md) module:
![email-settings](images/email-settings.png)
> Setting Management module is already installed if you've created your solution from the ABP Startup template.
If you don't use the Setting Management module, you can simply define the settings inside your `appsettings.json` file:
````json
"Settings": {
@ -110,7 +116,7 @@ The easiest way to define these settings it to add them to the `appsettings.json
}
````
You can set/change these settings using the `ISettingManager` and store values in a database. See the [setting system document](Settings.md) to understand the setting system better.
You can set/change these settings programmatically using the `ISettingManager` and store values in a database. See the [setting system document](Settings.md) to understand the setting system better.
### Encrypt the SMTP Password

@ -4,7 +4,7 @@ This document explains how to switch to the **Oracle** database provider for **[
ABP Framework provides integrations for two different Oracle packages. See one of the following documents based on your provider decision:
* **[Volo.Abp.EntityFrameworkCore.Oracle](Entity-Framework-Core-Oracle-Official.md)** package uses the official & free oracle driver (which is **currently in beta**).
* **[Volo.Abp.EntityFrameworkCore.Oracle](Entity-Framework-Core-Oracle-Official.md)** package uses the official & free oracle driver.
* **[Volo.Abp.EntityFrameworkCore.Oracle.Devart](Entity-Framework-Core-Oracle-Devart.md)** package uses the commercial (paid) driver of [Devart](https://www.devart.com/) company.
> You can choose one of the package you want. If you don't know the differences of the packages, please search for it. ABP Framework only provides integrations it doesn't provide support for such 3rd-party libraries.

@ -326,20 +326,12 @@ if (feature != null)
A feature value is available at the client side too, unless you set `IsVisibleToClients` to `false` on the feature definition. The feature values are exposed from the [Application Configuration API](API/Application-Configuration.md) and usable via some services on the UI.
### ASP.NET Core MVC / Razor Pages UI
See the following documents to learn how to check features in different UI types:
Use `abp.features` API to get the feature values.
* [ASP.NET Core MVC / Razor Pages / JavaScript API](UI/AspNetCore/JavaScript-API/Features.md)
* [Angular](UI/Angular/Features.md)
**Example: Get feature values in the JavaScript code**
````js
var isEnabled = abp.features.values["MyApp.ExcelReporting"] === "true";
var count = abp.features.values["MyApp.MaxProductCount"];
````
### Angular UI
See the [features](Features.md) document for the Angular UI.
**Blazor** applications can use the same `IFeatureChecker` service as explained above.
## Feature Management

@ -15,12 +15,12 @@
We will use the ABP CLI to create a new ABP project.
> Alternatively, you can **create and download** projects from [ABP Framework website](https://abp.io/get-started) by easily selecting the all the options from the page.
> Alternatively, you can **create and download** projects from the [ABP Framework website](https://abp.io/get-started) by easily selecting all options from the page.
Use the `new` command of the ABP CLI to create a new project:
````shell
abp new Acme.BookStore{{if UI == "NG"}} -u angular{{else if UI == "Blazor"}} -u blazor{{else if UI == "BlazorServer"}} -u blazor-server{{end}}{{if DB == "Mongo"}} -d mongodb{{end}}{{if Tiered == "Yes"}}{{if UI == "MVC"}} --tiered{{else}} --separate-identity-server{{end}}{{end}}
abp new Acme.BookStore{{if UI == "NG"}} -u angular{{else if UI == "Blazor"}} -u blazor{{else if UI == "BlazorServer"}} -u blazor-server{{end}}{{if DB == "Mongo"}} -d mongodb{{end}}{{if Tiered == "Yes"}}{{if UI == "MVC" || UI == "BlazorServer"}} --tiered{{else}} --separate-identity-server{{end}}{{end}}
````
*You can use different level of namespaces; e.g. BookStore, Acme.BookStore or Acme.Retail.BookStore.*
@ -41,6 +41,12 @@ abp new Acme.BookStore{{if UI == "NG"}} -u angular{{else if UI == "Blazor"}} -u
> [ABP CLI document](./CLI.md) covers all of the available commands and options.
## Mobile Development
If you want to include a [React Native](https://reactnative.dev/) project in your solution, add `-m react-native` (or `--mobile react-native`) argument to project creation command. This is a basic React Native startup template to develop mobile applications integrated to your ABP based backends.
See the [Getting Started with the React Native](Getting-Started-React-Native.md) document to learn how to configure and run the React Native application.
### The Solution Structure
The solution has a layered structure (based on the [Domain Driven Design](Domain-Driven-Design.md)) and contains unit & integration test projects. See the [application template document](Startup-Templates/Application.md) to understand the solution structure in details.
@ -49,7 +55,7 @@ The solution has a layered structure (based on the [Domain Driven Design](Domain
#### MongoDB Transactions
The [startup template](Startup-templates/Index.md) **disables** transactions in the `.MongoDB` project by default. If your MongoDB server supports transactions, you can enable the it in the *YourProjectMongoDbModule* class's `ConfigureServices` method:
The [startup template](Startup-templates/Index.md) **disables** transactions in the `.MongoDB` project by default. If your MongoDB server supports transactions, you can enable it in the *YourProjectMongoDbModule* class's `ConfigureServices` method:
```csharp
Configure<AbpUnitOfWorkDefaultOptions>(options =>

@ -21,7 +21,7 @@ Check the **connection string** in the `appsettings.json` file under the {{if Ti
````json
"ConnectionStrings": {
"Default": "Server=localhost;Database=BookStore;Trusted_Connection=True"
"Default": "Server=(LocalDb)\MSSQLLocalDB;Database=BookStore;Trusted_Connection=True"
}
````
@ -193,12 +193,6 @@ It may take a longer time for the first build. Once it finishes, it opens the An
Enter **admin** as the username and **1q2w3E*** as the password to login to the application. The application is up and running. You can start developing your application based on this startup template.
## Mobile Development
If you want to include a [React Native](https://reactnative.dev/) project in your solution, add `-m react-native` (or `--mobile react-native`) argument to project creation command. This is a basic React Native startup template to develop mobile applications integrated to your ABP based backends.
See the [Getting Started with the React Native](Getting-Started-React-Native.md) document to learn how to configure and run the React Native application.
## See Also
* [Web Application Development Tutorial](Tutorials/Part-1.md)

@ -1,3 +1,117 @@
# Global Features
The purpose of the Global Feature System is to **add a module to your application but disable the features you don't want to use** (or enable only the ones you need). Notice that the features are not determined on runtime, you must select the features **on development time**. Because it will not create database tables, APIs and other stuff for unused features, which is not possible to change then on the runtime.
TODO (see [#5061](https://github.com/abpframework/abp/issues/5061) until this is documented).
## Installation
> This package is already installed by default with the startup template. So, most of the time, you don't need to install it manually.
### Using the ABP CLI
Open a command line window in the folder of the project (.csproj file) and type the following command:
```bash
abp add-package Volo.Abp.GlobalFeatures
```
## Implementation
Global Feature system aims module based feature management . A module has to have own Global Features itself.
### Define a Global Feature
A feature class is something like that:
```csharp
[GlobalFeatureName(Name)]
public class PaymentFeature : GlobalFeature
{
public const string Name = "Shopping.Payment";
public PaymentFeature(GlobalModuleFeatures module) : base(module)
{
}
}
```
### Define Global Module Features
All features of a module have to be defined in a Global Module Features class.
```csharp
public class GlobalShoppingFeatures : GlobalModuleFeatures
{
public const string ModuleName = "Shopping";
public GlobalShoppingFeatures(GlobalFeatureManager featureManager) : base(featureManager)
{
AddFeature(new PaymentFeature(this));
// And more features...
}
}
```
## Usage
### Enable/Disable Features
Global features are managed by modules. Module Features have to be added to Modules of GlobalFeatureManager.
```csharp
// GerOrAdd might be useful to be sure module features are added.
var shoppingGlobalFeatures = GlobalFeatureManager.Instance.Modules
.GetOrAdd(
GlobalShoppingFeatures.ModuleName,
()=> new GlobalShoppingFeatures(GlobalFeatureManager.Instance));
// Able to Enable/Disable with generic type parameter.
shoppingGlobalFeatures.Enable<PaymentFeature>();
shoppingGlobalFeatures.Disable<PaymentFeature>();
// Also able to Enable/Disable with string feature name.
shoppingGlobalFeatures.Enable(PaymentFeature.Name);
shoppingGlobalFeatures.Disable("Shopping.Payment");
```
### Check if a feature is enabled
```csharp
GlobalFeatureManager.Instance.IsEnabled<PaymentFeature>()
GlobalFeatureManager.Instance.IsEnabled("Shopping.Payment")
```
Both methods return `bool`.
```csharp
if (GlobalFeatureManager.Instance.IsEnabled<PaymentFeature>())
{
// Some strong payment codes here...
}
```
Beside the manual check, there is `[RequiresGlobalFeature]` attribute to check it declaratively for a controller or page. ABP returns 404 if the related feature was disabled.
```csharp
[RequiresGlobalFeature(typeof(CommentsFeature))]
public class PaymentController : AbpController
{
// ...
}
```
## When to configure Global Features?
Global Features have to be configured before application startup. So best place to configuring it is `PreConfigureServices` with **OneTimeRunner** to make sure it runs one time.
```csharp
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public override void PreConfigureServices(ServiceConfigurationContext context)
{
OneTimeRunner.Run(() =>
{
GlobalFeatureManager.Instance.Modules.Foo().EnableAll();
});
}
```
## Features vs Global Features
[Features](Features.md) & [Global Features](Global-Features.md) are totally different systems.
Features are used to switch on/off application feature for each tenant. So Features, only hides disabled ones, but with Global Features, disabled features pretends like never existed in application.

@ -4,8 +4,9 @@ ABP Framework is a complete **infrastructure** based on the **ASP.NET Core** to
## Getting Started
* [Getting Started Guide](Getting-Started.md) is the easiest way to start a new web application with the ABP Framework.
* [Web Application Development Tutorial](Tutorials/Part-1.md) is a complete tutorial to develop a full stack web application.
* [Quick Start](Tutorials/Todo/Index.md) is a single-part, quick-start tutorial to build a simple application with the ABP Framework. Start with this tutorial if you want to quickly understand how ABP works.
* [Getting Started](Getting-Started.md) guide can be used to create and run ABP based solutions with different options and details.
* [Web Application Development Tutorial](Tutorials/Part-1.md) is a complete tutorial to develop a full stack web application with all aspects of a real-life solution.
### UI Framework Options

@ -1,9 +1,5 @@
# Module Entity Extensions
> This feature is not supported by the Blazor UI yet.
## Introduction
Module entity extension system is a **high level** extension system that allows you to **define new properties** for existing entities of the depended modules. It automatically **adds properties to the entity, database, HTTP API and the user interface** in a single point.
> The module must be developed the *Module Entity Extensions* system in mind. All the **official modules** supports this system wherever possible.

@ -1,3 +0,0 @@
# Blogging Module
TODO

@ -1,3 +0,0 @@
# Client Simulation Module
TODO

@ -14,8 +14,6 @@ There are some **free and open source** application modules developed and mainta
* [**Account**](Account.md): Provides UI for the account management and allows user to login/register to the application.
* [**Audit Logging**](Audit-Logging.md): Persists audit logs to a database.
* [**Background Jobs**](Background-Jobs.md): Persist background jobs when using the default background job manager.
* [**Blogging**](Blogging.md): Used to create fancy blogs. ABP's [own blog](https://blog.abp.io/) already using this module.
* [**Client Simulation**](Client-Simulation.md): A simple web UI to stress test HTTP APIs by simulating concurrent clients.
* [**CMS Kit**](Cms-Kit.md): A set of reusable *Content Management System* features.
* [**Docs**](Docs.md): Used to create technical documentation website. ABP's [own documentation](https://docs.abp.io) already using this module.
* [**Feature Management**](Feature-Management.md): Used to persist and manage the [features](../Features.md).
@ -24,7 +22,6 @@ There are some **free and open source** application modules developed and mainta
* [**Permission Management**](Permission-Management.md): Used to persist permissions.
* **[Setting Management](Setting-Management.md)**: Used to persist and manage the [settings](../Settings.md).
* [**Tenant Management**](Tenant-Management.md): Manages tenants for a [multi-tenant](../Multi-Tenancy.md) application.
* [**Users**](Users.md): Abstract users, so other modules can depend on this module instead of the Identity module.
* [**Virtual File Explorer**](Virtual-File-Explorer.md): Provided a simple UI to view files in [virtual file system](../Virtual-File-System.md).
See [the GitHub repository](https://github.com/abpframework/abp/tree/master/modules) for source code of all modules.

@ -1,3 +0,0 @@
# Users Module
TODO

@ -1,14 +1,52 @@
# ABP Framework Road Map
You can always check the milestone planning and the prioritized backlog issues on [the GitHub repository](https://github.com/abpframework/abp/milestones) for a detailed road map. Here, a list of some major items in the backlog;
This document provides a road map, release schedule and planned features for the ABP Framework.
* CMS Kit: A set of reusable, extensible and composable Content Management System features.
## Next Versions
### v4.4
This version will focus on **documentation** and **improvements** of current features. In addition, the following features are planned;
* Publishing distributed events as transactional ([#6126](https://github.com/abpframework/abp/issues/6126))
* Revisit the microservice demo solution ([#8385](https://github.com/abpframework/abp/issues/8385))
* A new UI Theme alternative to the Basic Theme ([#6132](https://github.com/abpframework/abp/issues/6132))
* Improvements and new features to the [CMS Kit](Modules/Cms-Kit.md) module ([#8380](https://github.com/abpframework/abp/issues/8380) [#8381](https://github.com/abpframework/abp/issues/8381))
* Pre-configured test project for the [Blazor UI](UI/Blazor/Overall.md) ([#5516](https://github.com/abpframework/abp/issues/5516))
* Razor engine support for text templating ([#8373](https://github.com/abpframework/abp/issues/8373))
**Planned release date**: End of Quarter 2, 2021.
### v4.5
We planned to focus on v5.0 after 4.4 release. However, we may release v4.5 if we see it necessary.
### v5.0
This version will focus on .NET 6 and performance improvements.
* Upgrading to .NET 6
* .NET Trimming compatibility
* Using source generators and reducing reflection usage
* Performance improvements
* Improving the abp.io platform
* API Versioning system: finalize & document ([#497](https://github.com/abpframework/abp/issues/497))
**Planned release date**: End of Quarter 4, 2021.
> Note: v5.0 features will be more clear in the next months. We will consider to add new features from the *Backlog Items*.
## Backlog Items
The *Next Versions* section above shows the main focus of the planned versions. However, in each release we add new features to the core framework and the [application modules](Modules/Index.md).
Here, a list of major items in the backlog we are considering to work on in the next versions.
* [#2183](https://github.com/abpframework/abp/issues/2183) / Dapr integration
* [#2882](https://github.com/abpframework/abp/issues/2882) / Providing a gRPC integration infrastructure (while it is [already possible](https://github.com/abpframework/abp-samples/tree/master/GrpcDemo) to create or consume gRPC endpoints for your application, we plan to create endpoints for the [standard application modules](https://docs.abp.io/en/abp/latest/Modules/Index))
* [#236](https://github.com/abpframework/abp/issues/236) Resource based authorization system
* [#6132](https://github.com/abpframework/abp/issues/6132) A New Theme alternative to the Basic Theme
* [#1754](https://github.com/abpframework/abp/issues/1754) / Multi-lingual entities
* [#497](https://github.com/abpframework/abp/issues/497) API Versioning system finalize & document
* [#633](https://github.com/abpframework/abp/issues/633) / Realtime notification system
* [#236](https://github.com/abpframework/abp/issues/236) / Resource based authorization system
* [#1754](https://github.com/abpframework/abp/issues/1754) / Multi-lingual entities
* [#57](https://github.com/abpframework/abp/issues/57) / Built-in CQRS infrastructure
* [#336](https://github.com/abpframework/abp/issues/336) / Health Check abstraction
* [#2532](https://github.com/abpframework/abp/issues/2532), [#2564](https://github.com/abpframework/abp/issues/2465) / CosmosDB integration with EF Core and MongoDB API
@ -16,6 +54,9 @@ You can always check the milestone planning and the prioritized backlog issues o
* [#162](https://github.com/abpframework/abp/issues/162) / Azure ElasticDB Integration for multitenancy
* [#2296](https://github.com/abpframework/abp/issues/2296) / Feature toggling infrastructure
The backlog items are subject to change. We are adding new items and changing priorities based on the community feedbacks and goals of the project.
You can always check the milestone planning and the prioritized backlog issues on [the GitHub repository](https://github.com/abpframework/abp/milestones) for a detailed road map. The backlog items are subject to change. We are adding new items and changing priorities based on the community feedbacks and goals of the project.
## Feature Requests
Vote for your favorite feature on the related GitHub issues (and write your thoughts). You can create an issue on [the GitHub repository](https://github.com/abpframework/abp) for your feature requests, but first search in the existing issues.

@ -1,3 +1,111 @@
# Emailing
# SMS Sending
TODO!
The ABP Framework provides an abstraction to sending SMS. Having such an abstraction has some benefits;
- You can then **easily change** your SMS sender without changing your application code.
- If you want to create **reusable application modules**, you don't need to make assumption about how the SMS are sent.
## Installation
It is suggested to use the [ABP CLI](CLI.md) to install this package.
### Using the ABP CLI
Open a command line window in the folder of the project (.csproj file) and type the following command:
```bash
abp add-package Volo.Abp.Sms
```
### Manual Installation
If you want to manually install;
1. Add the [Volo.Abp.Sms](https://www.nuget.org/packages/Volo.Abp.Sms) NuGet package to your project:
```
Install-Package Volo.Abp.Sms
```
2. Add the `AbpSmsModule` to the dependency list of your module:
```csharp
[DependsOn(
//...other dependencies
typeof(AbpSmsModule) //Add the new module dependency
)]
public class YourModule : AbpModule
{
}
```
## Sending SMS
[Inject](Dependency-Injection.md) the `ISmsSender` into any service and use the `SendAsync` method to send a SMS.
**Example:**
```csharp
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Sms;
namespace MyProject
{
public class MyService : ITransientDependency
{
private readonly ISmsSender _smsSender;
public MyService(ISmsSender smsSender)
{
_smsSender = smsSender;
}
public async Task DoItAsync()
{
await _smsSender.SendAsync(
"+012345678901", // target phone number
"This is test sms..." // message text
);
}
}
}
```
The given `SendAsync` method in the example is an extension method to send an SMS with primitive parameters. In addition, you can pass an `SmsMessage` object which has the following properties:
- `PhoneNumber` (`string`): Target phone number
- `Text` (`string`): Message text
- `Properties` (`Dictionary<string, string>`): Key-value pairs to pass custom arguments
## NullSmsSender
`NullSmsSender` is a the default implementation of the `ISmsSender`. It writes SMS content to the [standard logler](Logging.md), rather than actually sending the SMS.
This class can be useful especially in development time where you generally don't want to send real SMS. **However, if you want to actually send SMS, you should implement the `ISmsSender` in your application code.**
## Implementing the ISmsSender
You can easily create your SMS sending implementation by creating a class that implements the `ISmsSender` interface, as shown below:
```csharp
using System.IO;
using System.Threading.Tasks;
using Volo.Abp.Sms;
using Volo.Abp.DependencyInjection;
namespace AbpDemo
{
public class MyCustomSmsSender : ISmsSender, ITransientDependency
{
public async Task SendAsync(SmsMessage smsMessage)
{
// Send sms
}
}
}
```
## More
[ABP Commercial](https://commercial.abp.io/) provides Twilio integration package to send SMS over [Twilio service](https://docs.abp.io/en/commercial/latest/modules/twilio-sms).

@ -83,7 +83,7 @@ var normalizedDateTime = Clock.Normalize(dateTime)
* `DateTime` type binding in the ASP.NET Core MVC model binding.
* Saving data to and reading data from database via [Entity Framework Core](Entity-Framework-Core.md).
* Working with `DateTime` objects on [JSON deserialization](Json.md).
* Working with `DateTime` objects on [JSON deserialization](Json-Serialization.md).
#### DisableDateTimeNormalization Attribute

@ -2,7 +2,7 @@
````json
//[doc-params]
{
"UI": ["MVC","Blazor","NG"],
"UI": ["MVC","Blazor","BlazorServer","NG"],
"DB": ["EF","Mongo"]
}
````

@ -2,7 +2,7 @@
````json
//[doc-params]
{
"UI": ["MVC","Blazor","NG"],
"UI": ["MVC","Blazor","BlazorServer","NG"],
"DB": ["EF","Mongo"]
}
````
@ -326,6 +326,7 @@ Open the `BookAppService` interface in the `Books` folder of the `Acme.BookStore
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Acme.BookStore.Authors;
using Acme.BookStore.Permissions;
@ -387,23 +388,17 @@ namespace Acme.BookStore.Books
public override async Task<PagedResultDto<BookDto>> GetListAsync(PagedAndSortedResultRequestDto input)
{
//Set a default sorting, if not provided
if (input.Sorting.IsNullOrWhiteSpace())
{
input.Sorting = nameof(Book.Name);
}
//Get the IQueryable<Book> from the repository
var queryable = await Repository.GetQueryableAsync();
//Prepare a query to join books and authors
var query = from book in queryable
join author in _authorRepository on book.AuthorId equals author.Id
orderby input.Sorting //TODO: Can not sort like that!
select new {book, author};
//Paging
query = query
.OrderBy(NormalizeSorting(input.Sorting))
.Skip(input.SkipCount)
.Take(input.MaxResultCount);
@ -435,6 +430,25 @@ namespace Acme.BookStore.Books
ObjectMapper.Map<List<Author>, List<AuthorLookupDto>>(authors)
);
}
private static string NormalizeSorting(string sorting)
{
if (sorting.IsNullOrEmpty())
{
return $"book.{nameof(Book.Name)}";
}
if (sorting.Contains("authorName", StringComparison.OrdinalIgnoreCase))
{
return sorting.Replace(
"authorName",
"author.Name",
StringComparison.OrdinalIgnoreCase
);
}
return $"book.{sorting}";
}
}
}
```
@ -1078,7 +1092,7 @@ That's all. Just run the application and try to create or edit an author.
{{end}}
{{if UI == "Blazor"}}
{{if UI == "Blazor" || UI == "BlazorServer"}}
### The Book List

@ -2,7 +2,7 @@
````json
//[doc-params]
{
"UI": ["MVC","Blazor","NG"],
"UI": ["MVC","Blazor","BlazorServer","NG"],
"DB": ["EF","Mongo"]
}
````
@ -447,7 +447,11 @@ For more information, see the [RoutesService document](../UI/Angular/Modifying-t
[ABP CLI](../CLI.md) provides `generate-proxy` command that generates client proxies for your HTTP APIs to make easy to consume your HTTP APIs from the client side. Before running `generate-proxy` command, your host must be up and running.
Run the following command in the `angular` folder:
> **Warning**: There is a problem with IIS Express; it doesn't allow to connect to the application from another process. If you are using Visual Studio, select the `Acme.BookStore.HttpApi.Host` instead of IIS Express in the run button drop-down list, as shown in the figure below:
![vs-run-without-iisexpress](images/vs-run-without-iisexpress.png)
Once the host application is running, execute the following command in the `angular` folder:
```bash
abp generate-proxy
@ -531,7 +535,7 @@ Now you can see the final result on your browser:
![Book list final result](images/bookstore-book-list.png)
{{else if UI == "Blazor"}}
{{else if UI == "Blazor" || UI == "BlazorServer"}}
## Create a Books Page

@ -2,7 +2,7 @@
````json
//[doc-params]
{
"UI": ["MVC","Blazor","NG"],
"UI": ["MVC","Blazor","BlazorServer","NG"],
"DB": ["EF","Mongo"]
}
````
@ -709,7 +709,7 @@ Open `/src/app/book/book.component.html` and make the following changes:
<ng-template #abpBody> </ng-template>
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
{%{{{ '::Close' | abpLocalization }}}%}
</button>
</ng-template>
@ -844,7 +844,7 @@ Also replace `<ng-template #abpFooter> </ng-template>` with the following code p
````html
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
{%{{{ '::Close' | abpLocalization }}}%}
</button>
@ -1158,7 +1158,7 @@ Clicking the "Delete" action calls the `delete` method which then shows a confir
{{end}}
{{if UI == "Blazor"}}
{{if UI == "Blazor" || UI == "BlazorServer"}}
## Creating a New Book

@ -2,7 +2,7 @@
````json
//[doc-params]
{
"UI": ["MVC","Blazor","NG"],
"UI": ["MVC","Blazor","BlazorServer","NG"],
"DB": ["EF","Mongo"]
}
````

@ -2,7 +2,7 @@
````json
//[doc-params]
{
"UI": ["MVC","Blazor","NG"],
"UI": ["MVC","Blazor","BlazorServer","NG"],
"DB": ["EF","Mongo"]
}
````

@ -2,7 +2,7 @@
````json
//[doc-params]
{
"UI": ["MVC","Blazor","NG"],
"UI": ["MVC","Blazor","BlazorServer","NG"],
"DB": ["EF","Mongo"]
}
````

@ -2,7 +2,7 @@
````json
//[doc-params]
{
"UI": ["MVC","Blazor","NG"],
"UI": ["MVC","Blazor","BlazorServer","NG"],
"DB": ["EF","Mongo"]
}
````

@ -2,7 +2,7 @@
````json
//[doc-params]
{
"UI": ["MVC","Blazor","NG"],
"UI": ["MVC","Blazor","BlazorServer","NG"],
"DB": ["EF","Mongo"]
}
````
@ -267,7 +267,7 @@ public async Task<AuthorDto> CreateAsync(CreateAuthorDto input)
````
* `CreateAsync` requires the `BookStorePermissions.Authors.Create` permission (in addition to the `BookStorePermissions.Authors.Default` declared for the `AuthorAppService` class).
* Used the `AuthorManeger` (domain service) to create a new author.
* Used the `AuthorManager` (domain service) to create a new author.
* Used the `IAuthorRepository.InsertAsync` to insert the new author to the database.
* Used the `ObjectMapper` to return an `AuthorDto` representing the newly created author.
@ -566,4 +566,4 @@ Created some tests for the application service methods, which should be clear to
## The Next Part
See the [next part](Part-9.md) of this tutorial.
See the [next part](Part-9.md) of this tutorial.

@ -2,7 +2,7 @@
````json
//[doc-params]
{
"UI": ["MVC","Blazor","NG"],
"UI": ["MVC","Blazor","BlazorServer","NG"],
"DB": ["EF","Mongo"]
}
````
@ -792,7 +792,7 @@ Open the `/src/app/author/author.component.html` and replace the content as belo
</ng-template>
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
{%{{{ '::Close' | abpLocalization }}}%}
</button>
@ -832,7 +832,7 @@ That's all! This is a fully working CRUD page, you can create, edit and delete a
{{end}}
{{if UI == "Blazor"}}
{{if UI == "Blazor" || UI == "BlazorServer"}}
## The Author Management Page

@ -0,0 +1,824 @@
# Quick Start
````json
//[doc-params]
{
"UI": ["MVC", "Blazor", "BlazorServer", "NG"],
"DB": ["EF", "Mongo"]
}
````
This is a single-part, quick-start tutorial to build a simple todo application with the ABP Framework. Here, a screenshot from the final application:
![todo-list](todo-list.png)
You can find source code of the completed application [here](https://github.com/abpframework/abp-samples/tree/master/TodoApp).
## Pre-Requirements
* An IDE (e.g. [Visual Studio](https://visualstudio.microsoft.com/vs/)) that supports [.NET 5.0+](https://dotnet.microsoft.com/download/dotnet) development.
{{if DB=="Mongo"}}
* [MongoDB Server 4.0+](https://docs.mongodb.com/manual/administration/install-community/)
{{end}}
{{if UI=="NG"}}
* [Node v14.x](https://nodejs.org/)
{{end}}
## Creating a New Solution
We will use the [ABP CLI](../../CLI.md) to create new solutions with the ABP Framework. You can run the following command in a command-line terminal to install it:
````bash
dotnet tool install -g Volo.Abp.Cli
````
Then create an empty folder, open a command-line terminal and execute the following command in the terminal:
````bash
abp new TodoApp{{if UI=="Blazor"}} -u blazor{{else if UI=="BlazorServer"}} -u blazor-server{{else if UI=="NG"}} -u angular{{end}}{{if DB=="Mongo"}} -d mongodb{{end}}
````
{{if UI=="NG"}}
This will create a new solution, named *TodoApp* with `angular` and `aspnet-core` folders. Once the solution is ready, open the ASP.NET Core solution in your favorite IDE.
{{else}}
This will create a new solution, named *TodoApp*. Once the solution is ready, open it in your favorite IDE.
{{end}}
### Create the Database
If you are using Visual Studio, right click to the `TodoApp.DbMigrator` project, select *Set as StartUp Project*, then hit *Ctrl+F5* to run it without debugging. It will create the initial database and seed the initial data.
{{if DB=="EF"}}
> Some IDEs (e.g. Rider) may have problems for the first run since *DbMigrator* adds the initial migration and re-compiles the project. In this case, open a command-line terminal in the folder of the `.DbMigrator` project and execute the `dotnet run` command.
{{end}}
### Run the Application
{{if UI=="MVC" || UI=="BlazorServer"}}
It is good to run the application before starting the development. Ensure the {{if UI=="BlazorServer"}}`TodoApp.Blazor`{{else}}`TodoApp.Web`{{end}} project is the startup project, then run the application (Ctrl+F5 in Visual Studio) to see the initial UI:
{{else if UI=="Blazor"}}
It is good to run the application before starting the development. The solution has two main applications;
* `TodoApp.HttpApi.Host` host the server-side HTTP API.
* `TodoApp.Blazor` is the client-side Blazor WebAssembly application.
Ensure the `TodoApp.HttpApi.Host` project is the startup project, then run the application (Ctrl+F5 in Visual Studio) to see the server-side HTTP API on the [Swagger UI](https://swagger.io/tools/swagger-ui/):
![todo-swagger-ui-initial](todo-swagger-ui-initial.png)
You can explore and test your HTTP API with this UI. Now, we can set the `TodoApp.Blazor` as the startup project and run it to open the actual Blazor application UI:
{{else if UI=="NG"}}
It is good to run the application before starting the development. The solution has two main applications;
* `TodoApp.HttpApi.Host` (in the .NET solution) host the server-side HTTP API.
* `angular` folder contains the Angular application.
Ensure the `TodoApp.HttpApi.Host` project is the startup project, then run the application (Ctrl+F5 in Visual Studio) to see the server-side HTTP API on the [Swagger UI](https://swagger.io/tools/swagger-ui/):
![todo-swagger-ui-initial](todo-swagger-ui-initial.png)
You can explore and test your HTTP API with this UI. If that works, we can run the Angular client application.
First, run the following command to restore the NPM packages;
````bash
npm install
````
It will take some time to install all the packages. Then you can run the application using the following command:
````bash
npm start
````
This command takes time, but eventually runs and opens the application in your default browser:
{{end}}
![todo-ui-initial](todo-ui-initial.png)
You can click to the *Login* button, use `admin` as the username and `1q2w3E*` as the password to login to the application.
All ready. We can start the coding!
## Domain Layer
This application has a single [entity](../../Entities.md) and we are starting by creating it. Create a new `TodoItem` class inside the *TodoApp.Domain* project:
````csharp
using System;
using Volo.Abp.Domain.Entities;
namespace TodoApp
{
public class TodoItem : BasicAggregateRoot<Guid>
{
public string Text { get; set; }
}
}
````
`BasicAggregateRoot` is one the simplest base class to create root entities, and `Guid` is the primary key (`Id`) of the entity here.
## Database Integration
{{if DB=="EF"}}
Next step is to setup the [Entity Framework Core](../../Entity-Framework-Core.md) configuration.
### Mapping Configuration
Open the `TodoAppDbContext` class in the `EntityFrameworkCore` folder of the *TodoApp.EntityFrameworkCore* project and add a new `DbSet` property to this class:
````csharp
public DbSet<TodoItem> TodoItems { get; set; }
````
Then open the `TodoAppDbContextModelCreatingExtensions` class in the same folder and add a mapping configuration for the `TodoItem` class as shown below:
````csharp
public static void ConfigureTodoApp(this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
builder.Entity<TodoItem>(b =>
{
b.ToTable("TodoItems");
});
}
````
We've mapped `TodoItem` entity to a `TodoItems` table in the database.
### Code First Migrations
The startup solution is configured to use Entity Framework Core [Code First Migrations](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations). Since we've changed the database mapping configuration, we should create a new migration and apply changes to the database.
Open a command-line terminal in the directory of the *TodoApp.EntityFrameworkCore.DbMigrations* project and type the following command:
````bash
dotnet ef migrations add Added_TodoItem
````
This will add a new migration class to the project:
![todo-efcore-migration](todo-efcore-migration.png)
You can apply changes to the database using the following command, in the same command-line terminal:
````bash
dotnet ef database update
````
> If you are using Visual Studio, you may want to use `Add-Migration Added_TodoItem` and `Update-Database` commands in the *Package Manager Console (PMC)*. In this case, ensure that {{if UI=="MVC"}}`TodoApp.Web`{{else if UI=="BlazorServer"}}`TodoApp.Blazor`{{else if UI=="Blazor" || UI=="NG"}}`TodoApp.HttpApi.Host`{{end}} is the startup project and `TodoApp.EntityFrameworkCore.DbMigrations` is the *Default Project* in PMC.
{{else if DB=="Mongo"}}
Next step is to setup the [MongoDB](../../MongoDB.md) configuration. Open the `TodoAppMongoDbContext` class in the `MongoDb` folder of the *TodoApp.MongoDB* project and make the following changes;
1. Add a new property to the class:
````csharp
public IMongoCollection<TodoItem> TodoItems => Collection<TodoItem>();
````
2. Add the following code inside the `CreateModel` method:
````csharp
modelBuilder.Entity<TodoItem>(b =>
{
b.CollectionName = "TodoItems";
});
````
{{end}}
Now, we can use ABP repositories to save and retrieve todo items, as we'll do in the next section.
## Application Layer
An [Application Service](../../Application-Services.md) is used to perform use cases of the application. We need to perform the following use cases;
* Get the list of todo items
* Create a new todo item
* Delete an existing todo item
### Application Service Interface
We can start by defining an interface for the application service. Create a new `ITodoAppService` interface in the *TodoApp.Application.Contracts* project, as shown below:
````csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
namespace TodoApp
{
public interface ITodoAppService : IApplicationService
{
Task<List<TodoItemDto>> GetListAsync();
Task<TodoItemDto> CreateAsync(string text);
Task DeleteAsync(Guid id);
}
}
````
### Data Transfer Object
`GetListAsync` and `CreateAsync` methods return `TodoItemDto`. Applications Services typically gets and returns DTOs ([Data Transfer Objects](../../Data-Transfer-Objects.md)) instead of entities. So, we should define the DTO class here. Create a new `TodoItemDto` class inside the *TodoApp.Application.Contracts* project:
````csharp
using System;
namespace TodoApp
{
public class TodoItemDto
{
public Guid Id { get; set; }
public string Text { get; set; }
}
}
````
This is a very simple DTO class that matches to our `TodoItem` entity. We are ready to implement the `ITodoAppService`.
### Application Service Implementation
Create a `TodoAppService` class inside the *TodoApp.Application* project, as shown below:
````csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
namespace TodoApp
{
public class TodoAppService : ApplicationService, ITodoAppService
{
private readonly IRepository<TodoItem, Guid> _todoItemRepository;
public TodoAppService(IRepository<TodoItem, Guid> todoItemRepository)
{
_todoItemRepository = todoItemRepository;
}
// TODO: Implement the methods here...
}
}
````
This class inherits from the `ApplicationService` class of the ABP Framework and implements the `ITodoAppService` that was defined before. ABP provides default generic [repositories](../../Repositories.md) for the entities. We can use them to perform the fundamental database operations. This class [injects](../../Dependency-Injection.md) `IRepository<TodoItem, Guid>`, which is the default repository for the `TodoItem` entity. We will use it to implement the use cases described before.
#### Getting Todo Items
Let's start by implementing the `GetListAsync` method:
````csharp
public async Task<List<TodoItemDto>> GetListAsync()
{
var items = await _todoItemRepository.GetListAsync();
return items
.Select(item => new TodoItemDto
{
Id = item.Id,
Text = item.Text
}).ToList();
}
````
We are simply getting the complete `TodoItem` list from database, mapping them to `TodoItemDto` objects and returning as the result.
#### Creating a New Todo Item
Next method is `CreateAsync` and we can implement it as shown below:
````csharp
public async Task<TodoItemDto> CreateAsync(string text)
{
var todoItem = await _todoItemRepository.InsertAsync(
new TodoItem {Text = text}
);
return new TodoItemDto
{
Id = todoItem.Id,
Text = todoItem.Text
};
}
````
Repository's `InsertAsync` method inserts the given `TodoItem` to database and returns the same `TodoItem` object. It also sets the `Id`, so we can use it on the returning object. We are simply returning a `TodoItemDto` by creating from the new `TodoItem` entity.
#### Deleting a Todo Item
Finally, we can implement the `DeleteAsync` as the following code block:
````csharp
public async Task DeleteAsync(Guid id)
{
await _todoItemRepository.DeleteAsync(id);
}
````
The application service is ready to be used from the UI layer.
## User Interface Layer
It is time to show the todo items on the UI! Before starting to write the code, it would be good to remember what we are trying to build. Here, a sample screenshot from the final UI:
![todo-list](todo-list.png)
> **We will keep the UI side minimal for this tutorial to make the tutorial simple and focused. See the [web application development tutorial](../Part-1.md) to build real-life pages with all aspects.**
{{if UI=="MVC"}}
### Index.cshtml.cs
Open the `Index.cshtml.cs` file in the `Pages` folder of the *TodoApp.Web* project and replace the content with the following code block:
````csharp
using System.Collections.Generic;
using System.Threading.Tasks;
namespace TodoApp.Web.Pages
{
public class IndexModel : TodoAppPageModel
{
public List<TodoItemDto> TodoItems { get; set; }
private readonly ITodoAppService _todoAppService;
public IndexModel(ITodoAppService todoAppService)
{
_todoAppService = todoAppService;
}
public async Task OnGetAsync()
{
TodoItems = await _todoAppService.GetListAsync();
}
}
}
````
This class uses the `ITodoAppService` to get the list of todo items and assign the the `TodoItems` property. We will use it to render the todo items on the razor page.
### Index.cshtml
Open the `Index.cshtml` file in the `Pages` folder of the *TodoApp.Web* project and replace with the following content:
````xml
@page
@model TodoApp.Web.Pages.IndexModel
@section styles {
<abp-style src="/Pages/Index.css" />
}
@section scripts {
<abp-script src="/Pages/Index.js" />
}
<div class="container">
<abp-card>
<abp-card-header>
<abp-card-title>
TODO LIST
</abp-card-title>
</abp-card-header>
<abp-card-body>
<!-- FORM FOR NEW TODO ITEMS -->
<form id="NewItemForm" class="form-inline">
<input id="NewItemText"
type="text"
class="form-control mr-2"
placeholder="enter text...">
<button type="submit" class="btn btn-primary">Submit</button>
</form>
<!-- TODO ITEMS LIST -->
<ul id="TodoList">
@foreach (var todoItem in Model.TodoItems)
{
<li data-id="@todoItem.Id">
<i class="fa fa-trash-o"></i> @todoItem.Text
</li>
}
</ul>
</abp-card-body>
</abp-card>
</div>
````
We are using ABP's [card tag helper](../../UI/AspNetCore/Tag-Helpers/Cards.md) to create a simple card view. You could directly use the standard bootstrap HTML structure, however the ABP [tag helpers]() make it much easier and type safe.
This page imports a CSS and a JavaScript file, so we should also create them.
### Index.js
Open the `Index.js` file in the `Pages` folder of the *TodoApp.Web* project and replace with the following content:
````js
$(function () {
// DELETING ITEMS /////////////////////////////////////////
$('#TodoList').on('click', 'li i', function(){
var $li = $(this).parent();
var id = $li.attr('data-id');
todoApp.todo.delete(id).then(function(){
$li.remove();
abp.notify.info('Deleted the todo item.');
});
});
// CREATING NEW ITEMS /////////////////////////////////////
$('#NewItemForm').submit(function(e){
e.preventDefault();
var todoText = $('#NewItemText').val();
todoApp.todo.create(todoText).then(function(result){
$('<li data-id="' + result.id + '">')
.html('<i class="fa fa-trash-o"></i> ' + result.text)
.appendTo($('#TodoList'));
$('#NewItemText').val('');
});
});
});
````
In the first part, we are registering to click events of the trash icons near to the todo items, deleting the related item on the server and showing a notification on the UI. Also, we are removing the deleted item from DOM, so we don't need to refresh the page.
In the second part, we are creating a new todo item on the server. If it succeed, we are then manipulating DOM to insert a new `<li>` element to the todo list. In this way, no need to refresh the whole page after creating a new todo item.
The interesting part here is how we communicate with the server. See the *Dynamic JavaScript Proxies & Auto API Controllers* section to understand how it works. But now, let's continue and complete the application.
### Index.css
As the final touch, open the `Index.css` file in the `Pages` folder of the *TodoApp.Web* project and replace with the following content:
````css
#TodoList{
list-style: none;
margin: 0;
padding: 0;
}
#TodoList li {
padding: 5px;
margin: 5px 0px;
border: 1px solid #cccccc;
background-color: #f5f5f5;
}
#TodoList li i
{
opacity: 0.5;
}
#TodoList li i:hover
{
opacity: 1;
color: #ff0000;
cursor: pointer;
}
````
This is a simple styling for the todo page. We believe that you can do much better :)
Now, you can run the application again to see the result.
### Dynamic JavaScript Proxies & Auto API Controllers
In the `Index.js` file, we've used `todoApp.todo.delete(...)` and `todoApp.todo.create(...)` functions to communicate with the server. These functions are dynamically created by the ABP Framework, thanks to the [Dynamic JavaScript Client Proxy](../../UI/AspNetCore/Dynamic-JavaScript-Proxies.md) system. They perform HTTP API calls to the server and return a promise, so you can register a callback to the `then` function as we've done above.
However, you may ask that we haven't created any API Controller, so how server handles these requests? This question brings us the [Auto API Controller](../../API/Auto-API-Controllers.md) feature of the ABP Framework. It automatically converts the application services to API Controllers by conventions.
If you open the [Swagger UI](https://swagger.io/tools/swagger-ui/) by entering the `/swagger` URL in your application, you can see the Todo API:
![todo-api](todo-api.png)
{{else if UI=="Blazor" || UI=="BlazorServer"}}
### Index.razor.cs
Open the `Index.razor.cs` file in the `Pages` folder of the *TodoApp.Blazor* project and replace the content with the following code block:
````csharp
using Microsoft.AspNetCore.Components;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace TodoApp.Blazor.Pages
{
public partial class Index
{
[Inject]
private ITodoAppService TodoAppService { get; set; }
private List<TodoItemDto> TodoItems { get; set; } = new List<TodoItemDto>();
private string NewTodoText { get; set; }
protected async override Task OnInitializedAsync()
{
TodoItems = await TodoAppService.GetListAsync();
}
private async Task Create()
{
var result = await TodoAppService.CreateAsync(NewTodoText);
TodoItems.Add(result);
NewTodoText = null;
}
private async Task Delete(TodoItemDto todoItem)
{
await TodoAppService.DeleteAsync(todoItem.Id);
await Notify.Info("Deleted the todo item.");
TodoItems.Remove(todoItem);
}
}
}
````
This class uses the `ITodoAppService` to perform operations for the todo items. It manipulates the `TodoItems` list after create and delete operations. In this way, we don't need to refresh the whole todo list from the server.
{{if UI=="Blazor"}}
See the *Dynamic C# Proxies & Auto API Controllers* section below to learn how we could inject and use the application service interface from the Blazor application which is running on the browser! But now, let's continue and complete the application.
{{end # Blazor}}
### Index.razor
Open the `Index.razor` file in the `Pages` folder of the *TodoApp.Blazor* project and replace the content with the following code block:
````xml
@page "/"
@inherits TodoAppComponentBase
<div class="container">
<Card>
<CardHeader>
<CardTitle>
TODO LIST
</CardTitle>
</CardHeader>
<CardBody>
<!-- FORM FOR NEW TODO ITEMS -->
<form id="NewItemForm"
@onsubmit:preventDefault
@onsubmit="() => Create()"
class="form-inline">
<input type="text"
@bind-value="@NewTodoText"
class="form-control mr-2"
placeholder="enter text...">
<button type="submit" class="btn btn-primary">Submit</button>
</form>
<!-- TODO ITEMS LIST -->
<ul id="TodoList">
@foreach (var todoItem in TodoItems)
{
<li data-id="@todoItem.Id">
<i class="far fa-trash-alt"
@onclick="() => Delete(todoItem)"
></i> @todoItem.Text
</li>
}
</ul>
</CardBody>
</Card>
</div>
````
### Index.razor.css
As the final touch, open the `Index.razor.css` file in the `Pages` folder of the *TodoApp.Web* project and replace with the following content:
````css
#TodoList{
list-style: none;
margin: 0;
padding: 0;
}
#TodoList li {
padding: 5px;
margin: 5px 0px;
border: 1px solid #cccccc;
background-color: #f5f5f5;
}
#TodoList li i
{
opacity: 0.5;
}
#TodoList li i:hover
{
opacity: 1;
color: #ff0000;
cursor: pointer;
}
````
This is a simple styling for the todo page. We believe that you can do much better :)
Now, you can run the application again to see the result.
{{if UI=="Blazor"}}
### Dynamic C# Proxies & Auto API Controllers
In the `Index.razor.cs` file, we've injected (with the `[Inject]` attribute) and used the `ITodoAppService` just like using a local service. Remember that the Blazor application is running on the browser while the implementation of this application service is running on the server.
The magic is done by the ABP Framework's [Dynamic C# Client Proxy](../../API/Dynamic-CSharp-API-Clients.md) system. It uses the standard `HttpClient` and performs HTTP API requests to the remote server. It also handles all the standard tasks for us, including authorization, JSON serialization and exception handling.
However, you may ask that we haven't created any API Controller, so how server handles these requests? This question brings us the [Auto API Controller](../../API/Auto-API-Controllers.md) feature of the ABP Framework. It automatically converts the application services to API Controllers by conventions.
If you run the `TodoApp.HttpApi.Host` application, you can see the Todo API:
![todo-api](todo-api.png)
{{end # Blazor}}
{{else if UI=="NG"}}
### Service Proxy Generation
ABP provides a handy feature to automatically create client-side services to easily consume HTTP APIs provided by the server.
You first need to run the `TodoApp.HttpApi.Host` project since the proxy generator reads API definitions from the server application.
> **Warning**: There is a problem with IIS Express; it doesn't allow to connect to the application from another process. If you are using Visual Studio, select the `TodoApp.HttpApi.Host` instead of IIS Express in the run button drop-down list, as shown in the figure below:
![run-without-iisexpress](run-without-iisexpress.png)
Once you run the `TodoApp.HttpApi.Host` project, open a command-line terminal in the `angular` folder and type the following command:
````bash
abp generate-proxy
````
If everything goes well, it should generate an output like shown below:
````bash
CREATE src/app/proxy/generate-proxy.json (170978 bytes)
CREATE src/app/proxy/README.md (1000 bytes)
CREATE src/app/proxy/todo.service.ts (794 bytes)
CREATE src/app/proxy/models.ts (66 bytes)
CREATE src/app/proxy/index.ts (58 bytes)
````
We can then use the `todoService` to use the server-side HTTP APIs, as we'll do in the next section.
### home.component.ts
Open the `/angular/src/app/home/home.component.ts` file and replace its content with the following code block:
````js
import { ToasterService } from '@abp/ng.theme.shared';
import { Component, OnInit } from '@angular/core';
import { TodoItemDto, TodoService } from '@proxy';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
todoItems: TodoItemDto[];
newTodoText: string;
constructor(
private todoService: TodoService,
private toasterService: ToasterService)
{ }
ngOnInit(): void {
this.todoService.getList().subscribe(response => {
this.todoItems = response;
});
}
create(): void{
this.todoService.create(this.newTodoText).subscribe((result) => {
this.todoItems = this.todoItems.concat(result);
this.newTodoText = null;
});
}
delete(id: string): void {
this.todoService.delete(id).subscribe(() => {
this.todoItems = this.todoItems.filter(item => item.id !== id);
this.toasterService.info('Deleted the todo item.');
});
}
}
````
We've used the `todoService` to get the list of todo items and assigned the returning value to the `todoItems` array. We've also added `create` and `delete` methods. These methods will be used in the view side.
### home.component.html
Open the `/angular/src/app/home/home.component.html` file and replace its content with the following code block:
````html
<div class="container">
<div class="card">
<div class="card-header">
<div class="card-title">TODO LIST</div>
</div>
<div class="card-body">
<!-- FORM FOR NEW TODO ITEMS -->
<form class="form-inline" (ngSubmit)="create()">
<input
name="NewTodoText"
type="text"
[(ngModel)]="newTodoText"
class="form-control mr-2"
placeholder="enter text..."
/>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
<!-- TODO ITEMS LIST -->
<ul id="TodoList">
<li *ngFor="let todoItem of todoItems">
<i class="fa fa-trash-o" (click)="delete(todoItem.id)"></i> {%{{{ todoItem.text }}}%}
</li>
</ul>
</div>
</div>
</div>
````
### home.component.scss
As the final touch, open the `/angular/src/app/home/home.component.scss` file and replace its content with the following code block:
````css
#TodoList{
list-style: none;
margin: 0;
padding: 0;
}
#TodoList li {
padding: 5px;
margin: 5px 0px;
border: 1px solid #cccccc;
background-color: #f5f5f5;
}
#TodoList li i
{
opacity: 0.5;
}
#TodoList li i:hover
{
opacity: 1;
color: #ff0000;
cursor: pointer;
}
````
This is a simple styling for the todo page. We believe that you can do much better :)
Now, you can run the application again to see the result.
{{end}}
## Conclusion
In this tutorial, we've build a very simple application to warm up to the ABP Framework. If you are looking to build a serious application, please check the [web application development tutorial](../Part-1.md) which covers all the aspects of a real-life web application development.
## Source Code
You can find source code of the completed application [here](https://github.com/abpframework/abp-samples/tree/master/TodoApp).
## See Also
* [Web Application Development Tutorial](../Part-1.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@ -180,7 +180,7 @@ Let's employ dependency injection to extend the functionality of `IdentityModule
</ng-template>
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
{%{{{ 'AbpUi::Close' | abpLocalization }}}%}
</button>
</ng-template>

@ -215,7 +215,7 @@ Open the generated `src/app/my-role/my-role.component.html` file and replace its
</ng-template>
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
{%{{{ 'AbpIdentity::Cancel' | abpLocalization }}}%}
</button>
<abp-button iconClass="fa fa-check" [disabled]="form?.invalid" (click)="save()">{%{{{

@ -6,7 +6,7 @@ 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 close button which has a `abpClose` directive attached to 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.
@ -47,7 +47,7 @@ You can add the `abp-modal` to your component very quickly. See an example:
</ng-template>
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>Close</button>
<button type="button" class="btn btn-secondary" abpClose>Close</button>
</ng-template>
</abp-modal>
```
@ -116,7 +116,7 @@ See an example form inside a modal:
</ng-template>
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
Cancel
</button>

@ -0,0 +1,218 @@
# Page Component
ABP provides a component that wraps your content with some built-in components to reduce the amount of code you need to write.
If the template of a component looks as follows, you can utilize the `abp-page` component.
Let's look at the following example without `abp-page` component.
`dashboard.component.ts`
```html
<div class="row entry-row">
<div class="col-auto">
<h1 class="content-header-title">{{ '::Dashboard' | abpLocalization }}</h1>
</div>
<div id="breadcrumb" class="col-lg-auto pl-lg-0">
<abp-breadcrumb></abp-breadcrumb>
</div>
<div class="col">
<abp-page-toolbar [record]="data"></abp-page-toolbar>
</div>
</div>
<div id="dashboard-id">
<!-- dashboard content here -->
</div>
```
## Page Parts
PageComponent divides the template shown above into three parts, `title`, `breadcrumb`, `toolbar`. Each can be configured separately. There, also, is an enum exported from the package that describes each part.
```javascript
export enum PageParts {
title = 'PageTitleContainerComponent',
breadcrumb = 'PageBreadcrumbContainerComponent',
toolbar = 'PageToolbarContainerComponent',
}
// You can import this enum from -> import { PageParts } from '@abp/ng.components/page';
```
## Usage
Firstly, you need to import `PageModule` from `@abp/ng.components/page` as follows:
`dashboard.module.ts`
```javascript
import { PageModule } from '@abp/ng.components/page';
import { DashboardComponent } from './dashboard.component';
@NgModule({
declarations: [DashboardComponent],
imports: [PageModule]
})
export class DashboardModule {}
```
And change the template of `dashboard.component.ts` to the following:
```html
<abp-page [title]="'::Dashboard' | abpLocalization" [toolbar]="data">
<div id="dashboard-id">
<!-- .... -->
</div>
</abp-page>
```
## Inputs
* title: `string`: Will be be rendered within `h1.content-header-title`. If not provided, the parent `div` will not be rendered
* breadcrumb: `boolean`: Determines whether to render `abp-breadcrumb`. Default is `true`.
* toolbar: `any`: Will be passed into `abp-page-toolbar` component through `record` input. If your page does not contain `abp-page-toolbar`, you can simply omit this field.
## Overriding template
If you need to replace the template of any part, you can use the following sub-components.
```html
<abp-page>
<abp-page-title-container>
<div class="col">
<h2>Custom Title</h2>
</div>
</abp-page-title-container>
<abp-page-breacrumb-container>
<div class="col">
<my-breadcrumb></my-breadcrumb>
</div>
</abp-page-breacrumb-container>
<abp-page-toolbar-container>
<div class="col">
<!-- ... -->
</div>
</abp-page-toolbar-container>
</abp-page>
```
You do not have to provide them all. You can just use which one you need to replace. These components have priority over the inputs declared above. If you use these components, you can omit the inputs.
## PagePartDirective
`PageModule` provides a structural directive that is used internally within `PageComponent` and can also be used externally.
`PageComponent` employs this directive internally as follows:
```html
<div class="col-lg-auto pl-lg-0" *abpPagePart="pageParts.breadcrumb">
<abp-breadcrumb></abp-breadcrumb>
</div>
```
It also can take a context input as follows:
```html
<div class="col" *abpPagePart="pageParts.toolbar; context: toolbarData">
<abp-page-toolbar [record]="toolbarData"></abp-page-toolbar>
</div>
```
Its render strategy can be provided through Angular's Dependency Injection system.
It expects a service through the `PAGE_RENDER_STRATEGY` injection token that implements the following interface.
```javascript
interface PageRenderStrategy {
shouldRender(type?: string): boolean | Observable<boolean>;
onInit?(type?: string, injector?: Injector, context?: any): void;
onDestroy?(type?: string, injector?: Injector, context?: any): void;
onContextUpdate?(change?: SimpleChange): void;
}
```
* `shouldRender` (required): It takes a string input named `type` and expects a `boolean` or `Observable<boolean>` in return.
* `onInit` (optional): Will be called when the directive is initiated. Three inputs will be passed into this method.
* `type`: type of the page part
* `injector`: injector of the directive which could be used to retrieve anything from directive's DI tree.
* `context`: whatever context is available at the initialization phase.
* `onDestroy` (optional): Will be called when the directive is destroyed. The parameters are the same with `onInit`
* `onContextUpdate` (optional): Will be called when the context is updated.
* `change`: changes of the `context` will be passed through this method.
Let's see everything in action.
```javascript
import { 
PageModule,
PageRenderStrategy,
PageParts,
PAGE_RENDER_STRATEGY
} from '@abp/ng.components/page';
@Injectable()
export class MyPageRenderStrategy implements PageRenderStrategy {
shouldRender(type: string) {
// meaning everything but breadcrumb and custom-part will be rendered
return type !== PageParts.breadcrumb && type !== 'custom-part';
}
/**
* shouldRender can also return an Observable<boolean> which means
* an async service can be used within.
constructor(private service: SomeAsyncService) {}
shouldRender(type: string) {
return this.service.checkTypeAsync(type).pipe(map(val => val.isTrue()));
}
*/
onInit(type: string, injector: Injector, context: any) {
// this method will be called in ngOnInit of the directive
}
onDestroy(type: string, injector: Injector, context: any) {
// this method will be called in ngOnDestroy of the directive
}
onContextUpdate?(change?: SimpleChange) {
// this method will be called everytime context is updated within the directive
}
}
@Component({
selector: 'app-dashboard',
template: `
<abp-page [title]="'::Dashboard' | abpLocalization">
<abp-page-toolbar-container>
<button>New Dashboard</button>
</abp-page-toolbar-container>
<div class="dashboard-content">
<h3 *abpPagePart="'custom-part'"> Inner Title </h3>
</div>
</abp-page>
`
})
export class DashboardComponent {}
@NgModule({
imports: [PageModule],
declarations: [DashboardComponent],
providers: [
{
provide: PAGE_RENDER_STRATEGY,
useClass: MyPageRenderStrategy,
}
]
})
export class DashboardModule {}
```
## See Also
- [Page Toolbar Extensions for Angular UI](./Page-Page-Toolbar-Extensions.md)

@ -459,7 +459,7 @@ Open the generated `permission-management.component.html` in `src/app/permission
</div>
</ng-template>
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
{%{{{ 'AbpIdentity::Cancel' | abpLocalization }}}%}
</button>
<abp-button iconClass="fa fa-check" (click)="submit()">{%{{{

@ -10,6 +10,8 @@ To avoid manual effort, we might use a tool like [NSWAG](https://github.com/Rico
ABP introduces an endpoint that exposes server-side method contracts. When the `generate-proxy` command is run, ABP CLI makes an HTTP request to this endpoint and generates better-aligned client proxies in TypeScript. It organizes folders according to namespaces, adds barrel exports, and reflects method signatures in Angular services.
> Before you start, please make sure you start the backend application with `dotnet run`. There is a [known limitation about Visual Studio](#known-limitations), so please do not run the project using its built-in web server.
Run the following command in the **root folder** of the angular application:
```bash

@ -8,7 +8,7 @@
* Can **block** a UI part (or the full page) during the AJAX operation.
* Allows to fully customize any AJAX call, by using the standard `$.ajax` **options**.
> While `abp.ajax` makes the AJAX call pretty easier, you typically will use the [Dynamic JavaScript Client Proxy](Dynamic-JavaScript-Client-Proxies.md) system to perform calls to your server side HTTP APIs. `abp.ajax` can be used when you need to perform low level AJAX operations.
> While `abp.ajax` makes the AJAX call pretty easier, you typically will use the [Dynamic JavaScript Client Proxy](../Dynamic-JavaScript-Proxies.md) system to perform calls to your server side HTTP APIs. `abp.ajax` can be used when you need to perform low level AJAX operations.
## Basic Usage

@ -1,3 +0,0 @@
# ASP.NET Core MVC / Razor Pages UI: Dynamic JavaScript Client Proxies
TODO

@ -0,0 +1,128 @@
# Data Table Column Extensions for Blazor UI
Data table column extension system allows you to add a **new table column** on the user interface. The example below adds a new column with the "Email Confirmed" title:
![datatable-column-extension-](../../images/table-column-extension-example-blazor.png)
You can use the standard column options to fine control the table column.
> Note that this is a low level API to find control the table column. If you want to show an extension property on the table, see the [module entity extension](../../Module-Entity-Extensions.md) document.
## How to Set Up
### Create a C# File
First, add a new C# file to your solution. We added inside the `/Pages/Identity/` folder of the `.Blazor` project:
![user-action-extension-on-solution](../../images/user-action-extension-on-blazor-project.png)
We will use the [component override system](Customization-Overriding-Components.md) in the Blazor. After creating a class inherits from the `UserManagement` component, we will override the `SetTableColumnsAsync` method and add the table column programmatically.
Here, the content of the overridden `SetTableColumnsAsync` method.
```csharp
protected override async ValueTask SetTableColumnsAsync()
{
await base.SetTableColumnsAsync();
var confirmedColumn = new TableColumn
{
Title = "Email Confirmed",
Data = nameof(IdentityUserDto.EmailConfirmed)
};
TableColumns.Get<UserManagement>().Add(confirmedColumn);
}
```
Here, the entire content of the file.
```csharp
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Components.Web.Extensibility.TableColumns;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.Identity.Blazor.Pages.Identity;
namespace MyCompanyName.MyProjectName.Blazor.Pages.Identity
{
[ExposeServices(typeof(UserManagement))]
[Dependency(ReplaceServices = true)]
public class CustomizedUserManagement : UserManagement
{
protected override async ValueTask SetTableColumnsAsync()
{
await base.SetTableColumnsAsync();
var confirmedColumn = new TableColumn
{
Title = "Email Confirmed",
Data = nameof(IdentityUserDto.EmailConfirmed)
};
TableColumns.Get<UserManagement>().Add(confirmedColumn);
}
}
}
```
## Customizing Data Table Columns
This section explains how to customize data table columns using the properties in the `TableColumn` type.
* `Title`: Title of the column.
* `Data`: Name of the field in the supplied model.
* `Component`: Type of the component that you want to render. See the "Rendering Custom Components In The Data Table Columns" section for details.
* `Actions`: Action lists for the column. You can render additional action columns by adding actions to this collection.
* `ValueConverter`: Simple converter function that is being called before rendering the content.
* `Sortable`: A boolean field indicating whether the column is sortable or not.
* `DisplayFormat`: You can specify a custom format for the column.
* `DisplayFormatProvider` : You can provide a custom `IFormatProvider` for the column. Default value is `CultureInfo.CurrentCulture`.
## Rendering Custom Components In The Data Table Columns
This section explains how to render custom blazor components in data table columns. In this example, we're going to display custom icons instead of text representations of the property.
First of all, create a blazor component. We will name it `CustomTableColumn`.
![data-table-colum-extension-blazor-component-render-solution](../../images/data-table-colum-extension-blazor-component-render-solution.png)
Add an object parameter named `Data`.
```csharp
public class CustomTableColumn
{
[Parameter]
public object Data { get; set; }
}
```
Navigate to the razor file and paste the following code.
```csharp
@using System
@using Volo.Abp.Identity
@if (Data.As<IdentityUserDto>().EmailConfirmed)
{
<Icon class="text-success" Name="IconName.Check" />
}
else
{
<Icon class="text-danger" Name="IconName.Times" />
}
```
Navigate back to the `CustomizedUserManagement` class, and use `Component` property to specify the custom blazor component.
```csharp
protected override async ValueTask SetTableColumnsAsync()
{
await base.SetTableColumnsAsync();
var confirmedColumn = new TableColumn
{
Title = "Email Confirmed",
Component = typeof(CustomTableColumn)
};
TableColumns.Get<UserManagement>().Add(confirmedColumn);
}
```
Run the project and you will see the icons instead of text fields.
![data-table-colum-extension-blazor-component-render](../../images/data-table-colum-extension-blazor-component-render.png)

@ -0,0 +1,110 @@
# Entity Action Extensions for Blazor UI
Entity action extension system allows you to add a **new action** to the action menu for an entity. A **Click Me** action was added to the *User Management* page below:
![user-action-extension-click-me](../../images/user-action-blazor-extension-click-me.png)
You can take any action (open a modal, make an HTTP API call, redirect to another page... etc) by writing your custom code. You can access to the current entity in your code.
## How to Set Up
In this example, we will add a "Click Me!" action and execute a C# code for the user management page of the [Identity Module](../../Modules/Identity.md).
### Create a C# File
First, add a new C# file to your solution. We added inside the `/Pages/Identity/` folder of the `.Blazor` project:
![user-action-extension-on-solution](../../images/user-action-extension-on-blazor-project.png)
We will use the [component override system](Customization-Overriding-Components.md) in the Blazor. After creating a class inherits from the `UserManagement` component, we will override the `SetEntityActionsAsync` method and add the entity action programmatically.
Here, the content of the overridden `SetEntityActionsAsync` method.
```csharp
protected override async ValueTask SetEntityActionsAsync()
{
await base.SetEntityActionsAsync();
var clickMeAction = new EntityAction()
{
Text = "Click Me!",
Clicked = (data) =>
{
//TODO: Write your custom code
return Task.CompletedTask;
}
};
EntityActions.Get<UserManagement>().Add(clickMeAction);
}
```
In the `Clicked` property, you can do anything you need.
Here, the entire content of the file.
```csharp
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Components.Web.Extensibility.EntityActions;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity.Blazor.Pages.Identity;
namespace MyCompanyName.MyProjectName.Blazor.Pages.Identity
{
[ExposeServices(typeof(UserManagement))]
[Dependency(ReplaceServices = true)]
public class CustomizedUserManagement : UserManagement
{
protected override async ValueTask SetEntityActionsAsync()
{
await base.SetEntityActionsAsync();
var clickMeAction = new EntityAction()
{
Text = "Click Me!",
Clicked = (data) =>
{
//TODO: Write your custom code
return Task.CompletedTask;
}
};
EntityActions.Get<UserManagement>().Add(clickMeAction);
}
}
}
```
## Customizing Entity Actions
This section explains how to customize entity actions using the properties in the `EntityAction` type.
Here, the list of the properties that you use in the `EntityAction`.
* `Text` : Entity action text.
* `Clicked` : Click event handler for the action. You can use the `data` parameter to access the selected item in the `DataGrid`.
* `Icon` : Icon for the action.
* `Color` : Color for the action.
* `Visible`: Visible function to determine the actions' visibility based on the data grid items individually. You can make the action invisible for some data grid items. You can also use the `data` parameter to access the selected item in the `DataGrid`.
* `Confirmation`: Confirmation message for the action. You can use the `data` parameter to access the selected item in the `DataGrid`.
#### Example
```csharp
var clickMeAction = new EntityAction()
{
Text = "Click Me!",
Clicked = (data) =>
{
//TODO: Write your custom code
return Task.CompletedTask;
},
Color = Blazorise.Color.Danger,
Icon = "fas fa-hand-point-right",
ConfirmationMessage = (data) => "Are you sure you want to click to the action?",
Visible = (data) =>
{
//TODO: Write your custom visibility action
//var selectedUser = data.As<IdentityUserDto>();
}
};
```

@ -1,3 +1,90 @@
# Blazor UI: Page Header
TODO
You can use the`PageHeader` component to set the page title, the breadcrumb items and the toolbar items for a page. Before using the `PageHeader` component, you need to add a using statement for the `Volo.Abp.AspNetCore.Components.Web.Theming.Layout` namespace.
Once you add the `PageHeader` component to your page, you can control the related values using the parameters.
## Page Title
You can use the `Title` parameter to control the page header.
```csharp
<PageHeader Title="Book List">
</PageHeader>
```
## Breadcrumb
> **The [Basic Theme](Basic-Theme.md) currently doesn't implement the breadcrumbs.**
Breadcrumbs can be added using the `BreadcrumbItems` property.
**Example: Add Language Management to the breadcrumb items.**
Create a collection of `Volo.Abp.BlazoriseUI.BreadcrumbItem` objects and set the collection to the `BreadcrumbItems` parameter.
```csharp
public partial class Index
{
protected List<BreadcrumbItem> BreadcrumbItems { get; } = new();
protected override void OnInitialized()
{
BreadcrumbItems.Add(new BreadcrumbItem("Language Management"));
}
}
```
Navigate back to the razor page.
```csharp
<PageHeader BreadcrumbItems="@BreadcrumbItems" />
```
The theme then renders the breadcrumb. An example render result can be:
![breadcrumbs-example](../../images/breadcrumbs-example.png)
* The Home icon is rendered by default. Set `BreadcrumbShowHome` to `false` to hide it.
* Breadcrumb items will be activated based on current navigation. Set `BreadcrumbShowCurrent` to `false` to disable it.
You can add as many items as you need. `BreadcrumbItem` constructor gets three parameters:
* `text`: The text to show for the breadcrumb item.
* `url` (optional): A URL to navigate to, if the user clicks to the breadcrumb item.
* `icon` (optional): An icon class (like `fas fa-user-tie` for Font-Awesome) to show with the `text`.
## Page Toolbar
Page toolbar can be set using the `Toolbar` property.
**Example: Add a "New Item" toolbar item to the page toolbar.**
Create a `PageToolbar` object and define toolbar items using the `AddButton` extension method.
```csharp
public partial class Index
{
protected PageToolbar Toolbar { get; } = new();
protected override void OnInitialized()
{
Toolbar.AddButton("New Item", () =>
{
//Write your click action here
return Task.CompletedTask;
}, icon:IconName.Add);
}
}
```
Navigate back to the razor page and set the `Toolbar` parameter.
```csharp
<PageHeader Toolbar="@Toolbar" />
```
An example render result can be:
![breadcrumbs-example](../../images/page-header-toolbar-blazor.png)

@ -0,0 +1,126 @@
# Page Toolbar Extensions for Blazor UI
Page toolbar system allows you to add components to the toolbar of any page. The page toolbar is the area right to the header of a page. A button ("Import users from excel") was added to the user management page below:
![page-toolbar-button](../../images/page-toolbar-button-blazor.png)
You can add any type of view component item to the page toolbar or modify existing items.
## How to Set Up
In this example, we will add an "Import users from excel" button and execute a C# code for the user management page of the [Identity Module](../../Modules/Identity.md).
### Create a C# File
First, add a new C# file to your solution. We added inside the `/Pages/Identity/` folder of the `.Blazor` project:
![user-action-extension-on-solution](../../images/user-action-extension-on-blazor-project.png)
We will use the [component override system](Customization-Overriding-Components.md) in the Blazor. After creating a class inherits from the `UserManagement` component, we will override the `SetToolbarItemsAsync` method and add the toolbar item programmatically.
Here, the content of the overridden `SetToolbarItemsAsync` method.
```csharp
protected override async ValueTask SetToolbarItemsAsync()
{
await base.SetToolbarItemsAsync();
Toolbar.AddButton("Import users from excel", () =>
{
//TODO: Write your custom code
return Task.CompletedTask;
}, "file-import", Blazorise.Color.Secondary);
}
```
> In order to use the `AddButton` extension method, you need to add a using statement for the `Volo.Abp.AspNetCore.Components.Web.Theming.PageToolbars` namespace.
Here, the entire content of the file.
```csharp
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Components.Web.Theming.PageToolbars;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity.Blazor.Pages.Identity;
namespace MyCompanyName.MyProjectName.Blazor.Pages.Identity
{
[ExposeServices(typeof(UserManagement))]
[Dependency(ReplaceServices = true)]
public class CustomizedUserManagement : UserManagement
{
protected override async ValueTask SetToolbarItemsAsync()
{
await base.SetToolbarItemsAsync();
Toolbar.AddButton("Import users from excel", () =>
{
//TODO: Write your custom code
return Task.CompletedTask;
}, "file-import", Blazorise.Color.Secondary);
}
}
}
```
When you run the application, you will see the button added next to the current button list. There are some other parameters of the `AddButton` method (for example, use `Order` to set the order of the button component relative to the other components).
## Advanced Use Cases
While you typically want to add a button action to the page toolbar, it is possible to add any type of blazor component.
### Add A Blazor Component to a Page Toolbar
First, create a new blazor component in your project:
![page-toolbar-custom-component-blazor](../../images/page-toolbar-custom-component-blazor.png)
For this example, we've created a `MyToolbarComponent` component under the `/Pages/Identity/` folder.
`MyToolbarComponent.razor` content:
````csharp
<Button Color="Color.Dark">CLICK ME</Button>
````
We will leave the `MyToolbarComponent.razor.cs` file empty.
Then you can add the `MyToolbarComponent` to the user management page toolbar:
````csharp
protected override async ValueTask SetToolbarItemsAsync()
{
await base.SetToolbarItemsAsync();
Toolbar.AddComponent<MyToolbarComponent>();
}
````
* If your component accepts parameters, you can pass them as key/value pairs using the `arguments` parameter.
#### Permissions
If your button/component should be available based on a [permission/policy](../../Authorization.md), you can pass the permission/policy name as the `RequiredPolicyName` parameter to the `AddButton` and `AddComponent` methods.
### Add a Page Toolbar Contributor
If you perform advanced custom logic while adding an item to a page toolbar, you can create a class that implements the `IPageToolbarContributor` interface or inherits from the `PageToolbarContributor` class:
````csharp
public class MyToolbarContributor : PageToolbarContributor
{
public override Task ContributeAsync(PageToolbarContributionContext context)
{
context.Items.Insert(0, new PageToolbarItem(typeof(MyToolbarComponent)));
return Task.CompletedTask;
}
}
````
* You can use `context.ServiceProvider` to resolve dependencies if you need.
Then add your class to the `Contributors` list:
````csharp
protected override async ValueTask SetToolbarItemsAsync()
{
await base.SetToolbarItemsAsync();
Toolbar.Contributors.Add(new PageContributor());
}
````

@ -1,5 +1,9 @@
{
"items": [
{
"text": "Quick Start",
"path": "Tutorials/Todo/Index.md"
},
{
"text": "Getting Started",
"items": [
@ -281,6 +285,10 @@
}
]
},
{
"text": "SMS Sending",
"path": "SMS-Sending.md"
},
{
"text": "Event Bus",
"items": [
@ -335,6 +343,10 @@
{
"text": "Virtual File System",
"path": "Virtual-File-System.md"
},
{
"text": "Cancellation Token Provider",
"path": "Cancellation-Token-Provider.md"
}
]
},
@ -882,6 +894,15 @@
]
}
]
},
{
"text": "Components",
"items": [
{
"text": "Page",
"path": "UI/Angular/Page-Component.md"
}
]
}
]
},
@ -1004,14 +1025,6 @@
"text": "Background Jobs",
"path": "Modules/Background-Jobs.md"
},
{
"text": "Blogging",
"path": "Modules/Blogging.md"
},
{
"text": "Client Simulation",
"path": "Modules/Client-Simulation.md"
},
{
"text": "CMS Kit",
"path": "Modules/Cms-Kit.md"
@ -1044,10 +1057,6 @@
"text": "Tenant Management",
"path": "Modules/Tenant-Management.md"
},
{
"text": "Users",
"path": "Modules/Users.md"
},
{
"text": "Virtual File Explorer",
"path": "Modules/Virtual-File-Explorer.md"

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

@ -90,7 +90,7 @@ Abra o `book-list.component.html`e adicione o `abp-modal`para mostrar / ocultar
<ng-template #abpBody> </ng-template>
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
Cancel
</button>
</ng-template>
@ -276,7 +276,7 @@ Abra o `book-list.component.html`e adicione um `abp-button`para salvar o formul
```html
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
Cancel
</button>
<button class="btn btn-primary" (click)="save()">

@ -718,7 +718,7 @@ export class BookComponent implements OnInit {
<ng-template #abpBody> </ng-template>
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
{%{{{ '::Close' | abpLocalization }}}%}
</button>
</ng-template>
@ -859,7 +859,7 @@ export class BookComponent implements OnInit {
````html
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
{%{{{ '::Close' | abpLocalization }}}%}
</button>

@ -459,7 +459,7 @@ function getPermissions(groups: PermissionManagement.Group[]): PermissionManagem
</div>
</ng-template>
<ng-template #abpFooter>
<button type="button" class="btn btn-secondary" #abpClose>
<button type="button" class="btn btn-secondary" abpClose>
{%{{{ 'AbpIdentity::Cancel' | abpLocalization }}}%}
</button>
<abp-button iconClass="fa fa-check" (click)="submit()">{%{{{

@ -1,6 +1,7 @@
using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using System.Globalization;
using Volo.Abp.AspNetCore.Components.Web.Extensibility.EntityActions;
namespace Volo.Abp.AspNetCore.Components.Web.Extensibility.TableColumns
@ -11,11 +12,13 @@ namespace Volo.Abp.AspNetCore.Components.Web.Extensibility.TableColumns
public string Data { get; set; }
[CanBeNull]
public string DisplayFormat { get; set; }
public IFormatProvider DisplayFormatProvider { get; set; } = CultureInfo.CurrentCulture;
[CanBeNull]
public Type Component { get; set; }
public List<EntityAction> Actions { get; set; }
[CanBeNull]
public Func<object,string> ValueConverter { get; set; }
public bool Sortable { get; set; }
public TableColumn()
{

@ -1,8 +1,5 @@
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Volo.Abp.AspNetCore.Components.DependencyInjection;
using Volo.Abp.AspNetCore.Components.Web;
using Volo.Abp.AspNetCore.Components.Web.ExceptionHandling;
using Volo.Abp.AspNetCore.Mvc.Client;
@ -32,8 +29,6 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.Replace(ServiceDescriptor.Transient<IComponentActivator, ServiceProviderComponentActivator>());
context.Services
.GetHostBuilder().Logging
.AddProvider(new AbpExceptionHandlingLoggerProvider(context.Services));

@ -115,13 +115,6 @@ namespace Volo.Abp.AspNetCore.Mvc.ContentFormatters
}
}
}
else
{
postedFiles.Add(new RemoteStreamContent(request.Body)
{
ContentType = request.ContentType
});
}
}
}
}

@ -45,19 +45,26 @@ namespace Volo.Abp.AspNetCore.Auditing
var hasError = false;
using (var saveHandle = _auditingManager.BeginScope())
{
Debug.Assert(_auditingManager.Current != null);
try
{
await next(context);
Debug.Assert(_auditingManager.Current != null);
if (_auditingManager.Current.Log.Exceptions.Any())
{
hasError = true;
}
}
catch (Exception)
catch (Exception ex)
{
hasError = true;
if (!_auditingManager.Current.Log.Exceptions.Contains(ex))
{
_auditingManager.Current.Log.Exceptions.Add(ex);
}
throw;
}
finally

@ -25,11 +25,11 @@
if (action.ConfirmationMessage != null)
{
<EntityAction TItem="TItem"
Color="@(action.Color!=null ? (Blazorise.Color)action.Color : Blazorise.Color.Primary)"
Color="@(action.Color != null ? (Blazorise.Color) action.Color : Blazorise.Color.Primary)"
Icon="@action.Icon"
Clicked="async () => await action.Clicked(context)"
ConfirmationMessage="() => action.ConfirmationMessage.Invoke(context)"
Visible="@(action.Visible!=null ? action.Visible(context) : true)"
Visible="@(action.Visible != null ? action.Visible(context) : true)"
Text="@action.Text">
</EntityAction>
}
@ -37,9 +37,9 @@
{
<EntityAction TItem="TItem"
Clicked="async () => await action.Clicked(context)"
Color="@(action.Color!=null ? (Blazorise.Color)action.Color : Blazorise.Color.None)"
Color="@(action.Color != null ? (Blazorise.Color) action.Color : Blazorise.Color.None)"
Icon="@action.Icon"
Visible="@(action.Visible!=null ? action.Visible(context) : true)"
Visible="@(action.Visible != null ? action.Visible(context) : true)"
Text="@action.Text">
</EntityAction>
}
@ -62,7 +62,26 @@
{
if (!ExtensionPropertiesRegex.IsMatch(column.Data))
{
<DataGridColumn TItem="TItem" Field="@column.Data" Caption="@column.Title"/>
@if (column.ValueConverter == null)
{
<DataGridColumn TItem="TItem"
Field="@column.Data"
Caption="@column.Title"
Sortable="@column.Sortable"
DisplayFormat="@column.DisplayFormat"
DisplayFormatProvider="@column.DisplayFormatProvider"/>
}
else
{
<DataGridColumn TItem="TItem"
Field="@column.Data"
Caption="@column.Title"
Sortable="@column.Sortable">
<DisplayTemplate>
@(GetConvertedFieldValue(context, column))
</DisplayTemplate>
</DataGridColumn>
}
}
else
{
@ -87,14 +106,7 @@
{
if (column.ValueConverter != null)
{
if (column.DisplayFormat == null)
{
@(column.ValueConverter(propertyValue))
}
else
{
@(string.Format(column.DisplayFormat, column.ValueConverter(propertyValue)))
}
@(GetConvertedFieldValue(context, column))
}
else
{
@ -104,10 +116,9 @@
}
else
{
@(string.Format(column.DisplayFormat, propertyValue))
@(string.Format(column.DisplayFormatProvider, column.DisplayFormat, propertyValue))
}
}
}
}
</DisplayTemplate>

@ -46,5 +46,17 @@ namespace Volo.Abp.BlazoriseUI.Components
builder.CloseComponent();
};
}
protected virtual string GetConvertedFieldValue(TItem item, TableColumn columnDefinition)
{
var convertedValue = columnDefinition.ValueConverter.Invoke(item);
if (!columnDefinition.DisplayFormat.IsNullOrEmpty())
{
return string.Format(columnDefinition.DisplayFormatProvider, columnDefinition.DisplayFormat,
convertedValue);
}
return convertedValue;
}
}
}

@ -12,7 +12,8 @@
ValueField="item=>item.Value"
SelectedValue="@SelectedValue"
SelectedValueChanged="@SelectedValueChanged"
SearchChanged="@SearchFilterChangedAsync">
SearchChanged="@SearchFilterChangedAsync"
MinLength="0">
</Autocomplete>
</Field>

@ -96,14 +96,26 @@ namespace Volo.Abp.BlazoriseUI.Components.ObjectExtending
return selectItems;
}
protected virtual void SelectedValueChanged(object selectedItem)
protected virtual Task SelectedValueChanged(object selectedItem)
{
SelectedValue = selectedItem;
return Task.CompletedTask;
}
protected async Task SearchFilterChangedAsync(string filter)
{
lookupItems = await GetLookupItemsAsync(filter);
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnAfterRenderAsync(firstRender);
if (firstRender)
{
await SearchFilterChangedAsync(string.Empty);
}
}
}
}

@ -14,10 +14,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Blazorise" Version="0.9.3.3" />
<PackageReference Include="Blazorise.DataGrid" Version="0.9.3.3" />
<PackageReference Include="Blazorise.Snackbar" Version="0.9.3.3" />
<PackageReference Include="Blazorise.Components" Version="0.9.3.3" />
<PackageReference Include="Blazorise" Version="0.9.3.4" />
<PackageReference Include="Blazorise.DataGrid" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Snackbar" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Components" Version="0.9.3.4" />
</ItemGroup>
</Project>

@ -89,7 +89,7 @@ namespace Volo.Abp.Cli.Commands
var preview = commandLineArgs.Options.ContainsKey(Options.Preview.Long);
if (preview)
{
Logger.LogInformation("Preview: yes if any exist for next version.");
Logger.LogInformation("Preview: yes");
}
var databaseProvider = GetDatabaseProvider(commandLineArgs);

@ -59,9 +59,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
return _tyeFileContent;
}
var solutionFolderPath = context.BuildArgs.ExtraProperties[NewCommand.Options.OutputFolder.Short] ??
context.BuildArgs.ExtraProperties[NewCommand.Options.OutputFolder.Long] ??
Directory.GetCurrentDirectory();
var solutionFolderPath = GetSolutionFolderPath(context);
var tyeFilePath = Path.Combine(solutionFolderPath, "tye.yaml");
@ -74,5 +72,20 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
return _tyeFileContent;
}
private static string GetSolutionFolderPath(ProjectBuildContext context)
{
if (context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.OutputFolder.Short))
{
return context.BuildArgs.ExtraProperties[NewCommand.Options.OutputFolder.Short];
}
if (context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.OutputFolder.Long))
{
return context.BuildArgs.ExtraProperties[NewCommand.Options.OutputFolder.Long];
}
return Directory.GetCurrentDirectory();
}
}
}

@ -0,0 +1,35 @@
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
{
public class RemoveDependencyFromPackageJsonFileStep : ProjectBuildPipelineStep
{
private readonly string _packageJsonFilePath;
private readonly string _packageName;
public RemoveDependencyFromPackageJsonFileStep(string packageJsonFilePath, string packageName)
{
_packageJsonFilePath = packageJsonFilePath;
_packageName = packageName;
}
public override void Execute(ProjectBuildContext context)
{
var packageJsonFile = context.Files.FirstOrDefault(f => f.Name == _packageJsonFilePath);
if (packageJsonFile == null)
{
return;
}
var packageJsonObject = JObject.Parse(packageJsonFile.Content);
var dependenciesObject = (JObject) packageJsonObject["dependencies"];
dependenciesObject?.Remove(_packageName);
packageJsonFile.SetContent(packageJsonObject.ToString(Formatting.Indented));
}
}
}

@ -169,10 +169,54 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App
steps.Add(new ChangePublicAuthPortStep());
}
if (!context.BuildArgs.ExtraProperties.ContainsKey("without-cms-kit"))
if (!context.BuildArgs.ExtraProperties.ContainsKey("without-cms-kit") && IsCmsKitSupportedForTargetVersion(context))
{
context.Symbols.Add("CMS-KIT");
}
else
{
RemoveCmsKitDependenciesFromPackageJsonFiles(steps);
}
}
private static void RemoveCmsKitDependenciesFromPackageJsonFiles(List<ProjectBuildPipelineStep> steps)
{
var adminCmsPackageInstalledProjectsPackageJsonFiles = new List<string>
{
"/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/package.json"
};
var publicCmsPackageInstalledProjectsPackageJsonFiles = new List<string>
{
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Public/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Public.Host/package.json"
};
foreach (var packageJsonFile in adminCmsPackageInstalledProjectsPackageJsonFiles)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(packageJsonFile, "@volo/cms-kit-pro.admin"));
}
foreach (var packageJsonFile in publicCmsPackageInstalledProjectsPackageJsonFiles)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(packageJsonFile, "@volo/cms-kit-pro.public"));
}
}
private bool IsCmsKitSupportedForTargetVersion(ProjectBuildContext context)
{
if (string.IsNullOrWhiteSpace(context.BuildArgs.Version))
{
// We'll return true after 4.3.0 stable release. see https://github.com/abpframework/abp/issues/8394
// return true;
return context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.Preview.Long);
}
return SemanticVersion.Parse(context.BuildArgs.Version) > SemanticVersion.Parse("4.2.9");
}
private static void ConfigureWithoutUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)

@ -76,6 +76,29 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App
"/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json"
);
//MyCompanyName.MyProjectName.Blazor.Server
ChangeProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj",
"EntityFrameworkCore.DbMigrations",
"MongoDB"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs",
"MyCompanyName.MyProjectName.EntityFrameworkCore",
"MyCompanyName.MyProjectName.MongoDB",
"MyProjectNameEntityFrameworkCoreDbMigrationsModule",
"MyProjectNameMongoDbModule"
);
ChangeConnectionStringToMongoDb(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/appsettings.json"
);
//MyCompanyName.MyProjectName.HttpApi.HostWithIds
ChangeProjectReference(

@ -42,6 +42,9 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor",null,
"/apps/blazor/src/MyCompanyName.MyProjectName.Blazor"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.ProductService.Blazor",
"/services/product/MyCompanyName.MyProjectName.ProductService.sln",
"/services/product/src/MyCompanyName.MyProjectName.ProductService.Blazor"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor.Server",null,
"/apps/blazor/src/MyCompanyName.MyProjectName.Blazor.Server"));
steps.Add(new RemoveFolderStep("/apps/blazor"));
@ -60,6 +63,9 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor",null,
"/apps/blazor/src/MyCompanyName.MyProjectName.Blazor"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.ProductService.Blazor",
"/services/product/MyCompanyName.MyProjectName.ProductService.sln",
"/services/product/src/MyCompanyName.MyProjectName.ProductService.Blazor"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor.Server",null,
"/apps/blazor/src/MyCompanyName.MyProjectName.Blazor.Server"));
steps.Add(new RemoveFolderStep("/apps/blazor"));
@ -113,6 +119,9 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice
"/apps/blazor/src/MyCompanyName.MyProjectName.Blazor"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor.Server",null,
"/apps/blazor/src/MyCompanyName.MyProjectName.Blazor.Server"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.ProductService.Blazor",
"/services/product/MyCompanyName.MyProjectName.ProductService.sln",
"/services/product/src/MyCompanyName.MyProjectName.ProductService.Blazor"));
steps.Add(new RemoveFolderStep("/apps/blazor"));
steps.Add(new RemoveProjectFromTyeStep("blazor"));
steps.Add(new RemoveProjectFromTyeStep("blazor-server"));

@ -12,7 +12,7 @@ namespace Volo.Abp.Modularity
{
var moduleTypes = new List<Type>();
logger.Log(LogLevel.Information, "Loaded ABP modules:");
AddModuleAndDependenciesResursively(moduleTypes, startupModuleType, logger);
AddModuleAndDependenciesRecursively(moduleTypes, startupModuleType, logger);
return moduleTypes;
}
@ -37,7 +37,7 @@ namespace Volo.Abp.Modularity
return dependencies;
}
private static void AddModuleAndDependenciesResursively(
private static void AddModuleAndDependenciesRecursively(
List<Type> moduleTypes,
Type moduleType,
ILogger logger,
@ -55,7 +55,7 @@ namespace Volo.Abp.Modularity
foreach (var dependedModuleType in FindDependedModuleTypes(moduleType))
{
AddModuleAndDependenciesResursively(moduleTypes, dependedModuleType, logger, depth + 1);
AddModuleAndDependenciesRecursively(moduleTypes, dependedModuleType, logger, depth + 1);
}
}
}

@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Devart.Data.Oracle.EFCore" Version="9.14.1204" />
<PackageReference Include="Devart.Data.Oracle.EFCore" Version="9.14.1228" />
</ItemGroup>
</Project>

@ -20,7 +20,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Core\Volo.Abp.Core.csproj" />
<ProjectReference Include="..\Volo.Abp.Localization\Volo.Abp.Localization.csproj" />
<ProjectReference Include="..\Volo.Abp.VirtualFileSystem\Volo.Abp.VirtualFileSystem.csproj" />
</ItemGroup>

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace Volo.Abp.GlobalFeatures
{

@ -1,5 +1,5 @@
using System;
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
namespace Volo.Abp.GlobalFeatures
@ -26,7 +26,6 @@ namespace Volo.Abp.GlobalFeatures
}
public virtual bool IsEnabled<TFeature>()
where TFeature : GlobalFeature
{
return IsEnabled(GlobalFeatureNameAttribute.GetName<TFeature>());
}

@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Reflection;
using JetBrains.Annotations;
@ -17,7 +17,6 @@ namespace Volo.Abp.GlobalFeatures
}
public static string GetName<TFeature>()
where TFeature : GlobalFeature
{
return GetName(typeof(TFeature));
}

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Collections.Immutable;
using JetBrains.Annotations;

@ -53,17 +53,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying
return null;
}
if (value is IRemoteStreamContent remoteStreamContent)
{
var content = new StreamContent(remoteStreamContent.GetStream());
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(remoteStreamContent.ContentType);
content.Headers.ContentLength = remoteStreamContent.ContentLength;
return content;
}
else
{
return new StringContent(jsonSerializer.Serialize(value), Encoding.UTF8, MimeTypes.Application.Json);
}
return new StringContent(jsonSerializer.Serialize(value), Encoding.UTF8, MimeTypes.Application.Json);
}
private static HttpContent GenerateFormPostData(ActionApiDescriptionModel action, IReadOnlyDictionary<string, object> methodArguments)
@ -80,7 +70,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying
if (parameters.Any(x => x.BindingSourceId == ParameterBindingSources.FormFile))
{
var postDataBuilder = new MultipartFormDataContent();
var formData = new MultipartFormDataContent();
foreach (var parameter in parameters)
{
var value = HttpActionParameterHelper.FindParameterValue(methodArguments, parameter);
@ -91,32 +81,42 @@ namespace Volo.Abp.Http.Client.DynamicProxying
if (value is IRemoteStreamContent remoteStreamContent)
{
var streamContent = new StreamContent(remoteStreamContent.GetStream());
var stream = remoteStreamContent.GetStream();
if (stream.CanSeek)
{
stream.Position = 0;
}
var streamContent = new StreamContent(stream);
if (!remoteStreamContent.ContentType.IsNullOrWhiteSpace())
{
streamContent.Headers.ContentType = new MediaTypeHeaderValue(remoteStreamContent.ContentType);
}
postDataBuilder.Add(streamContent, parameter.Name, parameter.Name);
formData.Add(streamContent, parameter.Name, parameter.Name);
}
else if (value is IEnumerable<IRemoteStreamContent> remoteStreamContents)
{
foreach (var content in remoteStreamContents)
{
var streamContent = new StreamContent(content.GetStream());
var stream = content.GetStream();
if (stream.CanSeek)
{
stream.Position = 0;
}
var streamContent = new StreamContent(stream);
if (!content.ContentType.IsNullOrWhiteSpace())
{
streamContent.Headers.ContentType = new MediaTypeHeaderValue(content.ContentType);
}
postDataBuilder.Add(streamContent, parameter.Name, parameter.Name);
formData.Add(streamContent, parameter.Name, parameter.Name);
}
}
else
{
postDataBuilder.Add(new StringContent(value.ToString(), Encoding.UTF8), parameter.Name);
formData.Add(new StringContent(value.ToString(), Encoding.UTF8), parameter.Name);
}
}
return postDataBuilder;
return formData;
}
else
{

@ -21,11 +21,7 @@ namespace Volo.Abp.Ldap
context.Services.AddAbpDynamicOptions<AbpLdapOptions, AbpAbpLdapOptionsManager>();
var configuration = context.Services.GetConfiguration();
var ldapConfiguration = configuration["Ldap"];
if (!ldapConfiguration.IsNullOrEmpty())
{
Configure<AbpLdapOptions>(configuration.GetSection("Ldap"));
}
Configure<AbpLdapOptions>(configuration.GetSection("Ldap"));
Configure<AbpVirtualFileSystemOptions>(options =>
{

@ -31,10 +31,18 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
{
throw new UserFriendlyException("Exception occurred!");
}
[Route("audit-fail-object")]
public object AuditFailForGetRequestsReturningObject()
{
throw new UserFriendlyException("Exception occurred!");
}
[HttpGet]
[Route("audit-activate-failed")]
public IActionResult AuditActivateFailed([FromServices] AbpAuditingOptions options)
{
return Ok();
}
}
}

@ -74,5 +74,20 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
await _auditingStore.Received().SaveAsync(Arg.Any<AuditLogInfo>());
}
[Fact]
public async Task Should_Trigger_Middleware_And_AuditLog_Exception_When_Activate_Controller_Failed()
{
_options.IsEnabledForGetRequests = true;
_options.AlwaysLogOnException = true;
try
{
await GetResponseAsync("api/audit-test/audit-activate-failed", System.Net.HttpStatusCode.InternalServerError);
}
catch { }
await _auditingStore.Received().SaveAsync(Arg.Is<AuditLogInfo>(x => x.Exceptions.Any()));
}
}
}

@ -34,5 +34,10 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
{
throw new UserFriendlyException("Exception occurred!");
}
public IActionResult OnGetAuditActivateFailed([FromServices] AbpAuditingOptions options)
{
return new OkResult();
}
}
}

@ -73,5 +73,20 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
await _auditingStore.Received().SaveAsync(Arg.Any<AuditLogInfo>());
}
[Fact]
public async Task Should_Trigger_Middleware_And_AuditLog_Exception_When_Activate_Page_Failed()
{
_options.IsEnabledForGetRequests = true;
_options.AlwaysLogOnException = true;
try
{
await GetResponseAsync("/Auditing/AuditTestPage?handler=AuditActivateFailed", System.Net.HttpStatusCode.InternalServerError);
}
catch { }
await _auditingStore.Received().SaveAsync(Arg.Is<AuditLogInfo>(x => x.Exceptions.Any()));
}
}
}

@ -25,11 +25,11 @@ namespace Volo.Abp.AspNetCore.Mvc.ContentFormatters
[HttpPost]
[Route("Upload")]
public async Task<string> UploadAsync([FromBody]IRemoteStreamContent streamContent)
public async Task<string> UploadAsync(IRemoteStreamContent file)
{
using (var reader = new StreamReader(streamContent.GetStream()))
using (var reader = new StreamReader(file.GetStream()))
{
return await reader.ReadToEndAsync() + ":" + streamContent.ContentType;
return await reader.ReadToEndAsync() + ":" + file.ContentType;
}
}
}

@ -1,5 +1,6 @@
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Shouldly;
@ -25,8 +26,11 @@ namespace Volo.Abp.AspNetCore.Mvc.ContentFormatters
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 streamContent = new StreamContent(memoryStream);
streamContent.Headers.ContentType = new MediaTypeHeaderValue("application/rtf");
requestMessage.Content = new MultipartFormDataContent {{streamContent, "file", "file"}};
var response = await Client.SendAsync(requestMessage);

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

Loading…
Cancel
Save