mirror of https://github.com/abpframework/abp.git
942 changed files with 7417 additions and 4228 deletions
@ -0,0 +1,29 @@ |
|||
name: Documentation Checks |
|||
|
|||
on: |
|||
push: |
|||
branches: |
|||
- dev |
|||
paths: |
|||
# This ensures the check will only be run when something changes in the docs content |
|||
- "docs/en/**/*" |
|||
pull_request: |
|||
branches: |
|||
- dev |
|||
paths: |
|||
- "docs/en/**/*" |
|||
jobs: |
|||
spellcheck: |
|||
name: "Docs: Spellcheck (En)" |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
name: Check out the code |
|||
- uses: actions/setup-node@v1 |
|||
name: Setup node |
|||
with: |
|||
node-version: "16" |
|||
- run: npm install -g cspell |
|||
name: Install cSpell |
|||
- run: cspell --config ./cSpell.json "docs/en/**/*.md" --no-progress # Update for path to the markdown files |
|||
name: Run cSpell |
|||
@ -0,0 +1,151 @@ |
|||
{ |
|||
"version": "0.2", |
|||
"language": "en", |
|||
"words": [ |
|||
"ABP's", |
|||
"abpframework", |
|||
"Antiforgery", |
|||
"appsettings", |
|||
"aspnet", |
|||
"aspnetcore", |
|||
"Autofac", |
|||
"automagically", |
|||
"Blazor", |
|||
"CQRS", |
|||
"crossfade", |
|||
"Dapr", |
|||
"Datagrid's", |
|||
"Datatable", |
|||
"datepicker", |
|||
"dismissable", |
|||
"dockerized", |
|||
"entrypoints", |
|||
"findability", |
|||
"hoverable", |
|||
"Iddict", |
|||
"IntelliCode", |
|||
"Keysize", |
|||
"Linq", |
|||
"Microservices", |
|||
"middlewares", |
|||
"Minifier", |
|||
"multitenancy", |
|||
"multitenant", |
|||
"Navs", |
|||
"Newtonsoft", |
|||
"Npgsql", |
|||
"oidc", |
|||
"overridable", |
|||
"Parameterless", |
|||
"Passwordless", |
|||
"PKCE", |
|||
"preconfigured", |
|||
"proxying", |
|||
"redirections", |
|||
"scrollbars", |
|||
"signin", |
|||
"Templating", |
|||
"textboxes", |
|||
"toolset", |
|||
"unsubscription", |
|||
"Xunit" |
|||
], |
|||
"ignoreWords": [ |
|||
"Aliyun", |
|||
"Allibone", |
|||
"Blazorise", |
|||
"Boutwell", |
|||
"Cmskit", |
|||
"connectionstrings", |
|||
"Devart", |
|||
"Formik", |
|||
"Halil", |
|||
"Hanselman", |
|||
"hikalkan", |
|||
"Ibrahim", |
|||
"İbrahim", |
|||
"Kalkan", |
|||
"Kirti", |
|||
"Kommunity", |
|||
"Kulkarni", |
|||
"Luxon", |
|||
"malihu", |
|||
"Malik", |
|||
"Masis", |
|||
"Minio", |
|||
"NGXS", |
|||
"NSWAG", |
|||
"Scriban", |
|||
"Serilog", |
|||
"Shoudly", |
|||
"Shouldly", |
|||
"Sweetalert", |
|||
"Syncfusion", |
|||
"Telerik", |
|||
"Timeago", |
|||
"Toastr", |
|||
"Volo", |
|||
"Volosoft", |
|||
"Xeevis" |
|||
], |
|||
"patterns": [ |
|||
{ |
|||
"name": "Markdown links", |
|||
"pattern": "\\((.*)\\)", |
|||
"description": "" |
|||
}, |
|||
{ |
|||
"name": "Markdown code blocks", |
|||
"pattern": "/^(\\s*`{3,}).*[\\s\\S]*?^\\1/gmx", |
|||
"description": "Taken from the cSpell example at https://cspell.org/configuration/patterns/#verbose-regular-expressions" |
|||
}, |
|||
{ |
|||
"name": "Inline code blocks", |
|||
"pattern": "\\`([^\\`\\r\\n]+?)\\`", |
|||
"description": "https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex" |
|||
}, |
|||
{ |
|||
"name": "Link contents", |
|||
"pattern": "\\<a(.*)\\>", |
|||
"description": "" |
|||
}, |
|||
{ |
|||
"name": "Snippet references", |
|||
"pattern": "-- snippet:(.*)", |
|||
"description": "" |
|||
}, |
|||
{ |
|||
"name": "Snippet references 2", |
|||
"pattern": "\\<\\[sample:(.*)", |
|||
"description": "another kind of snippet reference" |
|||
}, |
|||
{ |
|||
"name": "Multi-line code blocks", |
|||
"pattern": "/^\\s*```[\\s\\S]*?^\\s*```/gm" |
|||
}, |
|||
{ |
|||
"name": "HTML Tags", |
|||
"pattern": "<[^>]*>", |
|||
"description": "Reference: https://stackoverflow.com/questions/11229831/regular-expression-to-remove-html-tags-from-a-string" |
|||
}, |
|||
{ |
|||
"name": "Markdown Image", |
|||
"pattern": "!\\[(.*)\\]\\((.*)\\)" |
|||
} |
|||
], |
|||
"ignoreRegExpList": [ |
|||
"Markdown links", |
|||
"Markdown code blocks", |
|||
"Inline code blocks", |
|||
"Link contents", |
|||
"Snippet references", |
|||
"Snippet references 2", |
|||
"Multi-line code blocks", |
|||
"HTML Tags", |
|||
"Markdown Image" |
|||
], |
|||
"ignorePaths": [ |
|||
"**/*Release/Post.md", |
|||
"**/*Preview/POST.md" |
|||
] |
|||
} |
|||
@ -0,0 +1,265 @@ |
|||
# Upgrade Your Existing Projects to .NET7 |
|||
|
|||
A new .NET version has come. As open-source contributors, we are tracking the latest libraries and adopting them to our existing projects. In this sense, we completed our .NET 7 upgrade in our repositories for ABP Framework and ABP Commercial. In this article, I'll share the experiences we faced while upgrading to the new .NET version 👉 .NET 7. |
|||
|
|||
When I wrote this article, the latest .NET version was `7.0.0-rc.2`. So some of the version statements I wrote below must be changed due to the stable version release. |
|||
|
|||
|
|||
|
|||
**To see the latest and greatest stuff, let's see how to upgrade our existing projects to .NET 7!** |
|||
|
|||
|
|||
|
|||
## Install .NET7 SDK |
|||
|
|||
If you are on your development computer, then you need to install the .NET7 SDK `7.x.x`. For the production servers, you need to install the .NET 7 runtimes. Download link for the .NET7 SDK and runtimes is: |
|||
|
|||
* https://dotnet.microsoft.com/en-us/download/dotnet/7.0 |
|||
|
|||
|
|||
|
|||
## Update Your *.csproj Files |
|||
|
|||
First, you need to update all your `*.csproj` files to support .NET7. Find and replace all your `<TargetFramework>*</TargetFramework>` in the `*.csproj` files to support .NET 7: |
|||
|
|||
```xml |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
``` |
|||
|
|||
We already did this in ABP Framework, see this commit as an example [github.com/abpframework/abp/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.csproj](https://github.com/abpframework/abp/blob/dev/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj#L4). |
|||
|
|||
|
|||
|
|||
### Microsoft Package Updates |
|||
|
|||
You must be using Microsoft packages as well; then you need to update them to the latest .NET 7 version. |
|||
At the time, I wrote this article, the latest version was `7.0.0-rc.2.22476.2`, so I'll update them to this version including minor version changes. |
|||
|
|||
Here's the list of all package reference updates I did: |
|||
|
|||
```xml |
|||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Components" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.0-rc.2.*" /> |
|||
|
|||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0-rc.2.*"> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0-rc.2.*"> |
|||
|
|||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.FileProviders.Composite" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0-rc.2.*" /> |
|||
|
|||
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="System.Text.Encodings.Web" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="System.Text.Json" Version="7.0.0-rc.2.*" /> |
|||
|
|||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="System.Collections.Immutable" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0-rc.2.*" /> |
|||
<PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.0-rc.2.*" /> |
|||
``` |
|||
|
|||
|
|||
|
|||
--- |
|||
|
|||
|
|||
|
|||
## Entity Framework Core Updates |
|||
|
|||
If you use EF Core as your data access library, you should update your `dotnet-ef` CLI tool. Here's the terminal command to update it: |
|||
|
|||
```bash |
|||
dotnet tool update dotnet-ef --global --prerelease |
|||
``` |
|||
|
|||
We already did the the EF Core package reference update in the *Microsoft Package Updates* section. |
|||
|
|||
|
|||
|
|||
### Breaking Change: OrderBy |
|||
|
|||
This release makes a breaking change in an EF Core query running behavior. We faced this issue in some of our queries that were missing `OrderBy` statement. It throws an exception and does not run the query. Here's the explanation of a EF Core team member for this issue: [github.com/dotnet/efcore/issues/21202#issuecomment-913206415](https://github.com/dotnet/efcore/issues/21202#issuecomment-913206415). |
|||
|
|||
The following exception is being thrown: |
|||
|
|||
> InvalidOperationException: The query uses 'Skip' without specifying ordering and uses split query mode. This generates incorrect results. Either provide ordering or run query in single query mode using AsSingleQuery(). See https://go.microsoft.com/fwlink/?linkid=2196526 for more information |
|||
|
|||
If you don't want to add `OrderBy` statement to solve the issue, you can also use `AsSingleQuery()`. |
|||
|
|||
 |
|||
|
|||
|
|||
|
|||
### EF Core - SQL Client Connection String Update |
|||
|
|||
With this version, the behavior of the SQL connection has been changed. There is a keyword in the SQL connection string called `TrustServerCertificate`. This keyword indicates whether the channel will be encrypted while bypassing walking the certificate chain to validate trust. |
|||
|
|||
> When `TrustServerCertificate` is set to `True`, the transport layer will use SSL to encrypt the channel and bypass walking the certificate chain to validate trust. If `TrustServerCertificate` is set to `true` and encryption is turned on, the encryption level specified on the server will be used even if `Encrypt` is set to `false`. The connection will fail otherwise. |
|||
|
|||
|
|||
|
|||
After the .NET7 update, it just started to throw the following exception: |
|||
|
|||
> A connection was successfully established with the server, but then an error occurred during the login process. |
|||
|
|||
|
|||
|
|||
We fixed this problem by adding the `TrustServerCertificate=true` to your connection string. Here's an example connection string that supports, |
|||
|
|||
````sql |
|||
Server=localhost; Database=MyProjectName; Trusted_Connection=True; TrustServerCertificate=True |
|||
```` |
|||
|
|||
See our commit for this fix: |
|||
|
|||
* [github.com/abpframework/abp/commit/96f17e67918eb87edd2baf876d4a7598281fe608](https://github.com/abpframework/abp/commit/96f17e67918eb87edd2baf876d4a7598281fe608) |
|||
|
|||
Related docs: |
|||
|
|||
* [learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/breaking-changes#encrypt-true](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/breaking-changes#encrypt-true) |
|||
* [stackoverflow.com/questions/34430550/a-connection-was-successfully-established-with-the-server-but-then-an-error-occ](https://stackoverflow.com/questions/34430550/a-connection-was-successfully-established-with-the-server-but-then-an-error-occ) |
|||
|
|||
|
|||
|
|||
--- |
|||
|
|||
|
|||
|
|||
## Blazor Update |
|||
|
|||
Ensure that you have updated your Blazor project's csproj to support .NET7: |
|||
|
|||
```xml |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
``` |
|||
|
|||
### Install Blazor Workloads |
|||
|
|||
#### .NET Web Assembly build tools |
|||
|
|||
If you have a Blazor-WASM project, install the workloads by running the following in a command shell: |
|||
|
|||
```bash |
|||
dotnet workload install wasm-tools |
|||
``` |
|||
|
|||
**OR** you can update your workloads by running the following command in your Blazor project directory: |
|||
|
|||
```bash |
|||
dotnet workload restore |
|||
``` |
|||
|
|||
|
|||
|
|||
--- |
|||
|
|||
|
|||
|
|||
## .NET MAUI Update |
|||
|
|||
Ensure that you have updated your Blazor project's csproj to support .NET7: |
|||
|
|||
```xml |
|||
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks> |
|||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks> |
|||
``` |
|||
|
|||
|
|||
|
|||
### Install MAUI Workloads |
|||
|
|||
If you have .NET MAUI project, then you also need to update your `TargetFramework` as below: |
|||
|
|||
If you have a .NET MAUI project, after installing the .NET 7 SDK, install the latest workloads with the following command: |
|||
|
|||
```bash |
|||
dotnet workload install maui |
|||
``` |
|||
|
|||
**OR** run the following command in your existing .NET MAUI project directory |
|||
|
|||
```bash |
|||
dotnet workload restore |
|||
``` |
|||
|
|||
|
|||
|
|||
Further information, check out https://github.com/dotnet/maui/wiki/.NET-7-and-.NET-MAUI |
|||
|
|||
--- |
|||
|
|||
|
|||
|
|||
#### Dotnet Maui Check Tool |
|||
|
|||
Alternatively, there's a 3rd party tool for .NET MAUI to install the required workloads. This tool installs the missing SDK packs. You can reach the tool's repository at [github.com/Redth/dotnet-maui-check](https://github.com/Redth/dotnet-maui-check). |
|||
|
|||
Installation: |
|||
|
|||
```bash |
|||
dotnet tool install -g Redth.Net.Maui.Check |
|||
``` |
|||
|
|||
Run: |
|||
|
|||
```bash |
|||
maui-check |
|||
``` |
|||
|
|||
|
|||
|
|||
--- |
|||
|
|||
|
|||
|
|||
## Docker Image Update |
|||
|
|||
If you are using Docker to automate the deployment of applications, you also need to update your images. We were using `aspnet:6.0.0-bullseye-slim` base and after the .NET 7 update, we started using `aspnet:7.0-bullseye-slim` in our Docker files. |
|||
|
|||
``` |
|||
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bullseye-slim AS base |
|||
``` |
|||
|
|||
For this update, you can check out the following commit as an example: |
|||
|
|||
* [github.com/abpframework/abp/commit/2d07b9bd00152bef4658c48ff9b2cbee5788d308](https://github.com/abpframework/abp/commit/2d07b9bd00152bef4658c48ff9b2cbee5788d308) |
|||
|
|||
|
|||
|
|||
## ABP Framework .NET 7 Update |
|||
|
|||
In [ABP Framework repository](https://github.com/abpframework/abp), we pdated all our dependencies from .NET 6 to .NET 7. |
|||
Not all the changes are here, but you can check out the following PR of the .NET 7 update: |
|||
|
|||
* [github.com/abpframework/abp/pull/13626/files](https://github.com/abpframework/abp/pull/13626/files) |
|||
|
|||
|
|||
... |
|||
|
|||
Happy coding with .NET 7 🤗 |
|||
|
|||
... |
|||
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 133 KiB |
@ -0,0 +1,36 @@ |
|||
# ABP Version 7.0 Migration Guide |
|||
|
|||
This document is a guide for upgrading ABP v6.0 solutions to ABP v7.0. There is a change in this version that may affect your applications, please read it carefully and apply the necessary changes to your application. |
|||
|
|||
## Hybrid JSON was removed. |
|||
|
|||
Since [System.Text.Json](https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/overview) library supports more custom features in NET 7, ABP no longer need the hybrid Json feature. |
|||
|
|||
### Previous Behavior |
|||
|
|||
There is a `Volo.Abp.Json` package which contains the `AbpJsonModule` module. |
|||
`Serialization/deserialization` features of [System.Text.Json](https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/overview) and [Nettonsoft](https://www.newtonsoft.com/json/help/html/SerializingJSON.htm) are implemented in this module. |
|||
|
|||
We use [System.Text.Json](https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/overview) first, More custom cases can be handled with [Nettonsoft](https://www.newtonsoft.com/json/help/html/SerializingJSON.htm) by configuring `UnsupportedTypes` of `AbpSystemTextJsonSerializerOptions`. |
|||
|
|||
### New Behavior |
|||
|
|||
We created `Volo.Abp.Json.SystemTextJson` and `Volo.Abp.Json.Newtonsoft` as separate packages, which means you can only use one of them in your project. The default is to use `SystemTextJson`. If you want `Newtonsoft`, please also use `Volo.Abp.AspNetCore.Mvc.NewtonsoftJson` in your web project. |
|||
|
|||
* Volo.Abp.Json.Abstractions |
|||
* Volo.Abp.Json.Newtonsoft |
|||
* Volo.Abp.Json.SystemTextJson |
|||
* Volo.Abp.Json (Depends on `Volo.Abp.Json.SystemTextJson` by default to prevent breaking) |
|||
* Volo.Abp.AspNetCore.Mvc.NewtonsoftJson |
|||
|
|||
The `AbpJsonOptions` now has only two properties, which are |
|||
|
|||
* `InputDateTimeFormats(List<string>)`: Formats of input JSON date, Empty string means default format. You can provide multiple formats to parse the date. |
|||
* `OutputDateTimeFormat(string)`: Format of output json date, Null or empty string means default format. |
|||
|
|||
Please remove all `UnsupportedTypes` add custom `Modifiers` to control serialization/deserialization behavior. |
|||
|
|||
Check the docs to see the more info: https://github.com/abpframework/abp/blob/dev/docs/en/JSON.md#configuration |
|||
|
|||
Check the docs to see how to customize a JSON contract: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/custom-contracts |
|||
|
|||
@ -1,3 +1,220 @@ |
|||
# Angular UI: Theme Configurations |
|||
|
|||
> This document is in draft version. |
|||
Theme packages no longer import styles as CSS modules as of ABP version 6.0. The following style settings need to be included to the angular.json file in order for theme packages to load styles. |
|||
## Lepton X Lite |
|||
```json |
|||
{ |
|||
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/bootstrap-dim.css", |
|||
"inject": false, |
|||
"bundleName": "bootstrap-dim" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/ng-bundle.css", |
|||
"inject": false, |
|||
"bundleName": "ng-bundle" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/side-menu/layout-bundle.css", |
|||
"inject": false, |
|||
"bundleName": "layout-bundle" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@abp/ng.theme.lepton-x/assets/css/abp-bundle.css", |
|||
"inject": false, |
|||
"bundleName": "abp-bundle" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/bootstrap-dim.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "bootstrap-dim.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/ng-bundle.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "ng-bundle.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/side-menu/layout-bundle.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "layout-bundle.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@abp/ng.theme.lepton-x/assets/css/abp-bundle.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "abp-bundle.rtl" |
|||
}, |
|||
``` |
|||
|
|||
## Theme Basic |
|||
```json |
|||
{ |
|||
"input": "node_modules/bootstrap/dist/css/bootstrap.rtl.min.css", |
|||
"inject": false, |
|||
"bundleName": "bootstrap-rtl.min" |
|||
}, |
|||
{ |
|||
"input": "node_modules/bootstrap/dist/css/bootstrap.min.css", |
|||
"inject": true, |
|||
"bundleName": "bootstrap-ltr.min" |
|||
}, |
|||
``` |
|||
|
|||
## Lepton X |
|||
```json |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/dark.css", |
|||
"inject": false, |
|||
"bundleName": "dark" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/light.css", |
|||
"inject": false, |
|||
"bundleName": "light" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/dim.css", |
|||
"inject": false, |
|||
"bundleName": "dim" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/bootstrap-dim.css", |
|||
"inject": false, |
|||
"bundleName": "bootstrap-dim" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/bootstrap-dark.css", |
|||
"inject": false, |
|||
"bundleName": "bootstrap-dark" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/bootstrap-light.css", |
|||
"inject": false, |
|||
"bundleName": "bootstrap-light" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/ng-bundle.css", |
|||
"inject": false, |
|||
"bundleName": "ng-bundle" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/side-menu/layout-bundle.css", |
|||
"inject": false, |
|||
"bundleName": "layout-bundle" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/abp.ng.theme.lepton-x/assets/css/abp-bundle.css", |
|||
"inject": false, |
|||
"bundleName": "abp-bundle" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/dark.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "dark.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/light.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "light.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/dim.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "dim.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/bootstrap-dim.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "bootstrap-dim.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/bootstrap-dark.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "bootstrap-dark.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/bootstrap-light.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "bootstrap-light.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/ng-bundle.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "ng-bundle.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/side-menu/layout-bundle.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "layout-bundle.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volosoft/abp.ng.theme.lepton-x/assets/css/abp-bundle.rtl.css", |
|||
"inject": false, |
|||
"bundleName": "abp-bundle.rtl" |
|||
} |
|||
``` |
|||
|
|||
## Theme Lepton |
|||
```json |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton1.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton1" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton2.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton2" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton3.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton3" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton4.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton4" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton5.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton5" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton6.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton6" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton1.rtl.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton1.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton2.rtl.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton2.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton3.rtl.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton3.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton4.rtl.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton4.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton5.rtl.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton5.rtl" |
|||
}, |
|||
{ |
|||
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton6.rtl.min.css", |
|||
"inject": false, |
|||
"bundleName": "lepton6.rtl" |
|||
}, |
|||
``` |
|||
|
|||
|
|||
|
|||
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
@ -0,0 +1,111 @@ |
|||
# 短信发送 |
|||
|
|||
ABP 框架提供一个用于发送短信的抽象, 有如下优点: |
|||
|
|||
- 在不改变应用程序代码的情况下, 你可以**非常容易地切换**短信发送提供者(提供商). |
|||
- 如果你想创建可重用的应用程序模块, 则不需要假设短信是如何发送的. |
|||
|
|||
## 安装 |
|||
|
|||
建议你使用[ABP CLI](CLI.md)来安装这个包. |
|||
|
|||
### 使用Abp CLI |
|||
|
|||
在项目所在目录(.csproj 文件所在目录)打开命令行工具, 输入如下命令: |
|||
|
|||
```bash |
|||
abp add-package Volo.Abp.Sms |
|||
``` |
|||
|
|||
### 手动安装 |
|||
|
|||
如果你想要手动安装; |
|||
|
|||
1. 添加 [Volo.Abp.Sms](https://www.nuget.org/packages/Volo.Abp.Sms) NuGet 包到你的项目中: |
|||
|
|||
``` |
|||
Install-Package Volo.Abp.Sms |
|||
``` |
|||
|
|||
2. 在你的模块的依赖列表中添加对模块`AbpSmsModule`的依赖: |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
//...其它依赖 |
|||
typeof(AbpSmsModule) //添加新模块的依赖 |
|||
)] |
|||
public class YourModule : AbpModule |
|||
{ |
|||
} |
|||
``` |
|||
|
|||
## 发送短信 |
|||
|
|||
[注入](Dependency-Injection.md) `ISmsSender`, 并使用`SendAsync`方法来发送短信. |
|||
|
|||
**例子:** |
|||
|
|||
```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", // 目标手机号 |
|||
"This is test sms..." // 消息内容 |
|||
); |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
示例中给定的`SendAsync`方法是一个扩展方法, 用于发送带有基本参数的短信.此外, 你也可以传入一个有如下属性的`SmsMessage`对象: |
|||
|
|||
- `PhoneNumber` (`string`):目标手机号 |
|||
- `Text` (`string`):短信消息内容 |
|||
- `Properties` (`Dictionary<string, string>`):用于传入自定义参数的键值对 |
|||
|
|||
## NullSmsSender |
|||
|
|||
`NullSmsSender`是`ISmsSender`的一个默认实现.它写入内容到[日志](Logging.md)中, 而不是真正地发送短信. |
|||
|
|||
开发时, 你不想真正地发送短信时, 这个类是非常有用的.**然而, 若你想真实发送短信, 你需要在你的应用程序代码中实现`ISmsSender`接口.** |
|||
|
|||
## 实现ISmsSender接口 |
|||
|
|||
通过创建一个实现`ISmsSender`接口的类, 你可以很容易创建你自己的短信发送实现, 如下所示: |
|||
|
|||
```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) |
|||
{ |
|||
// 发送短信 |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## More |
|||
|
|||
[ABP Commercial](https://commercial.abp.io/)提供Twilio的集成包, 用于使用[Twilio service](https://docs.abp.io/en/commercial/latest/modules/twilio-sms)来发送短信. |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue