@ -0,0 +1,148 @@ |
|||
name: 🐞 Bug Report |
|||
description: Create a report to help us improve |
|||
labels: [bug] |
|||
body: |
|||
- type: markdown |
|||
attributes: |
|||
value: | |
|||
We welcome bug reports! This template will help us gather the information we need to start the triage process. |
|||
|
|||
Please keep in mind that the GitHub issue tracker is not intended as a general support forum, but for reporting **non-security** bugs and feature requests. |
|||
If you believe you have an issue that affects the SECURITY of the platform, please do NOT create an issue and instead email your issue details to info@abp.io. |
|||
For other types of questions, consider using [StackOverflow](https://stackoverflow.com/questions/tagged/abp). |
|||
- type: checkboxes |
|||
id: searched |
|||
attributes: |
|||
label: Is there an existing issue for this? |
|||
description: Please search to see if an issue already exists for the bug you encountered ([abp/issues](https://github.com/abpframework/abp/issues)). |
|||
options: |
|||
- label: I have searched the existing issues |
|||
required: true |
|||
- type: textarea |
|||
id: background |
|||
attributes: |
|||
label: Description |
|||
description: Please share a clear and concise description of the problem. |
|||
placeholder: Description |
|||
validations: |
|||
required: true |
|||
- type: textarea |
|||
id: repro-steps |
|||
attributes: |
|||
label: Reproduction Steps |
|||
description: | |
|||
Please include minimal steps to reproduce the problem if possible. E.g.: the smallest possible code snippet; or a small project, with steps to run it. If possible include text as text rather than screenshots (so it shows up in searches). |
|||
placeholder: Minimal Reproduction |
|||
validations: |
|||
required: false |
|||
- type: textarea |
|||
id: expected-behavior |
|||
attributes: |
|||
label: Expected behavior |
|||
description: | |
|||
Provide a description of the expected behavior. |
|||
placeholder: Expected behavior |
|||
validations: |
|||
required: false |
|||
- type: textarea |
|||
id: actual-behavior |
|||
attributes: |
|||
label: Actual behavior |
|||
description: | |
|||
Provide a description of the actual behavior observed. If applicable please include any error messages, exception stacktraces or memory dumps. |
|||
placeholder: Actual behavior |
|||
validations: |
|||
required: false |
|||
- type: textarea |
|||
id: regression |
|||
attributes: |
|||
label: Regression? |
|||
description: | |
|||
Did this work in a previous build or release of ABP framework? If you can try a previous release or build to find out, that can help us narrow down the problem. If you don't know, that's OK. |
|||
placeholder: Regression? |
|||
validations: |
|||
required: false |
|||
- type: textarea |
|||
id: known-workarounds |
|||
attributes: |
|||
label: Known Workarounds |
|||
description: | |
|||
Please provide a description of any known workarounds. |
|||
placeholder: Known Workarounds |
|||
validations: |
|||
required: false |
|||
- type: markdown |
|||
attributes: |
|||
value: | |
|||
## Configuration |
|||
Please provide more information on your ABP configuration. |
|||
- type: input |
|||
id: version |
|||
attributes: |
|||
label: Version |
|||
description: Which version of ABP is the code running on? |
|||
placeholder: Version |
|||
validations: |
|||
required: true |
|||
- type: dropdown |
|||
id: user-interface |
|||
attributes: |
|||
label: User Interface |
|||
description: Which user interface of ABP is related to the problem? |
|||
options: |
|||
- Common (Default) |
|||
- MVC |
|||
- Angular |
|||
- Blazor |
|||
- Blazor Server |
|||
- React Native |
|||
- MAUI |
|||
validations: |
|||
required: true |
|||
- type: dropdown |
|||
id: database-provider |
|||
attributes: |
|||
label: Database Provider |
|||
description: Which database provider of ABP is used? |
|||
options: |
|||
- EF Core (Default) |
|||
- MongoDB |
|||
- None/Others |
|||
validations: |
|||
required: true |
|||
- type: dropdown |
|||
id: structure |
|||
attributes: |
|||
label: Tiered or separate authentication server |
|||
description: Which structure of ABP is specified? |
|||
options: |
|||
- None (Default) |
|||
- Tiered |
|||
- Separate Auth Server |
|||
validations: |
|||
required: true |
|||
- type: dropdown |
|||
id: Operation-System |
|||
attributes: |
|||
label: Operation System |
|||
description: What is the operation system of the server? |
|||
options: |
|||
- Windows (Default) |
|||
- Linux |
|||
- macOS |
|||
- Others |
|||
validations: |
|||
required: true |
|||
- type: markdown |
|||
attributes: |
|||
value: | |
|||
--- |
|||
- type: textarea |
|||
id: other-info |
|||
attributes: |
|||
label: Other information |
|||
description: | |
|||
If you have an idea where the problem might lie, let us know that here. Please include any pointers to code, relevant changes, or related issues you know of. |
|||
placeholder: Other information |
|||
validations: |
|||
required: false |
|||
@ -0,0 +1,34 @@ |
|||
name: 💡 Feature request |
|||
description: Suggest an idea for this project |
|||
labels: [feature] |
|||
body: |
|||
- type: checkboxes |
|||
attributes: |
|||
label: Is there an existing issue for this? |
|||
description: Please search to see if an issue already exists for the feature you are requesting. (https://github.com/abpframework/abp/issues). |
|||
options: |
|||
- label: I have searched the existing issues |
|||
required: true |
|||
- type: textarea |
|||
attributes: |
|||
label: Is your feature request related to a problem? Please describe the problem. |
|||
description: A clear and concise description of what the problem is. |
|||
placeholder: I am trying to do [...] but [...] |
|||
validations: |
|||
required: false |
|||
- type: textarea |
|||
attributes: |
|||
label: Describe the solution you'd like |
|||
description: | |
|||
A clear and concise description of what you want to happen. Include any alternative solutions you've considered. |
|||
placeholder: I would like to see [...] |
|||
validations: |
|||
required: true |
|||
- type: textarea |
|||
attributes: |
|||
label: Additional context |
|||
description: | |
|||
Add any other context or screenshots about the feature request here. |
|||
placeholder: Add any other context or screenshots about the feature request here. |
|||
validations: |
|||
required: false |
|||
@ -0,0 +1,20 @@ |
|||
name: 💎 Article request |
|||
description: Article suggestion you want to be published on community.abp.io |
|||
labels: [community-article-request] |
|||
body: |
|||
- type: checkboxes |
|||
id: searched |
|||
attributes: |
|||
label: Is there an existing article or article request for this? |
|||
description: Please search to see if there is an article or article request related to your article request ([community.abp.io](https://community.abp.io/posts), [abp/issues](https://github.com/abpframework/abp/issues?q=is%3Aopen+is%3Aissue+label%3Acommunity-article-request)) |
|||
options: |
|||
- label: I have searched the existing resources |
|||
required: true |
|||
- type: textarea |
|||
attributes: |
|||
label: Describe the article you'd like |
|||
description: | |
|||
Please describe the article you'd like to be published on community.abp.io. |
|||
If you have any reference article, please share it here. |
|||
validations: |
|||
required: true |
|||
@ -0,0 +1,49 @@ |
|||
--- |
|||
name: Performance issue |
|||
about: Report a performance problem or regression |
|||
title: '' |
|||
labels: 'problem' |
|||
assignees: '' |
|||
|
|||
--- |
|||
|
|||
<!--This is just a template - feel free to delete any and all of it and replace as appropriate.--> |
|||
|
|||
### Description |
|||
|
|||
<!-- |
|||
* Please share a clear and concise description of the performance problem. |
|||
* Include minimal steps to reproduce the problem if possible. E.g.: the smallest possible code snippet; or a small repo to clone, with steps to run it. |
|||
--> |
|||
|
|||
### Configuration |
|||
|
|||
<!-- |
|||
(If you are posting Benchmark.NET results, this info will be included.) |
|||
* Which version of .NET is the code running on? |
|||
* What OS version, and what distro if applicable? |
|||
* What is the architecture (x64, x86, ARM, ARM64)? |
|||
* If relevant, what are the specs of the machine? |
|||
--> |
|||
|
|||
### Regression? |
|||
|
|||
<!-- |
|||
* Did this work in a previous build or release of ABP framework? If you can try a previous release or build to find out, that can help us narrow down the problem. If you don't know, that's OK. |
|||
--> |
|||
|
|||
### Data |
|||
|
|||
<!-- |
|||
* Please include any benchmark results, images of graphs, timings or measurements, or callstacks that are relevant. |
|||
* If possible please include text as text rather than images (so it shows up in searches). |
|||
* If applicable please include before and after measurements. |
|||
--> |
|||
|
|||
### Analysis |
|||
|
|||
<!-- |
|||
* If you have an idea where the problem might lie, let us know that here. |
|||
* Please include any pointers to code, relevant changes, or related issues you know of. |
|||
* If you don't know, you can delete this section. |
|||
--> |
|||
@ -0,0 +1,8 @@ |
|||
blank_issues_enabled: true |
|||
contact_links: |
|||
- name: Issue with ABP Commercial |
|||
url: https://support.abp.io/QA/Questions |
|||
about: Please open issues relating to ABP Commercial in support.abp.io. |
|||
- name: Ask a question (community support) |
|||
url: https://stackoverflow.com/questions/tagged/abp |
|||
about: Ask a question that will be answered by the ABP community |
|||
@ -1,3 +0,0 @@ |
|||
Please explain the content (an article or a video tutorial) that you would like to see on the ABP Community website, https://community.abp.io. |
|||
|
|||
Before creating your own request, please check existing requests: https://github.com/abpframework/abp/labels/community-article-request |
|||
@ -1 +0,0 @@ |
|||
Please describe the feature need! |
|||
@ -1,5 +1,5 @@ |
|||
{ |
|||
"culture": "de-DE", |
|||
"culture": "de", |
|||
"texts": { |
|||
"Account": "ABP Benutzerkonto - Anmeldung & Registrierung | ABP.IO", |
|||
"Welcome": "Willkommen", |
|||
@ -1,8 +1,8 @@ |
|||
{ |
|||
"culture": "de-DE", |
|||
"culture": "de", |
|||
"texts": { |
|||
"Volo.AbpIo.Domain:010004": "Maximale Mitgliederanzahl erreicht!", |
|||
"Volo.AbpIo.Domain:010005": "Miximale Besizeranzahl erreicht!", |
|||
"Volo.AbpIo.Domain:010005": "Maximale Besitzeranzahl erreicht!", |
|||
"Volo.AbpIo.Domain:010006": "Dieser Benutzer ist bereits ein Besitzer in dieser Organisation!", |
|||
"Volo.AbpIo.Domain:010007": "Dieser Benutzer ist bereits ein Entwickler in dieser Organisation!", |
|||
"Volo.AbpIo.Domain:010008": "Die zulässige Entwickleranzahl darf nicht geringer sein als die aktuelle Entwickleranzahl!", |
|||
@ -1,5 +1,5 @@ |
|||
{ |
|||
"culture": "de-DE", |
|||
"culture": "de", |
|||
"texts": { |
|||
"GetStarted": "Erste Schritte - Startvorlagen", |
|||
"Create": "Erstellen", |
|||
@ -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 runtime. Download link for the .NET7 SDK and runtime 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 updated 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 |
|||
|
|||
@ -0,0 +1,30 @@ |
|||
# The Official Themes |
|||
ABP Framework provides a complete UI theming system. While you can build your own themes, you can use the following pre-built themes freely in your applications. |
|||
|
|||
## The Basic Theme |
|||
The Basic Theme is a minimalist theme that doesn't add any styling on top of the plain [Bootstrap](https://getbootstrap.com/) styles. You can take the Basic Theme as the base theme and build your own theme or styling on top of it. Here, a screenshot from the theme: |
|||
|
|||
 |
|||
|
|||
### Documentation |
|||
|
|||
- [Basic Theme - MVC UI](../UI/AspNetCore/Basic-Theme.md) |
|||
- [Basic Theme - Blazor UI](../UI/Blazor/Basic-Theme.md) |
|||
- [Basic Theme - Angular UI](../UI/Angular/Basic-Theme.md) |
|||
|
|||
## The LeptonX Lite Theme |
|||
**LeptonX Lite** is the free version of the [LeptonX Theme](https://x.leptontheme.com/), which is a part of the ABP Commercial. Here, a screenshot from the theme: |
|||
|
|||
 |
|||
|
|||
### Documentation |
|||
|
|||
- [LeptonX Lite - MVC UI](LeptonXLite/AspNetCore.md) |
|||
- [LeptonX Lite - Blazor UI](LeptonXLite/Blazor.md) |
|||
- [LeptonX Lite - Angular UI](LeptonXLite/Angular.md) |
|||
|
|||
## See Also |
|||
|
|||
* [Theming - MVC UI](../UI/AspNetCore/Theming.md) |
|||
* [Theming - Blazor UI](../UI/Blazor/Theming.md) |
|||
* [Theming - Angular UI](../UI/Angular/Theming.md) |
|||
|
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 |
|
After Width: | Height: | Size: 56 KiB |
@ -0,0 +1,296 @@ |
|||
// ------------------------------------------------------------------------
|
|||
// Copyright 2021 The Dapr Authors
|
|||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|||
// you may not use this file except in compliance with the License.
|
|||
// You may obtain a copy of the License at
|
|||
// http://www.apache.org/licenses/LICENSE-2.0
|
|||
// Unless required by applicable law or agreed to in writing, software
|
|||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
// See the License for the specific language governing permissions and
|
|||
// limitations under the License.
|
|||
// ------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Dapr |
|||
{ |
|||
/// <summary>
|
|||
/// This class defines configurations for the subscribe endpoint.
|
|||
/// </summary>
|
|||
public class AbpSubscribeOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Gets or Sets a value which indicates whether to enable or disable processing raw messages.
|
|||
/// </summary>
|
|||
public bool EnableRawPayload { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// An optional delegate used to configure the subscriptions.
|
|||
/// </summary>
|
|||
public Func<List<AbpSubscription>, Task> SubscriptionsCallback { get; set; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// This class defines subscribe endpoint response
|
|||
/// </summary>
|
|||
public class AbpSubscription |
|||
{ |
|||
/// <summary>
|
|||
/// Gets or sets the topic name.
|
|||
/// </summary>
|
|||
public string Topic { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the pubsub name
|
|||
/// </summary>
|
|||
public string PubsubName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the route
|
|||
/// </summary>
|
|||
public string Route { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the routes
|
|||
/// </summary>
|
|||
public AbpRoutes Routes { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the metadata.
|
|||
/// </summary>
|
|||
public AbpMetadata Metadata { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the deadletter topic.
|
|||
/// </summary>
|
|||
public string DeadLetterTopic { get; set; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// This class defines the metadata for subscribe endpoint.
|
|||
/// </summary>
|
|||
public class AbpMetadata : Dictionary<string, string> |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the Metadata class.
|
|||
/// </summary>
|
|||
public AbpMetadata() { } |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the Metadata class.
|
|||
/// </summary>
|
|||
/// <param name="dictionary"></param>
|
|||
public AbpMetadata(IDictionary<string, string> dictionary) : base(dictionary) { } |
|||
|
|||
/// <summary>
|
|||
/// RawPayload key
|
|||
/// </summary>
|
|||
internal const string RawPayload = "rawPayload"; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// This class defines the routes for subscribe endpoint.
|
|||
/// </summary>
|
|||
public class AbpRoutes |
|||
{ |
|||
/// <summary>
|
|||
/// Gets or sets the default route
|
|||
/// </summary>
|
|||
public string Default { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the routing rules
|
|||
/// </summary>
|
|||
public List<AbpRule> Rules { get; set; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// This class defines the rule for subscribe endpoint.
|
|||
/// </summary>
|
|||
public class AbpRule |
|||
{ |
|||
/// <summary>
|
|||
/// Gets or sets the CEL expression to match this route.
|
|||
/// </summary>
|
|||
public string Match { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the path of the route.
|
|||
/// </summary>
|
|||
public string Path { get; set; } |
|||
} |
|||
} |
|||
|
|||
namespace Microsoft.AspNetCore.Builder |
|||
{ |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text.Json; |
|||
using System.Text.Json.Serialization; |
|||
using Dapr; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Routing; |
|||
using Microsoft.AspNetCore.Routing.Patterns; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
|
|||
/// <summary>
|
|||
/// Contains extension methods for <see cref="IEndpointRouteBuilder" />.
|
|||
/// </summary>
|
|||
public static class AbpDaprEndpointRouteBuilderExtensions |
|||
{ |
|||
/// <summary>
|
|||
/// Maps an endpoint that will respond to requests to <c>/dapr/subscribe</c> from the
|
|||
/// Dapr runtime.
|
|||
/// </summary>
|
|||
/// <param name="endpoints">The <see cref="IEndpointRouteBuilder" />.</param>
|
|||
/// <returns>The <see cref="IEndpointConventionBuilder" />.</returns>
|
|||
public static IEndpointConventionBuilder MapAbpSubscribeHandler(this IEndpointRouteBuilder endpoints) |
|||
{ |
|||
return CreateSubscribeEndPoint(endpoints); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Maps an endpoint that will respond to requests to <c>/dapr/subscribe</c> from the
|
|||
/// Dapr runtime.
|
|||
/// </summary>
|
|||
/// <param name="endpoints">The <see cref="IEndpointRouteBuilder" />.</param>
|
|||
/// <param name="options">Configuration options</param>
|
|||
/// <returns>The <see cref="IEndpointConventionBuilder" />.</returns>
|
|||
/// <seealso cref="MapAbpSubscribeHandler(IEndpointRouteBuilder)"/>
|
|||
public static IEndpointConventionBuilder MapAbpSubscribeHandler(this IEndpointRouteBuilder endpoints, AbpSubscribeOptions options) |
|||
{ |
|||
return CreateSubscribeEndPoint(endpoints, options); |
|||
} |
|||
|
|||
private static IEndpointConventionBuilder CreateSubscribeEndPoint(IEndpointRouteBuilder endpoints, AbpSubscribeOptions options = null) |
|||
{ |
|||
if (endpoints is null) |
|||
{ |
|||
throw new System.ArgumentNullException(nameof(endpoints)); |
|||
} |
|||
|
|||
return endpoints.MapGet("dapr/subscribe", async context => |
|||
{ |
|||
var logger = context.RequestServices.GetRequiredService<ILoggerFactory>().CreateLogger("DaprTopicSubscription"); |
|||
var dataSource = context.RequestServices.GetRequiredService<EndpointDataSource>(); |
|||
var subscriptions = dataSource.Endpoints |
|||
.OfType<RouteEndpoint>() |
|||
.Where(e => e.Metadata.GetOrderedMetadata<ITopicMetadata>().Any(t => t.Name != null)) // only endpoints which have TopicAttribute with not null Name.
|
|||
.SelectMany(e => |
|||
{ |
|||
var topicMetadata = e.Metadata.GetOrderedMetadata<ITopicMetadata>(); |
|||
var originalTopicMetadata = e.Metadata.GetOrderedMetadata<IOriginalTopicMetadata>(); |
|||
|
|||
var subs = new List<(string PubsubName, string Name, string DeadLetterTopic, bool? EnableRawPayload, string Match, int Priority, Dictionary<string, string[]> OriginalTopicMetadata, string MetadataSeparator, RoutePattern RoutePattern)>(); |
|||
|
|||
for (int i = 0; i < topicMetadata.Count(); i++) |
|||
{ |
|||
subs.Add((topicMetadata[i].PubsubName, |
|||
topicMetadata[i].Name, |
|||
(topicMetadata[i] as IDeadLetterTopicMetadata)?.DeadLetterTopic, |
|||
(topicMetadata[i] as IRawTopicMetadata)?.EnableRawPayload, |
|||
topicMetadata[i].Match, |
|||
topicMetadata[i].Priority, |
|||
originalTopicMetadata.Where(m => (topicMetadata[i] as IOwnedOriginalTopicMetadata)?.OwnedMetadatas?.Any(o => o.Equals(m.Id)) == true || string.IsNullOrEmpty(m.Id)) |
|||
.GroupBy(c => c.Name) |
|||
.ToDictionary(m => m.Key, m => m.Select(c => c.Value).Distinct().ToArray()), |
|||
(topicMetadata[i] as IOwnedOriginalTopicMetadata)?.MetadataSeparator, |
|||
e.RoutePattern)); |
|||
} |
|||
|
|||
return subs; |
|||
}) |
|||
.Distinct() |
|||
.GroupBy(e => new { e.PubsubName, e.Name }) |
|||
.Select(e => e.OrderBy(e => e.Priority)) |
|||
.Select(e => |
|||
{ |
|||
var first = e.First(); |
|||
var rawPayload = e.Any(e => e.EnableRawPayload.GetValueOrDefault()); |
|||
var metadataSeparator = e.FirstOrDefault(e => !string.IsNullOrEmpty(e.MetadataSeparator)).MetadataSeparator ?? ","; |
|||
var rules = e.Where(e => !string.IsNullOrEmpty(e.Match)).ToList(); |
|||
var defaultRoutes = e.Where(e => string.IsNullOrEmpty(e.Match)).Select(e => RoutePatternToString(e.RoutePattern)).ToList(); |
|||
var defaultRoute = defaultRoutes.FirstOrDefault(); |
|||
|
|||
//multiple identical names. use comma separation.
|
|||
var metadata = new AbpMetadata(e.SelectMany(c => c.OriginalTopicMetadata).GroupBy(c => c.Key).ToDictionary(c => c.Key, c => string.Join(metadataSeparator, c.SelectMany(c => c.Value).Distinct()))); |
|||
if (rawPayload || options?.EnableRawPayload is true) |
|||
{ |
|||
metadata.Add(AbpMetadata.RawPayload, "true"); |
|||
} |
|||
|
|||
if (logger != null) |
|||
{ |
|||
if (defaultRoutes.Count > 1) |
|||
{ |
|||
logger.LogError("A default subscription to topic {name} on pubsub {pubsub} already exists.", first.Name, first.PubsubName); |
|||
} |
|||
|
|||
var duplicatePriorities = rules.GroupBy(e => e.Priority) |
|||
.Where(g => g.Count() > 1) |
|||
.ToDictionary(x => x.Key, y => y.Count()); |
|||
|
|||
foreach (var entry in duplicatePriorities) |
|||
{ |
|||
logger.LogError("A subscription to topic {name} on pubsub {pubsub} has duplicate priorities for {priority}: found {count} occurrences.", first.Name, first.PubsubName, entry.Key, entry.Value); |
|||
} |
|||
} |
|||
|
|||
var subscription = new AbpSubscription |
|||
{ |
|||
Topic = first.Name, |
|||
PubsubName = first.PubsubName, |
|||
Metadata = metadata.Count > 0 ? metadata : null, |
|||
}; |
|||
|
|||
if (first.DeadLetterTopic != null) |
|||
{ |
|||
subscription.DeadLetterTopic = first.DeadLetterTopic; |
|||
} |
|||
|
|||
// Use the V2 routing rules structure
|
|||
if (rules.Count > 0) |
|||
{ |
|||
subscription.Routes = new AbpRoutes |
|||
{ |
|||
Rules = rules.Select(e => new AbpRule |
|||
{ |
|||
Match = e.Match, |
|||
Path = RoutePatternToString(e.RoutePattern), |
|||
}).ToList(), |
|||
Default = defaultRoute, |
|||
}; |
|||
} |
|||
// Use the V1 structure for backward compatibility.
|
|||
else |
|||
{ |
|||
subscription.Route = defaultRoute; |
|||
} |
|||
|
|||
return subscription; |
|||
}) |
|||
.OrderBy(e => (e.PubsubName, e.Topic)) |
|||
.ToList(); |
|||
|
|||
await options?.SubscriptionsCallback(subscriptions); |
|||
await context.Response.WriteAsync(JsonSerializer.Serialize(subscriptions, |
|||
new JsonSerializerOptions |
|||
{ |
|||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase, |
|||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull |
|||
})); |
|||
}); |
|||
} |
|||
|
|||
private static string RoutePatternToString(RoutePattern routePattern) |
|||
{ |
|||
return string.Join("/", routePattern.PathSegments |
|||
.Select(segment => string.Concat(segment.Parts.Cast<RoutePatternLiteralPart>() |
|||
.Select(part => part.Content)))); |
|||
} |
|||
} |
|||
} |
|||
@ -1,11 +0,0 @@ |
|||
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; |
|||
|
|||
public class AbpAspNetCoreMvcDaprEventBusOptions |
|||
{ |
|||
public List<IAbpAspNetCoreMvcDaprPubSubProviderContributor> Contributors { get; } |
|||
|
|||
public AbpAspNetCoreMvcDaprEventBusOptions() |
|||
{ |
|||
Contributors = new List<IAbpAspNetCoreMvcDaprPubSubProviderContributor>(); |
|||
} |
|||
} |
|||
@ -1,63 +0,0 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.EventBus; |
|||
using Volo.Abp.EventBus.Dapr; |
|||
using Volo.Abp.EventBus.Distributed; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; |
|||
|
|||
public class AbpAspNetCoreMvcDaprPubSubProvider : ITransientDependency |
|||
{ |
|||
protected IServiceProvider ServiceProvider { get; } |
|||
protected AbpAspNetCoreMvcDaprEventBusOptions AspNetCoreMvcDaprEventBusOptions { get; } |
|||
protected AbpDaprEventBusOptions DaprEventBusOptions { get; } |
|||
protected AbpDistributedEventBusOptions DistributedEventBusOptions { get; } |
|||
|
|||
public AbpAspNetCoreMvcDaprPubSubProvider( |
|||
IServiceProvider serviceProvider, |
|||
IOptions<AbpAspNetCoreMvcDaprEventBusOptions> aspNetCoreDaprEventBusOptions, |
|||
IOptions<AbpDaprEventBusOptions> daprEventBusOptions, |
|||
IOptions<AbpDistributedEventBusOptions> distributedEventBusOptions) |
|||
{ |
|||
ServiceProvider = serviceProvider; |
|||
AspNetCoreMvcDaprEventBusOptions = aspNetCoreDaprEventBusOptions.Value; |
|||
DaprEventBusOptions = daprEventBusOptions.Value; |
|||
DistributedEventBusOptions = distributedEventBusOptions.Value; |
|||
} |
|||
|
|||
public virtual async Task<List<AbpAspNetCoreMvcDaprSubscriptionDefinition>> GetSubscriptionsAsync() |
|||
{ |
|||
var subscriptions = new List<AbpAspNetCoreMvcDaprSubscriptionDefinition>(); |
|||
foreach (var handler in DistributedEventBusOptions.Handlers) |
|||
{ |
|||
foreach (var @interface in handler.GetInterfaces().Where(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IDistributedEventHandler<>))) |
|||
{ |
|||
var eventType = @interface.GetGenericArguments()[0]; |
|||
var eventName = EventNameAttribute.GetNameOrDefault(eventType); |
|||
|
|||
subscriptions.Add(new AbpAspNetCoreMvcDaprSubscriptionDefinition() |
|||
{ |
|||
PubSubName = DaprEventBusOptions.PubSubName, |
|||
Topic = eventName, |
|||
Route = AbpAspNetCoreMvcDaprPubSubConsts.DaprEventCallbackUrl |
|||
}); |
|||
} |
|||
} |
|||
|
|||
if (AspNetCoreMvcDaprEventBusOptions.Contributors.Any()) |
|||
{ |
|||
using (var scope = ServiceProvider.CreateScope()) |
|||
{ |
|||
var context = new AbpAspNetCoreMvcDaprPubSubProviderContributorContext(scope.ServiceProvider, subscriptions); |
|||
foreach (var contributor in AspNetCoreMvcDaprEventBusOptions.Contributors) |
|||
{ |
|||
await contributor.ContributeAsync(context); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return subscriptions; |
|||
} |
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; |
|||
|
|||
public class AbpAspNetCoreMvcDaprPubSubProviderContributorContext |
|||
{ |
|||
public IServiceProvider ServiceProvider { get; } |
|||
|
|||
public List<AbpAspNetCoreMvcDaprSubscriptionDefinition> Subscriptions { get; } |
|||
|
|||
public AbpAspNetCoreMvcDaprPubSubProviderContributorContext(IServiceProvider serviceProvider, List<AbpAspNetCoreMvcDaprSubscriptionDefinition> daprSubscriptionModels) |
|||
{ |
|||
ServiceProvider = serviceProvider; |
|||
Subscriptions = daprSubscriptionModels; |
|||
} |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
using System; |
|||
using System.Text.Json; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
using Volo.Abp.Dapr; |
|||
using Volo.Abp.EventBus.Dapr; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Controllers; |
|||
|
|||
[Area("abp")] |
|||
[RemoteService(Name = "abp")] |
|||
public class AbpAspNetCoreMvcDaprEventsController : AbpController |
|||
{ |
|||
[HttpPost(AbpAspNetCoreMvcDaprPubSubConsts.DaprEventCallbackUrl)] |
|||
public virtual async Task<IActionResult> EventAsync() |
|||
{ |
|||
HttpContext.ValidateDaprAppApiToken(); |
|||
|
|||
var daprSerializer = HttpContext.RequestServices.GetRequiredService<IDaprSerializer>(); |
|||
var body = (await JsonDocument.ParseAsync(HttpContext.Request.Body)); |
|||
|
|||
var pubSubName = body.RootElement.GetProperty("pubsubname").GetString(); |
|||
var topic = body.RootElement.GetProperty("topic").GetString(); |
|||
var data = body.RootElement.GetProperty("data").GetRawText(); |
|||
if (pubSubName.IsNullOrWhiteSpace() || topic.IsNullOrWhiteSpace() || data.IsNullOrWhiteSpace()) |
|||
{ |
|||
Logger.LogError("Invalid Dapr event request."); |
|||
return BadRequest(); |
|||
} |
|||
|
|||
var distributedEventBus = HttpContext.RequestServices.GetRequiredService<DaprDistributedEventBus>(); |
|||
var eventData = daprSerializer.Deserialize(data, distributedEventBus.GetEventType(topic)); |
|||
await distributedEventBus.TriggerHandlersAsync(distributedEventBus.GetEventType(topic), eventData); |
|||
return Ok(); |
|||
} |
|||
} |
|||
@ -1,38 +0,0 @@ |
|||
using System.Text.Json; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; |
|||
using Volo.Abp.Dapr; |
|||
using Volo.Abp.EventBus.Dapr; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Controllers; |
|||
|
|||
[Area("abp")] |
|||
[RemoteService(Name = "abp")] |
|||
public class AbpAspNetCoreMvcDaprPubSubController : AbpController |
|||
{ |
|||
[HttpGet(AbpAspNetCoreMvcDaprPubSubConsts.DaprSubscribeUrl)] |
|||
public virtual async Task<List<AbpAspNetCoreMvcDaprSubscriptionDefinition>> SubscribeAsync() |
|||
{ |
|||
return await HttpContext.RequestServices.GetRequiredService<AbpAspNetCoreMvcDaprPubSubProvider>().GetSubscriptionsAsync(); |
|||
} |
|||
|
|||
[HttpPost(AbpAspNetCoreMvcDaprPubSubConsts.DaprEventCallbackUrl)] |
|||
public virtual async Task<IActionResult> EventsAsync() |
|||
{ |
|||
this.HttpContext.ValidateDaprAppApiToken(); |
|||
|
|||
var bodyJsonDocument = await JsonDocument.ParseAsync(HttpContext.Request.Body); |
|||
var request = JsonSerializer.Deserialize<AbpAspNetCoreMvcDaprSubscriptionRequest>(bodyJsonDocument.RootElement.GetRawText(), |
|||
HttpContext.RequestServices.GetRequiredService<IOptions<JsonOptions>>().Value.JsonSerializerOptions); |
|||
|
|||
var distributedEventBus = HttpContext.RequestServices.GetRequiredService<DaprDistributedEventBus>(); |
|||
var daprSerializer = HttpContext.RequestServices.GetRequiredService<IDaprSerializer>(); |
|||
|
|||
var eventData = daprSerializer.Deserialize(bodyJsonDocument.RootElement.GetProperty("data").GetRawText(), distributedEventBus.GetEventType(request.Topic)); |
|||
await distributedEventBus.TriggerHandlersAsync(distributedEventBus.GetEventType(request.Topic), eventData); |
|||
|
|||
return Ok(); |
|||
} |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; |
|||
|
|||
public interface IAbpAspNetCoreMvcDaprPubSubProviderContributor |
|||
{ |
|||
Task ContributeAsync(AbpAspNetCoreMvcDaprPubSubProviderContributorContext context); |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; |
|||
|
|||
public class AbpAspNetCoreMvcDaprSubscriptionDefinition |
|||
{ |
|||
public string PubSubName { get; set; } |
|||
|
|||
public string Topic { get; set; } |
|||
|
|||
public string Route { get; set; } |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; |
|||
|
|||
public class AbpAspNetCoreMvcDaprSubscriptionRequest |
|||
{ |
|||
public string PubSubName { get; set; } |
|||
|
|||
public string Topic { get; set; } |
|||
} |
|||
@ -1,11 +0,0 @@ |
|||
using System.Text.Json; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.SystemTextJson; |
|||
|
|||
public class AbpAspNetCoreMvcDaprPubSubJsonNamingPolicy : JsonNamingPolicy |
|||
{ |
|||
public override string ConvertName(string name) |
|||
{ |
|||
return name.ToLower(); |
|||
} |
|||
} |
|||
@ -1,25 +0,0 @@ |
|||
using System.Text.Json; |
|||
using System.Text.Json.Serialization; |
|||
using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.SystemTextJson; |
|||
|
|||
public class AbpAspNetCoreMvcDaprSubscriptionDefinitionConverter : JsonConverter<AbpAspNetCoreMvcDaprSubscriptionDefinition> |
|||
{ |
|||
private JsonSerializerOptions? _writeJsonSerializerOptions; |
|||
|
|||
public override AbpAspNetCoreMvcDaprSubscriptionDefinition Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) |
|||
{ |
|||
throw new NotSupportedException(); |
|||
} |
|||
|
|||
public override void Write(Utf8JsonWriter writer, AbpAspNetCoreMvcDaprSubscriptionDefinition value, JsonSerializerOptions options) |
|||
{ |
|||
_writeJsonSerializerOptions ??= JsonSerializerOptionsHelper.Create(new JsonSerializerOptions(options) |
|||
{ |
|||
PropertyNamingPolicy = new AbpAspNetCoreMvcDaprPubSubJsonNamingPolicy() |
|||
}, x => x == this); |
|||
|
|||
JsonSerializer.Serialize(writer, value, _writeJsonSerializerOptions); |
|||
} |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
{ |
|||
"culture": "de-DE", |
|||
"texts": { |
|||
"GivenTenantIsNotExist": "Der angegebene Client ist nicht vorhanden: {0}", |
|||
"GivenTenantIsNotAvailable": "Der angegebene Mandant ist nicht verfügbar: {0}", |
|||
"Tenant": "Mandant", |
|||
"Switch": "wechseln", |
|||
"Name": "Name", |
|||
"SwitchTenantHint": "Lassen Sie das Namensfeld leer, um zur Host-Seite zu wechseln.", |
|||
"SwitchTenant": "Mandant wechseln", |
|||
"NotSelected": "Nicht ausgewählt" |
|||
} |
|||
} |
|||
@ -1,49 +1,52 @@ |
|||
<Modal @ref="@ModalRef" Closing="@OnModalClosing"> |
|||
<ModalContent Centered="@CenterMessage"> |
|||
<ModalHeader> |
|||
<ModalTitle> |
|||
@Title |
|||
</ModalTitle> |
|||
</ModalHeader> |
|||
@if (!Title.IsNullOrEmpty()) |
|||
{ |
|||
<ModalHeader> |
|||
<ModalTitle> |
|||
@Title |
|||
</ModalTitle> |
|||
</ModalHeader> |
|||
} |
|||
<ModalBody> |
|||
@if ( ShowMessageIcon ) |
|||
{ |
|||
<DisplayHeading Size="DisplayHeadingSize.Is2" Alignment="TextAlignment.Center"> |
|||
<Icon Name="@MessageIcon" Style="@MessageIconStyle" /> |
|||
<DisplayHeading Size="DisplayHeadingSize.Is2" TextAlignment="TextAlignment.Center"> |
|||
<Icon Name="@MessageIcon" Style="@MessageIconStyle" /> |
|||
</DisplayHeading> |
|||
} |
|||
<Text Alignment="TextAlignment.Center"> |
|||
<Paragraph TextAlignment="TextAlignment.Center" Margin="Margin.Is0.FromBottom"> |
|||
@Message |
|||
</Text> |
|||
</Paragraph> |
|||
</ModalBody> |
|||
<ModalFooter> |
|||
@if ( IsConfirmation ) |
|||
{ |
|||
<Button Color="Color.Danger" Padding="Padding.Is2.OnX" Clicked="@OnCancelClicked"> |
|||
@if ( Options?.CancelButtonIcon != null ) |
|||
{ |
|||
<Icon Name="@Options.CancelButtonIcon" Margin="Margin.Is2.FromEnd" /> |
|||
} |
|||
@CancelButtonText |
|||
</Button> |
|||
<Button Color="Color.Primary" Padding="Padding.Is2.OnX" Clicked="@OnConfirmClicked"> |
|||
@if ( Options?.ConfirmButtonIcon != null ) |
|||
{ |
|||
<Icon Name="@Options.ConfirmButtonIcon" Margin="Margin.Is2.FromEnd" /> |
|||
} |
|||
@ConfirmButtonText |
|||
</Button> |
|||
} |
|||
else |
|||
{ |
|||
<Button Color="Color.Primary" Padding="Padding.Is2.OnX" Clicked="@OnOkClicked"> |
|||
@if ( Options?.OkButtonIcon != null ) |
|||
{ |
|||
<Icon Name="@Options.OkButtonIcon" Margin="Margin.Is2.FromEnd" /> |
|||
} |
|||
@OkButtonText |
|||
</Button> |
|||
} |
|||
<ModalFooter class="d-flex justify-content-center"> |
|||
@if ( IsConfirmation ) |
|||
{ |
|||
<Button Color="Color.Danger" Padding="Padding.Is3.OnX" Margin="Margin.Is1.OnX" Clicked="@OnCancelClicked"> |
|||
@if ( Options?.CancelButtonIcon != null ) |
|||
{ |
|||
<Icon Name="@Options.CancelButtonIcon" Margin="Margin.Is2.FromEnd" /> |
|||
} |
|||
@CancelButtonText |
|||
</Button> |
|||
<Button Color="Color.Primary" Padding="Padding.Is3.OnX" Margin="Margin.Is1.OnX" Clicked="@OnConfirmClicked"> |
|||
@if ( Options?.ConfirmButtonIcon != null ) |
|||
{ |
|||
<Icon Name="@Options.ConfirmButtonIcon" Margin="Margin.Is2.FromEnd" /> |
|||
} |
|||
@ConfirmButtonText |
|||
</Button> |
|||
} |
|||
else |
|||
{ |
|||
<Button Color="Color.Primary" Padding="Padding.Is3.OnX" Margin="Margin.Is1.OnX" Clicked="@OnOkClicked"> |
|||
@if ( Options?.OkButtonIcon != null ) |
|||
{ |
|||
<Icon Name="@Options.OkButtonIcon" Margin="Margin.Is2.FromEnd" /> |
|||
} |
|||
@OkButtonText |
|||
</Button> |
|||
} |
|||
</ModalFooter> |
|||
</ModalContent> |
|||
</Modal> |
|||
@ -0,0 +1,19 @@ |
|||
using Volo.Abp.Cli.ProjectBuilding.Building; |
|||
|
|||
namespace Volo.Abp.Cli.Args; |
|||
|
|||
public class AngularThemeConfigurationArgs |
|||
{ |
|||
public Theme Theme { get; } |
|||
|
|||
public string ProjectName { get; } |
|||
|
|||
public string AngularFolderPath { get; } |
|||
|
|||
public AngularThemeConfigurationArgs(Theme theme, string projectName, string angularFolderPath) |
|||
{ |
|||
Theme = theme; |
|||
ProjectName = projectName; |
|||
AngularFolderPath = angularFolderPath; |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
using System; |
|||
using Volo.Abp.Cli.Args; |
|||
using Volo.Abp.Cli.Utils; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectModification; |
|||
|
|||
public class AngularThemeConfigurer : ITransientDependency |
|||
{ |
|||
private readonly ICmdHelper _cmdHelper; |
|||
|
|||
public AngularThemeConfigurer(ICmdHelper cmdHelper) |
|||
{ |
|||
_cmdHelper = cmdHelper; |
|||
} |
|||
|
|||
public void Configure(AngularThemeConfigurationArgs args) |
|||
{ |
|||
if (args.ProjectName.IsNullOrEmpty() || args.AngularFolderPath.IsNullOrEmpty()) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
var command = "npx ng g @abp/ng.schematics:change-theme " + |
|||
$"--name {(int)args.Theme} " + |
|||
$"--target-project {args.ProjectName}"; |
|||
|
|||
_cmdHelper.RunCmd(command, workingDirectory: args.AngularFolderPath); |
|||
} |
|||
} |
|||