diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index 68d7849c56..acbc322f12 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -41,7 +41,7 @@ permissions:
jobs:
build-test:
- runs-on: windows-latest
+ runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v2
@@ -49,15 +49,19 @@ jobs:
with:
dotnet-version: 7.0.100
+ - name: chown
+ run: |
+ sudo chown -R $USER:$USER /home/runneradmin
+
- name: Build All
- run: .\build-all.ps1 -f
- working-directory: .\build
- shell: powershell
+ run: ./build-all.ps1
+ working-directory: ./build
+ shell: pwsh
- name: Test All
- run: .\test-all.ps1 -f
- working-directory: .\build
- shell: powershell
+ run: ./test-all.ps1
+ working-directory: ./build
+ shell: pwsh
- name: Codecov
uses: codecov/codecov-action@v2
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/AbpIoLocalization.csproj b/abp_io/AbpIoLocalization/AbpIoLocalization/AbpIoLocalization.csproj
index 7b26f13919..400c15ff77 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/AbpIoLocalization.csproj
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/AbpIoLocalization.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
index 63e795efee..16ce5acab0 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
@@ -419,6 +419,15 @@
"WhoWeAre_Expert": "About Me",
"CreateSolutionFolder": "Create Solution Folder",
"CreateSolutionFolderOption": "Specifies if the project will be in a new folder in the output folder or directly the output folder.",
- "BooksPageTitle": "ABP Books"
+ "BooksPageTitle": "ABP Books",
+ "PackageDetailPage_NuGetPackageInstallationOptions": "There are two ways to install {0} NuGet package to your project",
+ "PackageDetailPage_InstallingWithABPCLI": "1: Installing with the ABP CLI",
+ "PackageDetailPage_InstallingWithABPCLIDescription1": "If you haven't installed the ABP CLI, first install by executing the following command in a command-line terminal",
+ "PackageDetailPage_InstallingWithABPCLIDescription2": "Once you have installed the ABP CLI, open a command-line terminal in the location of the project (.csproj file) you want to install it and execute the following command",
+ "PackageDetailPage_InstallingWithABPCLIDescription3": "It will add the {0} package reference to your project and the {1} dependency to your module class.",
+ "PackageDetailPage_ManualInstallation": "2: Manual Installation",
+ "PackageDetailPage_ManualInstallationDesription1": "Add {0} NuGet package reference to your project using your IDE or executing the following command",
+ "PackageDetailPage_ManualInstallationDesription2": "Then add the {0} dependency to your module class as shown in the following example",
+ "PackageDetailPage_SeeDocumentation": "See the documentation to learn how to use this package in your applications."
}
}
diff --git a/docs/en/Deployment/Configuring-OpenIddict.md b/docs/en/Deployment/Configuring-OpenIddict.md
new file mode 100644
index 0000000000..bf7bc9c619
--- /dev/null
+++ b/docs/en/Deployment/Configuring-OpenIddict.md
@@ -0,0 +1,62 @@
+# Configuring OpenIddict
+
+This document introduces how to configure `OpenIddict` in the `AuthServer` project.
+
+There are different configurations in the `AuthServer` project for `Development` and `Production` environment.
+
+````csharp
+public override void PreConfigureServices(ServiceConfigurationContext context)
+{
+ var hostingEnvironment = context.Services.GetHostingEnvironment();
+
+ // Development environment
+ if (hostingEnvironment.IsDevelopment())
+ {
+ PreConfigure(options =>
+ {
+ // This is default value, you can remove this line.
+ options.AddDevelopmentEncryptionAndSigningCertificate = true;
+ });
+ }
+
+ // Production or Staging environment
+ if (!hostingEnvironment.IsDevelopment())
+ {
+ PreConfigure(options =>
+ {
+ options.AddDevelopmentEncryptionAndSigningCertificate = false;
+ });
+
+ PreConfigure(builder =>
+ {
+ builder.AddSigningCertificate(GetSigningCertificate(hostingEnvironment));
+ builder.AddEncryptionCertificate(GetSigningCertificate(hostingEnvironment));
+
+ //...
+ });
+ }
+}
+
+private X509Certificate2 GetSigningCertificate(IWebHostEnvironment hostingEnv)
+{
+ return new X509Certificate2(Path.Combine(hostingEnv.ContentRootPath, "authserver.pfx"), "00000000-0000-0000-0000-000000000000");
+}
+````
+
+## Development Environment
+
+We've enabled `AddDevelopmentEncryptionAndSigningCertificate` by default on development environment, It registers (and generates if necessary) a user-specific development encryption/development signing certificate. This is a certificate used for signing and encrypting the tokens and for **development environment only**.
+
+`AddDevelopmentEncryptionAndSigningCertificate` cannot be used in applications deployed on IIS or Azure App Service: trying to use them on IIS or Azure App Service will result in an exception being thrown at runtime (unless the application pool is configured to [load a user profile](https://learn.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities#user-profile)).
+
+To avoid that, consider creating self-signed certificates and storing them in the X.509 certificates storage of the host machine(s). This is the way we do it in production environment.
+
+## Production Environment
+
+We've disabled `AddDevelopmentEncryptionAndSigningCertificate` in production environment and tried to setup signing and encrypting certificates using `authserver.pfx`.
+
+You can use the `dotnet dev-certs https -v -ep authserver.pfx -p 00000000-0000-0000-0000-000000000000` command to generate the `authserver.pfx` certificate.
+
+> `00000000-0000-0000-0000-000000000000` is the password of the certificate, you can change it to any password you want.
+
+> Also, please remember to copy `authserver.pfx` to the [Content Root Folder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.ihostingenvironment.contentrootpath?view=aspnetcore-7.0) of the `AuthServer` website.
diff --git a/docs/en/Deployment/Index.md b/docs/en/Deployment/Index.md
index 849d3bd4f3..3eb299b483 100644
--- a/docs/en/Deployment/Index.md
+++ b/docs/en/Deployment/Index.md
@@ -6,6 +6,7 @@ However, there are some topics that you should care about when you are deploying
## Guides
+* [Configuring for OpenIddict](Configuring-OpenIddict.md): Notes for some essential configurations for OpenIddict.
* [Configuring for Production](Configuring-Production.md): Notes for some essential configurations for production environments.
* [Optimization for Production](Optimizing-Production.md): Tips and suggestions for optimizing your application on production environments.
* [Deploying to a Clustered Environment](Clustered-Environment.md): Explains how to configure your application when you want to run multiple instances of your application concurrently.
diff --git a/docs/en/Road-Map.md b/docs/en/Road-Map.md
index 7cf8948515..8fa7b9b2e7 100644
--- a/docs/en/Road-Map.md
+++ b/docs/en/Road-Map.md
@@ -4,11 +4,11 @@ This document provides a road map, release schedule and planned features for the
## Next Versions
-### v7.1
+### v7.3
-The next version will be 7.1 and planned to release the stable 7.1 version in February, 2023. In the version 7.1, we will mostly focus on stabilizing and enhancing existing features, improving the developer experience, as well as adding relatively minor new features.
+The next version will be 7.3 and planned to release the stable 7.3 version in July, 2023. In the version 7.3, we will mostly focus on stabilizing and enhancing existing features, improving the developer experience, as well as adding relatively minor new features.
-See the [7.1 milestone](https://github.com/abpframework/abp/milestone/68) for all the issues we've planned to work on.
+See the [7.3 milestone](https://github.com/abpframework/abp/milestone/82) for all the issues we've planned to work on.
## Backlog Items
@@ -19,13 +19,15 @@ Here, a list of major items in the backlog we are considering to work on in the
* [#6655](https://github.com/abpframework/abp/pull/6655) / Use Typescript for the MVC UI
* [#236](https://github.com/abpframework/abp/issues/236) / Resource based authorization system
* [#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))
-* [#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 abstractions
-* [#2532](https://github.com/abpframework/abp/issues/2532), [#2564](https://github.com/abpframework/abp/issues/2465) / CosmosDB integration with EF Core and MongoDB API
+* [#2532](https://github.com/abpframework/abp/issues/2532) / CosmosDB integration with EF Core and MongoDB API
* [#4223](https://github.com/abpframework/abp/issues/4223) / WebHook system
* [#162](https://github.com/abpframework/abp/issues/162) / Azure ElasticDB Integration for multitenancy
* [#2296](https://github.com/abpframework/abp/issues/2296) / Feature toggling infrastructure
+* [#16342](https://github.com/abpframework/abp/issues/16342) / CmsKit: Meta information for SEO
+* [#16260](https://github.com/abpframework/abp/issues/16260) / GCP Blob Storage Provider
+* [#15932](https://github.com/abpframework/abp/issues/15932) / Introduce ABP Diagnostics Module
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.
diff --git a/docs/en/Tutorials/Part-8.md b/docs/en/Tutorials/Part-8.md
index 24dafffdb9..9d638e909e 100644
--- a/docs/en/Tutorials/Part-8.md
+++ b/docs/en/Tutorials/Part-8.md
@@ -102,7 +102,7 @@ namespace Acme.BookStore.Authors;
public class GetAuthorListDto : PagedAndSortedResultRequestDto
{
- public string Filter { get; set; }
+ public string? Filter { get; set; }
}
````
diff --git a/docs/en/Tutorials/Part-9.md b/docs/en/Tutorials/Part-9.md
index d67e20a8e0..704d5f016b 100644
--- a/docs/en/Tutorials/Part-9.md
+++ b/docs/en/Tutorials/Part-9.md
@@ -90,7 +90,7 @@ Create a new razor page, `Index.cshtml` under the `Pages/Authors` folder of the
This is a simple page similar to the Books page we had created before. It imports a JavaScript file which will be introduced below.
-### IndexModel.cshtml.cs
+### Index.cshtml.cs
````csharp
using Microsoft.AspNetCore.Mvc.RazorPages;
diff --git a/docs/en/UI/Angular/Theme-Configurations.md b/docs/en/UI/Angular/Theme-Configurations.md
index e663955667..09cbc5914c 100644
--- a/docs/en/UI/Angular/Theme-Configurations.md
+++ b/docs/en/UI/Angular/Theme-Configurations.md
@@ -69,7 +69,7 @@ Theme packages no longer import styles as CSS modules as of ABP version 6.0. The
},
```
-## Lepton X
+## Lepton X [commercial](https://docs.abp.io/en/commercial)
```json
{
"input": "node_modules/@volosoft/ngx-lepton-x/assets/css/dark.css",
@@ -174,7 +174,7 @@ Theme packages no longer import styles as CSS modules as of ABP version 6.0. The
```
-## Theme Lepton
+## Theme Lepton [commercial](https://docs.abp.io/en/commercial)
```json
{
"input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton1.min.css",
diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json
index 1abd957604..ad2bbc652b 100644
--- a/docs/en/docs-nav.json
+++ b/docs/en/docs-nav.json
@@ -16,7 +16,7 @@
},
{
"text": "Getting Started",
- "path":"Getting-Started-Overall.md",
+ "path": "Getting-Started-Overall.md",
"items": [
{
"text": "Web Application - Layered Architecture",
@@ -1166,6 +1166,10 @@
"text": "Overall",
"path": "UI/Angular/Theming.md"
},
+ {
+ "text": "Configuration",
+ "path": "UI/Angular/Theme-Configurations.md"
+ },
{
"text": "The Basic Theme",
"path": "UI/Angular/Basic-Theme.md"
@@ -1405,12 +1409,12 @@
"path": "Modules/IdentityServer.md",
"items": [
{
- "text": "IdentityServer Migration Guide",
- "path": "Migration-Guides/IdentityServer4-Step-by-Step.md"
+ "text": "IdentityServer Migration Guide",
+ "path": "Migration-Guides/IdentityServer4-Step-by-Step.md"
}
]
},
- {
+ {
"text": "OpenIddict",
"items": [
{
@@ -1438,7 +1442,7 @@
},
{
"text": "Common",
- "items":[
+ "items": [
{
"text": "Database Tables",
"path": "Modules/Database-Tables.md"
diff --git a/docs/zh-Hans/Tutorials/Part-8.md b/docs/zh-Hans/Tutorials/Part-8.md
index d3b78de7e0..5c58d1b524 100644
--- a/docs/zh-Hans/Tutorials/Part-8.md
+++ b/docs/zh-Hans/Tutorials/Part-8.md
@@ -107,7 +107,7 @@ namespace Acme.BookStore.Authors
{
public class GetAuthorListDto : PagedAndSortedResultRequestDto
{
- public string Filter { get; set; }
+ public string? Filter { get; set; }
}
}
````
diff --git a/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo.Abp.ApiVersioning.Abstractions.csproj b/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo.Abp.ApiVersioning.Abstractions.csproj
index 365450cd73..038e852f21 100644
--- a/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo.Abp.ApiVersioning.Abstractions.csproj
+++ b/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo.Abp.ApiVersioning.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.ApiVersioning.Abstractions
Volo.Abp.ApiVersioning.Abstractions
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo.Abp.AspNetCore.Mvc.Client.Common.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo.Abp.AspNetCore.Mvc.Client.Common.csproj
index 1c1f4ef696..9f9ddb9755 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo.Abp.AspNetCore.Mvc.Client.Common.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo.Abp.AspNetCore.Mvc.Client.Common.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.AspNetCore.Mvc.Client.Common
Volo.Abp.AspNetCore.Mvc.Client.Common
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo.Abp.AspNetCore.Mvc.Contracts.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo.Abp.AspNetCore.Mvc.Contracts.csproj
index 7a5da3dca7..a89f7c60a7 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo.Abp.AspNetCore.Mvc.Contracts.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo.Abp.AspNetCore.Mvc.Contracts.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.AspNetCore.Mvc.Contracts
Volo.Abp.AspNetCore.Mvc.Contracts
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Controllers/AbpAspNetCoreMvcDaprEventsController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Controllers/AbpAspNetCoreMvcDaprEventsController.cs
index 92cf41db90..da0dad6a70 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Controllers/AbpAspNetCoreMvcDaprEventsController.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Controllers/AbpAspNetCoreMvcDaprEventsController.cs
@@ -21,6 +21,7 @@ public class AbpAspNetCoreMvcDaprEventsController : AbpController
var daprSerializer = HttpContext.RequestServices.GetRequiredService();
var body = (await JsonDocument.ParseAsync(HttpContext.Request.Body));
+ var id = body.RootElement.GetProperty("id").GetString();
var pubSubName = body.RootElement.GetProperty("pubsubname").GetString();
var topic = body.RootElement.GetProperty("topic").GetString();
var data = body.RootElement.GetProperty("data").GetRawText();
@@ -32,7 +33,7 @@ public class AbpAspNetCoreMvcDaprEventsController : AbpController
var distributedEventBus = HttpContext.RequestServices.GetRequiredService();
var eventData = daprSerializer.Deserialize(data, distributedEventBus.GetEventType(topic));
- await distributedEventBus.TriggerHandlersAsync(distributedEventBus.GetEventType(topic), eventData);
+ await distributedEventBus.TriggerHandlersAsync(id, distributedEventBus.GetEventType(topic), eventData);
return Ok();
}
}
diff --git a/framework/src/Volo.Abp.Auditing.Contracts/Volo.Abp.Auditing.Contracts.csproj b/framework/src/Volo.Abp.Auditing.Contracts/Volo.Abp.Auditing.Contracts.csproj
index e11f6aeeda..d926ca6365 100644
--- a/framework/src/Volo.Abp.Auditing.Contracts/Volo.Abp.Auditing.Contracts.csproj
+++ b/framework/src/Volo.Abp.Auditing.Contracts/Volo.Abp.Auditing.Contracts.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Auditing.Contracts
Volo.Abp.Auditing.Contracts
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Auditing/Volo.Abp.Auditing.csproj b/framework/src/Volo.Abp.Auditing/Volo.Abp.Auditing.csproj
index 5bdc6f89c5..6a29572457 100644
--- a/framework/src/Volo.Abp.Auditing/Volo.Abp.Auditing.csproj
+++ b/framework/src/Volo.Abp.Auditing/Volo.Abp.Auditing.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Auditing
Volo.Abp.Auditing
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo.Abp.Authorization.Abstractions.csproj b/framework/src/Volo.Abp.Authorization.Abstractions/Volo.Abp.Authorization.Abstractions.csproj
index f0dd3e965e..86c690687d 100644
--- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo.Abp.Authorization.Abstractions.csproj
+++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo.Abp.Authorization.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Authorization.Abstractions
Volo.Abp.Authorization.Abstractions
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Authorization/Volo.Abp.Authorization.csproj b/framework/src/Volo.Abp.Authorization/Volo.Abp.Authorization.csproj
index be5c6f8898..02dcdde621 100644
--- a/framework/src/Volo.Abp.Authorization/Volo.Abp.Authorization.csproj
+++ b/framework/src/Volo.Abp.Authorization/Volo.Abp.Authorization.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Authorization
Volo.Abp.Authorization
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj b/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj
index e03023a72a..32c4eb4e39 100644
--- a/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj
+++ b/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Autofac
Volo.Abp.Autofac
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.AzureServiceBus/Volo.Abp.AzureServiceBus.csproj b/framework/src/Volo.Abp.AzureServiceBus/Volo.Abp.AzureServiceBus.csproj
index 3c4c82a512..98a67869cf 100644
--- a/framework/src/Volo.Abp.AzureServiceBus/Volo.Abp.AzureServiceBus.csproj
+++ b/framework/src/Volo.Abp.AzureServiceBus/Volo.Abp.AzureServiceBus.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.AzureServiceBus
Volo.Abp.AzureServiceBus
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo.Abp.BackgroundJobs.Abstractions.csproj b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo.Abp.BackgroundJobs.Abstractions.csproj
index 1788867e39..6a7eded3d8 100644
--- a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo.Abp.BackgroundJobs.Abstractions.csproj
+++ b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo.Abp.BackgroundJobs.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BackgroundJobs.Abstractions
Volo.Abp.BackgroundJobs.Abstractions
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo.Abp.BackgroundJobs.HangFire.csproj b/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo.Abp.BackgroundJobs.HangFire.csproj
index 9a197ef095..5823174e54 100644
--- a/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo.Abp.BackgroundJobs.HangFire.csproj
+++ b/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo.Abp.BackgroundJobs.HangFire.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BackgroundJobs.HangFire
Volo.Abp.BackgroundJobs.HangFire
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo.Abp.BackgroundJobs.Quartz.csproj b/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo.Abp.BackgroundJobs.Quartz.csproj
index 3b235be413..1326926d55 100644
--- a/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo.Abp.BackgroundJobs.Quartz.csproj
+++ b/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo.Abp.BackgroundJobs.Quartz.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BackgroundJobs.Quartz
Volo.Abp.BackgroundJobs.Quartz
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo.Abp.BackgroundJobs.RabbitMQ.csproj b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo.Abp.BackgroundJobs.RabbitMQ.csproj
index a74903bad4..40f87898ba 100644
--- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo.Abp.BackgroundJobs.RabbitMQ.csproj
+++ b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo.Abp.BackgroundJobs.RabbitMQ.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BackgroundJobs.RabbitMQ
Volo.Abp.BackgroundJobs.RabbitMQ
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BackgroundJobs/Volo.Abp.BackgroundJobs.csproj b/framework/src/Volo.Abp.BackgroundJobs/Volo.Abp.BackgroundJobs.csproj
index 7d4f2d9fa2..a9450e134c 100644
--- a/framework/src/Volo.Abp.BackgroundJobs/Volo.Abp.BackgroundJobs.csproj
+++ b/framework/src/Volo.Abp.BackgroundJobs/Volo.Abp.BackgroundJobs.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BackgroundJobs
Volo.Abp.BackgroundJobs
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo.Abp.BackgroundWorkers.Hangfire.csproj b/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo.Abp.BackgroundWorkers.Hangfire.csproj
index 8832400d64..9792dbf1ff 100644
--- a/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo.Abp.BackgroundWorkers.Hangfire.csproj
+++ b/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo.Abp.BackgroundWorkers.Hangfire.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BackgroundWorkers.Hangfire
Volo.Abp.BackgroundWorkers.Hangfire
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo.Abp.BackgroundWorkers.Quartz.csproj b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo.Abp.BackgroundWorkers.Quartz.csproj
index 4aad05aef7..2c43a121d1 100644
--- a/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo.Abp.BackgroundWorkers.Quartz.csproj
+++ b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo.Abp.BackgroundWorkers.Quartz.csproj
@@ -5,7 +5,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BackgroundWorkers.Quartz
Volo.Abp.BackgroundWorkers.Quartz
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BackgroundWorkers/Volo.Abp.BackgroundWorkers.csproj b/framework/src/Volo.Abp.BackgroundWorkers/Volo.Abp.BackgroundWorkers.csproj
index c8e518c4d3..f01a73d7a1 100644
--- a/framework/src/Volo.Abp.BackgroundWorkers/Volo.Abp.BackgroundWorkers.csproj
+++ b/framework/src/Volo.Abp.BackgroundWorkers/Volo.Abp.BackgroundWorkers.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BackgroundWorkers
Volo.Abp.BackgroundWorkers
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo.Abp.BlobStoring.Aliyun.csproj b/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo.Abp.BlobStoring.Aliyun.csproj
index c594d29395..76241505be 100644
--- a/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo.Abp.BlobStoring.Aliyun.csproj
+++ b/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo.Abp.BlobStoring.Aliyun.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BlobStoring.Aliyun
Volo.Abp.BlobStoring.Aliyun
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BlobStoring.Aws/Volo.Abp.BlobStoring.Aws.csproj b/framework/src/Volo.Abp.BlobStoring.Aws/Volo.Abp.BlobStoring.Aws.csproj
index c14651658d..a5f94b783b 100644
--- a/framework/src/Volo.Abp.BlobStoring.Aws/Volo.Abp.BlobStoring.Aws.csproj
+++ b/framework/src/Volo.Abp.BlobStoring.Aws/Volo.Abp.BlobStoring.Aws.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
false
false
false
diff --git a/framework/src/Volo.Abp.BlobStoring.Azure/Volo.Abp.BlobStoring.Azure.csproj b/framework/src/Volo.Abp.BlobStoring.Azure/Volo.Abp.BlobStoring.Azure.csproj
index d33d74be6b..03b01e537c 100644
--- a/framework/src/Volo.Abp.BlobStoring.Azure/Volo.Abp.BlobStoring.Azure.csproj
+++ b/framework/src/Volo.Abp.BlobStoring.Azure/Volo.Abp.BlobStoring.Azure.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BlobStoring.Azure
Volo.Abp.BlobStoring.Azure
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BlobStoring.FileSystem/Volo.Abp.BlobStoring.FileSystem.csproj b/framework/src/Volo.Abp.BlobStoring.FileSystem/Volo.Abp.BlobStoring.FileSystem.csproj
index ac4025de2a..4996a4a0b2 100644
--- a/framework/src/Volo.Abp.BlobStoring.FileSystem/Volo.Abp.BlobStoring.FileSystem.csproj
+++ b/framework/src/Volo.Abp.BlobStoring.FileSystem/Volo.Abp.BlobStoring.FileSystem.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BlobStoring.FileSystem
Volo.Abp.BlobStoring.FileSystem
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.BlobStoring/Volo.Abp.BlobStoring.csproj b/framework/src/Volo.Abp.BlobStoring/Volo.Abp.BlobStoring.csproj
index 850f98b5f1..6b3c44a49b 100644
--- a/framework/src/Volo.Abp.BlobStoring/Volo.Abp.BlobStoring.csproj
+++ b/framework/src/Volo.Abp.BlobStoring/Volo.Abp.BlobStoring.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.BlobStoring
Volo.Abp.BlobStoring
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo.Abp.Caching.StackExchangeRedis.csproj b/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo.Abp.Caching.StackExchangeRedis.csproj
index d1faed8f5c..e2bfd7549a 100644
--- a/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo.Abp.Caching.StackExchangeRedis.csproj
+++ b/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo.Abp.Caching.StackExchangeRedis.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Caching.StackExchangeRedis
Volo.Abp.Caching.StackExchangeRedis
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Caching/Volo.Abp.Caching.csproj b/framework/src/Volo.Abp.Caching/Volo.Abp.Caching.csproj
index 4022d38fee..52d6a3381d 100644
--- a/framework/src/Volo.Abp.Caching/Volo.Abp.Caching.csproj
+++ b/framework/src/Volo.Abp.Caching/Volo.Abp.Caching.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Caching
Volo.Abp.Caching
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Castle.Core/Volo.Abp.Castle.Core.csproj b/framework/src/Volo.Abp.Castle.Core/Volo.Abp.Castle.Core.csproj
index 83a3253b07..7125519bb0 100644
--- a/framework/src/Volo.Abp.Castle.Core/Volo.Abp.Castle.Core.csproj
+++ b/framework/src/Volo.Abp.Castle.Core/Volo.Abp.Castle.Core.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Castle.Core
Volo.Abp.Castle.Core
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj
index 1688a4246f..a6bb742585 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj
+++ b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
false
false
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliUrls.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliUrls.cs
index 83ae5a9f73..35ae34b895 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliUrls.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliUrls.cs
@@ -29,6 +29,11 @@ public static class CliUrls
return $"{NuGetRootPath}{apiKey}/v3/package/{packageId}/index.json";
}
+ public static string GetNuGetPackageSearchUrl(string apiKey, string packageId)
+ {
+ return $"{NuGetRootPath}{apiKey}/v3/search?q={packageId}";
+ }
+
public static string GetApiDefinitionUrl(string url, ApplicationApiDescriptionModelRequestDto model = null)
{
url = url.EnsureEndsWith('/');
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CommercialPackages.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CommercialPackages.cs
index e99eddb499..7bfb578a2d 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CommercialPackages.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CommercialPackages.cs
@@ -4,9 +4,9 @@ using System.Text;
namespace Volo.Abp.Cli.Version;
-internal static class CommercialPackages
+static internal class CommercialPackages
{
- private static readonly HashSet Packages = new()
+ private readonly static HashSet Packages = new()
{
"volo.abp.suite"
//other PRO packages can be added to this list...
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/PackageVersionCheckerService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/PackageVersionCheckerService.cs
index 43ced1a1a1..de8511cdca 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/PackageVersionCheckerService.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/PackageVersionCheckerService.cs
@@ -109,20 +109,54 @@ public class PackageVersionCheckerService : ITransientDependency
return await GetPackageVersionsFromMyGet(packageId);
}
- if (CommercialPackages.IsCommercial(packageId))
+ if (await IsCommercialPackageAsync(packageId))
{
return await GetPackageVersionsFromAbpCommercialNuGetAsync(packageId);
}
- else
+
+ return await GetPackageVersionsFromNuGetOrgAsync(packageId) ?? new List();
+ }
+
+ private async Task IsCommercialPackageAsync(string packageId)
+ {
+ if (CommercialPackages.IsCommercial(packageId))
+ {
+ return true;
+ }
+
+ await SetApiKeyResultAsync();
+ if (_apiKeyResult?.ApiKey == null)
{
- var packagesFromNugetOrg = await GetPackageVersionsFromNuGetOrgAsync(packageId);
- if (packagesFromNugetOrg != null)
+ return false;
+ }
+
+ var searchUrl = CliUrls.GetNuGetPackageSearchUrl(_apiKeyResult.ApiKey, packageId);
+ return await HasAnyPackageAsync(searchUrl);
+ }
+
+ private async Task HasAnyPackageAsync(string url)
+ {
+ try
+ {
+ var client = _cliHttpClientFactory.CreateClient(needsAuthentication: false);
+
+ using (var responseMessage = await client.GetHttpResponseMessageWithRetryAsync(
+ url,
+ cancellationToken: CancellationTokenProvider.Token,
+ logger: Logger
+ ))
{
- return packagesFromNugetOrg;
+ await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage);
+
+ var responseContent = await responseMessage.Content.ReadAsStringAsync();
+
+ return JsonSerializer.Deserialize(responseContent).TotalHits > 0;
}
}
-
- return await GetPackageVersionsFromAbpCommercialNuGetAsync(packageId);
+ catch (Exception)
+ {
+ return false;
+ }
}
private async Task> GetPackageVersionsFromAbpCommercialNuGetAsync(string packageId)
@@ -175,19 +209,15 @@ public class PackageVersionCheckerService : ITransientDependency
private async Task GetNuGetUrlForCommercialPackage(string packageId)
{
- if (_apiKeyResult == null)
- {
- _apiKeyResult = await _apiKeyService.GetApiKeyOrNullAsync();
-
- if (_apiKeyResult == null)
- {
- return null;
- }
- }
-
+ await SetApiKeyResultAsync();
return CliUrls.GetNuGetPackageInfoUrl(_apiKeyResult.ApiKey, packageId);
}
+ private async Task SetApiKeyResultAsync()
+ {
+ _apiKeyResult ??= await _apiKeyService.GetApiKeyOrNullAsync();
+ }
+
private async Task GetLatestStableVersionOrNullAsync()
{
try
@@ -214,6 +244,12 @@ public class PackageVersionCheckerService : ITransientDependency
}
}
+ public class NuGetSearchResultDto
+ {
+ [JsonProperty("totalHits")]
+ public int TotalHits { get; set; }
+ }
+
public class NuGetVersionResultDto
{
[JsonProperty("versions")]
diff --git a/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj b/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj
index e208ecf533..8bf90f7767 100644
--- a/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj
+++ b/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Core
Volo.Abp.Core
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
@@ -32,4 +32,7 @@
+
+
+
diff --git a/framework/src/Volo.Abp.Data/Volo.Abp.Data.csproj b/framework/src/Volo.Abp.Data/Volo.Abp.Data.csproj
index b1077c82da..b5d2589b19 100644
--- a/framework/src/Volo.Abp.Data/Volo.Abp.Data.csproj
+++ b/framework/src/Volo.Abp.Data/Volo.Abp.Data.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Data
Volo.Abp.Data
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj
index a955026b52..bde6d12081 100644
--- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj
+++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Ddd.Application.Contracts
Volo.Abp.Ddd.Application.Contracts
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj b/framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj
index ca69278768..fc0586ce8e 100644
--- a/framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj
+++ b/framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Ddd.Application
Volo.Abp.Ddd.Application
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj b/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj
index f10f6fdebd..fd80a60544 100644
--- a/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj
+++ b/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Ddd.Domain
Volo.Abp.Ddd.Domain
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj
index 85b832eefb..7e01d295e7 100644
--- a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj
+++ b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.DistributedLocking.Abstractions
Volo.Abp.DistributedLocking.Abstractions
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.DistributedLocking/Volo.Abp.DistributedLocking.csproj b/framework/src/Volo.Abp.DistributedLocking/Volo.Abp.DistributedLocking.csproj
index 0abb5e699c..ae9f960917 100644
--- a/framework/src/Volo.Abp.DistributedLocking/Volo.Abp.DistributedLocking.csproj
+++ b/framework/src/Volo.Abp.DistributedLocking/Volo.Abp.DistributedLocking.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.DistributedLocking
Volo.Abp.DistributedLocking
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj
index a2f83399a0..e2c55f2bb6 100644
--- a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj
+++ b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Emailing
Volo.Abp.Emailing
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs
index 33fdadc9b4..0a5eaa851e 100644
--- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs
+++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs
@@ -462,7 +462,7 @@ public abstract class AbpDbContext : DbContext, IAbpEfCoreDbContext,
protected virtual void ApplyAbpConceptsForModifiedEntity(EntityEntry entry)
{
- if (entry.State == EntityState.Modified && entry.Properties.Any(x => x.IsModified && x.Metadata.ValueGenerated == ValueGenerated.Never))
+ if (entry.State == EntityState.Modified && entry.Properties.Any(x => x.IsModified && (x.Metadata.ValueGenerated == ValueGenerated.Never || x.Metadata.ValueGenerated == ValueGenerated.OnAdd)))
{
IncrementEntityVersionProperty(entry);
SetModificationAuditProperties(entry);
diff --git a/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj b/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj
index ae0cef7f59..225b9b70ee 100644
--- a/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj
+++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/DistributedEventReceived.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/DistributedEventReceived.cs
new file mode 100644
index 0000000000..42036d85ce
--- /dev/null
+++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/DistributedEventReceived.cs
@@ -0,0 +1,10 @@
+namespace Volo.Abp.EventBus.Distributed;
+
+public class DistributedEventReceived
+{
+ public DistributedEventSource Source { get; set; }
+
+ public string EventName { get; set; }
+
+ public object EventData { get; set; }
+}
diff --git a/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/DistributedEventSent.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/DistributedEventSent.cs
new file mode 100644
index 0000000000..990068e0cc
--- /dev/null
+++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/DistributedEventSent.cs
@@ -0,0 +1,10 @@
+namespace Volo.Abp.EventBus.Distributed;
+
+public class DistributedEventSent
+{
+ public DistributedEventSource Source { get; set; }
+
+ public string EventName { get; set; }
+
+ public object EventData { get; set; }
+}
diff --git a/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/DistributedEventSource.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/DistributedEventSource.cs
new file mode 100644
index 0000000000..a1cea8eef7
--- /dev/null
+++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/DistributedEventSource.cs
@@ -0,0 +1,10 @@
+namespace Volo.Abp.EventBus.Distributed;
+
+public enum DistributedEventSource
+{
+ Direct,
+
+ Inbox,
+
+ Outbox
+}
diff --git a/framework/src/Volo.Abp.EventBus.Azure/Volo.Abp.EventBus.Azure.csproj b/framework/src/Volo.Abp.EventBus.Azure/Volo.Abp.EventBus.Azure.csproj
index 2ffd853cdc..7cbaa944da 100644
--- a/framework/src/Volo.Abp.EventBus.Azure/Volo.Abp.EventBus.Azure.csproj
+++ b/framework/src/Volo.Abp.EventBus.Azure/Volo.Abp.EventBus.Azure.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.EventBus.Azure
Volo.Abp.EventBus.Azure
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs
index 78e26e7c32..8279a412a5 100644
--- a/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs
+++ b/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs
@@ -9,6 +9,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.AzureServiceBus;
+using Volo.Abp.EventBus.Local;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Threading;
@@ -21,13 +22,13 @@ namespace Volo.Abp.EventBus.Azure;
[ExposeServices(typeof(IDistributedEventBus), typeof(AzureDistributedEventBus))]
public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDependency
{
- private readonly AbpAzureEventBusOptions _options;
- private readonly IAzureServiceBusMessageConsumerFactory _messageConsumerFactory;
- private readonly IPublisherPool _publisherPool;
- private readonly IAzureServiceBusSerializer _serializer;
- private readonly ConcurrentDictionary> _handlerFactories;
- private readonly ConcurrentDictionary _eventTypes;
- private IAzureServiceBusMessageConsumer _consumer;
+ protected AbpAzureEventBusOptions Options { get; }
+ protected IAzureServiceBusMessageConsumerFactory MessageConsumerFactory { get; }
+ protected IPublisherPool PublisherPool { get; }
+ protected IAzureServiceBusSerializer Serializer { get; }
+ protected ConcurrentDictionary> HandlerFactories { get; }
+ protected ConcurrentDictionary EventTypes { get; }
+ protected IAzureServiceBusMessageConsumer Consumer { get; private set; }
public AzureDistributedEventBus(
IServiceScopeFactory serviceScopeFactory,
@@ -40,31 +41,33 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen
IAzureServiceBusSerializer serializer,
IAzureServiceBusMessageConsumerFactory messageConsumerFactory,
IPublisherPool publisherPool,
- IEventHandlerInvoker eventHandlerInvoker)
+ IEventHandlerInvoker eventHandlerInvoker,
+ ILocalEventBus localEventBus)
: base(serviceScopeFactory,
currentTenant,
unitOfWorkManager,
abpDistributedEventBusOptions,
guidGenerator,
clock,
- eventHandlerInvoker)
+ eventHandlerInvoker,
+ localEventBus)
{
- _options = abpAzureEventBusOptions.Value;
- _serializer = serializer;
- _messageConsumerFactory = messageConsumerFactory;
- _publisherPool = publisherPool;
- _handlerFactories = new ConcurrentDictionary>();
- _eventTypes = new ConcurrentDictionary();
+ Options = abpAzureEventBusOptions.Value;
+ Serializer = serializer;
+ MessageConsumerFactory = messageConsumerFactory;
+ PublisherPool = publisherPool;
+ HandlerFactories = new ConcurrentDictionary>();
+ EventTypes = new ConcurrentDictionary();
}
public void Initialize()
{
- _consumer = _messageConsumerFactory.CreateMessageConsumer(
- _options.TopicName,
- _options.SubscriberName,
- _options.ConnectionName);
+ Consumer = MessageConsumerFactory.CreateMessageConsumer(
+ Options.TopicName,
+ Options.SubscriberName,
+ Options.ConnectionName);
- _consumer.OnMessageReceived(ProcessEventAsync);
+ Consumer.OnMessageReceived(ProcessEventAsync);
SubscribeHandlers(AbpDistributedEventBusOptions.Handlers);
}
@@ -75,24 +78,31 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen
{
return;
}
- var eventType = _eventTypes.GetOrDefault(eventName);
+ var eventType = EventTypes.GetOrDefault(eventName);
if (eventType == null)
{
return;
}
- if (await AddToInboxAsync(message.MessageId, eventName, eventType, message.Body.ToArray()))
+ var eventData = Serializer.Deserialize(message.Body.ToArray(), eventType);
+
+ if (await AddToInboxAsync(message.MessageId, eventName, eventType, eventData))
{
return;
}
- var eventData = _serializer.Deserialize(message.Body.ToArray(), eventType);
-
- await TriggerHandlersAsync(eventType, eventData);
+ await TriggerHandlersDirectAsync(eventType, eventData);
}
public async override Task PublishFromOutboxAsync(OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig)
{
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Outbox,
+ EventName = outgoingEvent.EventName,
+ EventData = outgoingEvent.EventData
+ });
+
await PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, outgoingEvent.Id);
}
@@ -100,9 +110,9 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen
{
var outgoingEventArray = outgoingEvents.ToArray();
- var publisher = await _publisherPool.GetAsync(
- _options.TopicName,
- _options.ConnectionName);
+ var publisher = await PublisherPool.GetAsync(
+ Options.TopicName,
+ Options.ConnectionName);
using var messageBatch = await publisher.CreateMessageBatchAsync();
@@ -120,6 +130,13 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen
throw new AbpException(
"The message is too large to fit in the batch. Set AbpEventBusBoxesOptions.OutboxWaitingEventMaxCount to reduce the number");
}
+
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Outbox,
+ EventName = outgoingEvent.EventName,
+ EventData = outgoingEvent.EventData
+ });
}
await publisher.SendMessagesAsync(messageBatch);
@@ -127,15 +144,15 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen
public async override Task ProcessFromInboxAsync(IncomingEventInfo incomingEvent, InboxConfig inboxConfig)
{
- var eventType = _eventTypes.GetOrDefault(incomingEvent.EventName);
+ var eventType = EventTypes.GetOrDefault(incomingEvent.EventName);
if (eventType == null)
{
return;
}
- var eventData = _serializer.Deserialize(incomingEvent.EventData, eventType);
+ var eventData = Serializer.Deserialize(incomingEvent.EventData, eventType);
var exceptions = new List();
- await TriggerHandlersAsync(eventType, eventData, exceptions, inboxConfig);
+ await TriggerHandlersFromInboxAsync(eventType, eventData, exceptions, inboxConfig);
if (exceptions.Any())
{
ThrowOriginalExceptions(eventType, exceptions);
@@ -144,7 +161,7 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen
protected override byte[] Serialize(object eventData)
{
- return _serializer.Serialize(eventData);
+ return Serializer.Serialize(eventData);
}
public override IDisposable Subscribe(Type eventType, IEventHandlerFactory factory)
@@ -225,7 +242,7 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen
protected virtual Task PublishAsync(string eventName, object eventData)
{
- var body = _serializer.Serialize(eventData);
+ var body = Serializer.Serialize(eventData);
return PublishAsync(eventName, body, null);
}
@@ -245,16 +262,16 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen
message.MessageId = (eventId ?? GuidGenerator.Create()).ToString("N");
}
- var publisher = await _publisherPool.GetAsync(
- _options.TopicName,
- _options.ConnectionName);
+ var publisher = await PublisherPool.GetAsync(
+ Options.TopicName,
+ Options.ConnectionName);
await publisher.SendMessageAsync(message);
}
protected override IEnumerable GetHandlerFactories(Type eventType)
{
- return _handlerFactories
+ return HandlerFactories
.Where(hf => ShouldTriggerEventForHandler(eventType, hf.Key))
.Select(handlerFactory =>
new EventTypeWithEventHandlerFactories(handlerFactory.Key, handlerFactory.Value))
@@ -266,14 +283,20 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen
return handlerEventType == targetEventType || handlerEventType.IsAssignableFrom(targetEventType);
}
+ protected override Task OnAddToOutboxAsync(string eventName, Type eventType, object eventData)
+ {
+ EventTypes.GetOrAdd(eventName, eventType);
+ return base.OnAddToOutboxAsync(eventName, eventType, eventData);
+ }
+
private List GetOrCreateHandlerFactories(Type eventType)
{
- return _handlerFactories.GetOrAdd(
+ return HandlerFactories.GetOrAdd(
eventType,
type =>
{
var eventName = EventNameAttribute.GetNameOrDefault(type);
- _eventTypes[eventName] = type;
+ EventTypes.GetOrAdd(eventName, eventType);
return new List();
}
);
diff --git a/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/DaprDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/DaprDistributedEventBus.cs
index a00127ac8c..23cf8aa1e9 100644
--- a/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/DaprDistributedEventBus.cs
+++ b/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/DaprDistributedEventBus.cs
@@ -8,6 +8,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.Dapr;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
+using Volo.Abp.EventBus.Local;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Threading;
@@ -37,8 +38,9 @@ public class DaprDistributedEventBus : DistributedEventBusBase, ISingletonDepend
IEventHandlerInvoker eventHandlerInvoker,
IDaprSerializer serializer,
IOptions daprEventBusOptions,
- IAbpDaprClientFactory daprClientFactory)
- : base(serviceScopeFactory, currentTenant, unitOfWorkManager, abpDistributedEventBusOptions, guidGenerator, clock, eventHandlerInvoker)
+ IAbpDaprClientFactory daprClientFactory,
+ ILocalEventBus localEventBus)
+ : base(serviceScopeFactory, currentTenant, unitOfWorkManager, abpDistributedEventBusOptions, guidGenerator, clock, eventHandlerInvoker, localEventBus)
{
Serializer = serializer;
DaprEventBusOptions = daprEventBusOptions.Value;
@@ -141,6 +143,13 @@ public class DaprDistributedEventBus : DistributedEventBusBase, ISingletonDepend
public override async Task PublishFromOutboxAsync(OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig)
{
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Outbox,
+ EventName = outgoingEvent.EventName,
+ EventData = outgoingEvent.EventData
+ });
+
await PublishToDaprAsync(outgoingEvent.EventName, Serializer.Deserialize(outgoingEvent.EventData, GetEventType(outgoingEvent.EventName)));
}
@@ -150,10 +159,27 @@ public class DaprDistributedEventBus : DistributedEventBusBase, ISingletonDepend
foreach (var outgoingEvent in outgoingEventArray)
{
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Outbox,
+ EventName = outgoingEvent.EventName,
+ EventData = outgoingEvent.EventData
+ });
+
await PublishToDaprAsync(outgoingEvent.EventName, Serializer.Deserialize(outgoingEvent.EventData, GetEventType(outgoingEvent.EventName)));
}
}
+ public virtual async Task TriggerHandlersAsync(string messageId, Type eventType, object eventData)
+ {
+ if (await AddToInboxAsync(messageId, EventNameAttribute.GetNameOrDefault(eventType), eventType, eventData))
+ {
+ return;
+ }
+
+ await TriggerHandlersDirectAsync(eventType, eventData);
+ }
+
public async override Task ProcessFromInboxAsync(IncomingEventInfo incomingEvent, InboxConfig inboxConfig)
{
var eventType = EventTypes.GetOrDefault(incomingEvent.EventName);
@@ -164,7 +190,7 @@ public class DaprDistributedEventBus : DistributedEventBusBase, ISingletonDepend
var eventData = Serializer.Deserialize(incomingEvent.EventData, eventType);
var exceptions = new List();
- await TriggerHandlersAsync(eventType, eventData, exceptions, inboxConfig);
+ await TriggerHandlersFromInboxAsync(eventType, eventData, exceptions, inboxConfig);
if (exceptions.Any())
{
ThrowOriginalExceptions(eventType, exceptions);
@@ -176,6 +202,12 @@ public class DaprDistributedEventBus : DistributedEventBusBase, ISingletonDepend
return Serializer.Serialize(eventData);
}
+ protected override Task OnAddToOutboxAsync(string eventName, Type eventType, object eventData)
+ {
+ EventTypes.GetOrAdd(eventName, eventType);
+ return base.OnAddToOutboxAsync(eventName, eventType, eventData);
+ }
+
private List GetOrCreateHandlerFactories(Type eventType)
{
return HandlerFactories.GetOrAdd(
@@ -183,7 +215,7 @@ public class DaprDistributedEventBus : DistributedEventBusBase, ISingletonDepend
type =>
{
var eventName = EventNameAttribute.GetNameOrDefault(type);
- EventTypes[eventName] = type;
+ EventTypes.GetOrAdd(eventName, eventType);
return new List();
}
);
diff --git a/framework/src/Volo.Abp.EventBus.Kafka/Volo.Abp.EventBus.Kafka.csproj b/framework/src/Volo.Abp.EventBus.Kafka/Volo.Abp.EventBus.Kafka.csproj
index cbf8d78aea..9a240aa49a 100644
--- a/framework/src/Volo.Abp.EventBus.Kafka/Volo.Abp.EventBus.Kafka.csproj
+++ b/framework/src/Volo.Abp.EventBus.Kafka/Volo.Abp.EventBus.Kafka.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/KafkaDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/KafkaDistributedEventBus.cs
index aa79c81f50..62e161fad1 100644
--- a/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/KafkaDistributedEventBus.cs
+++ b/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/KafkaDistributedEventBus.cs
@@ -8,6 +8,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
+using Volo.Abp.EventBus.Local;
using Volo.Abp.Guids;
using Volo.Abp.Kafka;
using Volo.Abp.MultiTenancy;
@@ -40,7 +41,8 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen
IProducerPool producerPool,
IGuidGenerator guidGenerator,
IClock clock,
- IEventHandlerInvoker eventHandlerInvoker)
+ IEventHandlerInvoker eventHandlerInvoker,
+ ILocalEventBus localEventBus)
: base(
serviceScopeFactory,
currentTenant,
@@ -48,7 +50,8 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen
abpDistributedEventBusOptions,
guidGenerator,
clock,
- eventHandlerInvoker)
+ eventHandlerInvoker,
+ localEventBus)
{
AbpKafkaEventBusOptions = abpKafkaEventBusOptions.Value;
MessageConsumerFactory = messageConsumerFactory;
@@ -80,15 +83,14 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen
}
var messageId = message.GetMessageId();
+ var eventData = Serializer.Deserialize(message.Value, eventType);
- if (await AddToInboxAsync(messageId, eventName, eventType, message.Value))
+ if (await AddToInboxAsync(messageId, eventName, eventType, eventData))
{
return;
}
- var eventData = Serializer.Deserialize(message.Value, eventType);
-
- await TriggerHandlersAsync(eventType, eventData);
+ await TriggerHandlersDirectAsync(eventType, eventData);
}
public override IDisposable Subscribe(Type eventType, IEventHandlerFactory factory)
@@ -177,11 +179,18 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen
unitOfWork.AddOrReplaceDistributedEvent(eventRecord);
}
- public override Task PublishFromOutboxAsync(
+ public override async Task PublishFromOutboxAsync(
OutgoingEventInfo outgoingEvent,
OutboxConfig outboxConfig)
{
- return PublishAsync(
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Outbox,
+ EventName = outgoingEvent.EventName,
+ EventData = outgoingEvent.EventData
+ });
+
+ await PublishAsync(
AbpKafkaEventBusOptions.TopicName,
outgoingEvent.EventName,
outgoingEvent.EventData,
@@ -192,19 +201,26 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen
);
}
- public override Task PublishManyFromOutboxAsync(IEnumerable outgoingEvents, OutboxConfig outboxConfig)
+ public async override Task PublishManyFromOutboxAsync(IEnumerable outgoingEvents, OutboxConfig outboxConfig)
{
var producer = ProducerPool.Get(AbpKafkaEventBusOptions.ConnectionName);
var outgoingEventArray = outgoingEvents.ToArray();
-
+
foreach (var outgoingEvent in outgoingEventArray)
{
var messageId = outgoingEvent.Id.ToString("N");
- var headers = new Headers
+ var headers = new Headers
{
{ "messageId", System.Text.Encoding.UTF8.GetBytes(messageId)}
};
-
+
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Outbox,
+ EventName = outgoingEvent.EventName,
+ EventData = outgoingEvent.EventData
+ });
+
producer.Produce(
AbpKafkaEventBusOptions.TopicName,
new Message
@@ -214,8 +230,6 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen
Headers = headers
});
}
-
- return Task.CompletedTask;
}
public async override Task ProcessFromInboxAsync(
@@ -230,7 +244,7 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen
var eventData = Serializer.Deserialize(incomingEvent.EventData, eventType);
var exceptions = new List();
- await TriggerHandlersAsync(eventType, eventData, exceptions, inboxConfig);
+ await TriggerHandlersFromInboxAsync(eventType, eventData, exceptions, inboxConfig);
if (exceptions.Any())
{
ThrowOriginalExceptions(eventType, exceptions);
@@ -251,9 +265,9 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen
}
private Task> PublishAsync(
- string topicName,
+ string topicName,
string eventName,
- byte[] body,
+ byte[] body,
Headers headers)
{
var producer = ProducerPool.Get(AbpKafkaEventBusOptions.ConnectionName);
@@ -268,6 +282,12 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen
});
}
+ protected override Task OnAddToOutboxAsync(string eventName, Type eventType, object eventData)
+ {
+ EventTypes.GetOrAdd(eventName, eventType);
+ return base.OnAddToOutboxAsync(eventName, eventType, eventData);
+ }
+
private List GetOrCreateHandlerFactories(Type eventType)
{
return HandlerFactories.GetOrAdd(
@@ -275,7 +295,7 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen
type =>
{
var eventName = EventNameAttribute.GetNameOrDefault(type);
- EventTypes[eventName] = type;
+ EventTypes.GetOrAdd(eventName, eventType);
return new List();
}
);
diff --git a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo.Abp.EventBus.RabbitMQ.csproj b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo.Abp.EventBus.RabbitMQ.csproj
index 40787f3fb2..73c4d4a69a 100644
--- a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo.Abp.EventBus.RabbitMQ.csproj
+++ b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo.Abp.EventBus.RabbitMQ.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.EventBus.RabbitMQ
Volo.Abp.EventBus.RabbitMQ
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs
index 7e352ca530..8d4756165a 100644
--- a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs
+++ b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs
@@ -9,6 +9,7 @@ using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
+using Volo.Abp.EventBus.Local;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.RabbitMQ;
@@ -47,7 +48,8 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe
IUnitOfWorkManager unitOfWorkManager,
IGuidGenerator guidGenerator,
IClock clock,
- IEventHandlerInvoker eventHandlerInvoker)
+ IEventHandlerInvoker eventHandlerInvoker,
+ ILocalEventBus localEventBus)
: base(
serviceScopeFactory,
currentTenant,
@@ -55,7 +57,8 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe
distributedEventBusOptions,
guidGenerator,
clock,
- eventHandlerInvoker)
+ eventHandlerInvoker,
+ localEventBus)
{
ConnectionPool = connectionPool;
Serializer = serializer;
@@ -98,16 +101,14 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe
return;
}
- var eventBytes = ea.Body.ToArray();
+ var eventData = Serializer.Deserialize(ea.Body.ToArray(), eventType);
- if (await AddToInboxAsync(ea.BasicProperties.MessageId, eventName, eventType, eventBytes))
+ if (await AddToInboxAsync(ea.BasicProperties.MessageId, eventName, eventType, eventData))
{
return;
}
- var eventData = Serializer.Deserialize(eventBytes, eventType);
-
- await TriggerHandlersAsync(eventType, eventData);
+ await TriggerHandlersDirectAsync(eventType, eventData);
}
public override IDisposable Subscribe(Type eventType, IEventHandlerFactory factory)
@@ -193,11 +194,18 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe
unitOfWork.AddOrReplaceDistributedEvent(eventRecord);
}
- public override Task PublishFromOutboxAsync(
+ public override async Task PublishFromOutboxAsync(
OutgoingEventInfo outgoingEvent,
OutboxConfig outboxConfig)
{
- return PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, null, eventId: outgoingEvent.Id);
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Outbox,
+ EventName = outgoingEvent.EventName,
+ EventData = outgoingEvent.EventData
+ });
+
+ await PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, null, eventId: outgoingEvent.Id);
}
public async override Task PublishManyFromOutboxAsync(
@@ -211,10 +219,17 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe
foreach (var outgoingEvent in outgoingEventArray)
{
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Outbox,
+ EventName = outgoingEvent.EventName,
+ EventData = outgoingEvent.EventData
+ });
+
await PublishAsync(
channel,
- outgoingEvent.EventName,
- outgoingEvent.EventData,
+ outgoingEvent.EventName,
+ outgoingEvent.EventData,
properties: null,
eventId: outgoingEvent.Id);
}
@@ -235,7 +250,7 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe
var eventData = Serializer.Deserialize(incomingEvent.EventData, eventType);
var exceptions = new List();
- await TriggerHandlersAsync(eventType, eventData, exceptions, inboxConfig);
+ await TriggerHandlersFromInboxAsync(eventType, eventData, exceptions, inboxConfig);
if (exceptions.Any())
{
ThrowOriginalExceptions(eventType, exceptions);
@@ -249,7 +264,7 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe
public Task PublishAsync(
Type eventType,
- object eventData,
+ object eventData,
IBasicProperties properties,
Dictionary headersArguments = null)
{
@@ -343,6 +358,12 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe
}
}
+ protected override Task OnAddToOutboxAsync(string eventName, Type eventType, object eventData)
+ {
+ EventTypes.GetOrAdd(eventName, eventType);
+ return base.OnAddToOutboxAsync(eventName, eventType, eventData);
+ }
+
private List GetOrCreateHandlerFactories(Type eventType)
{
return HandlerFactories.GetOrAdd(
@@ -350,7 +371,7 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe
type =>
{
var eventName = EventNameAttribute.GetNameOrDefault(type);
- EventTypes[eventName] = type;
+ EventTypes.GetOrAdd(eventName, eventType);
return new List();
}
);
diff --git a/framework/src/Volo.Abp.EventBus.Rebus/Volo.Abp.EventBus.Rebus.csproj b/framework/src/Volo.Abp.EventBus.Rebus/Volo.Abp.EventBus.Rebus.csproj
index c862e1845b..9800674fab 100644
--- a/framework/src/Volo.Abp.EventBus.Rebus/Volo.Abp.EventBus.Rebus.csproj
+++ b/framework/src/Volo.Abp.EventBus.Rebus/Volo.Abp.EventBus.Rebus.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.EventBus.Rebus
Volo.Abp.EventBus.Rebus
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs
index bfe763d960..0983e98836 100644
--- a/framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs
+++ b/framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs
@@ -11,6 +11,7 @@ using Rebus.Pipeline;
using Rebus.Transport;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
+using Volo.Abp.EventBus.Local;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Threading;
@@ -41,7 +42,8 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen
IRebusSerializer serializer,
IGuidGenerator guidGenerator,
IClock clock,
- IEventHandlerInvoker eventHandlerInvoker) :
+ IEventHandlerInvoker eventHandlerInvoker,
+ ILocalEventBus localEventBus) :
base(
serviceScopeFactory,
currentTenant,
@@ -49,7 +51,8 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen
abpDistributedEventBusOptions,
guidGenerator,
clock,
- eventHandlerInvoker)
+ eventHandlerInvoker,
+ localEventBus)
{
Rebus = rebus;
Serializer = serializer;
@@ -142,12 +145,12 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen
var messageId = MessageContext.Current.TransportMessage.GetMessageId();
var eventName = EventNameAttribute.GetNameOrDefault(eventType);
- if (await AddToInboxAsync(messageId, eventName, eventType, MessageContext.Current.TransportMessage.Body))
+ if (await AddToInboxAsync(messageId, eventName, eventType, eventData))
{
return;
}
- await TriggerHandlersAsync(eventType, eventData);
+ await TriggerHandlersDirectAsync(eventType, eventData);
}
protected async override Task PublishToEventBusAsync(Type eventType, object eventData)
@@ -181,6 +184,12 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen
unitOfWork.AddOrReplaceDistributedEvent(eventRecord);
}
+ protected override Task OnAddToOutboxAsync(string eventName, Type eventType, object eventData)
+ {
+ EventTypes.GetOrAdd(eventName, eventType);
+ return base.OnAddToOutboxAsync(eventName, eventType, eventData);
+ }
+
private List GetOrCreateHandlerFactories(Type eventType)
{
return HandlerFactories.GetOrAdd(
@@ -188,7 +197,7 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen
type =>
{
var eventName = EventNameAttribute.GetNameOrDefault(type);
- EventTypes[eventName] = type;
+ EventTypes.GetOrAdd(eventName, eventType);
return new List();
}
);
@@ -225,14 +234,21 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen
return false;
}
- public override Task PublishFromOutboxAsync(
+ public override async Task PublishFromOutboxAsync(
OutgoingEventInfo outgoingEvent,
OutboxConfig outboxConfig)
{
var eventType = EventTypes.GetOrDefault(outgoingEvent.EventName);
var eventData = Serializer.Deserialize(outgoingEvent.EventData, eventType);
- return PublishAsync(eventType, eventData, eventId: outgoingEvent.Id);
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Outbox,
+ EventName = outgoingEvent.EventName,
+ EventData = outgoingEvent.EventData
+ });
+
+ await PublishAsync(eventType, eventData, eventId: outgoingEvent.Id);
}
public async override Task PublishManyFromOutboxAsync(IEnumerable outgoingEvents, OutboxConfig outboxConfig)
@@ -243,9 +259,16 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen
{
foreach (var outgoingEvent in outgoingEventArray)
{
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Outbox,
+ EventName = outgoingEvent.EventName,
+ EventData = outgoingEvent.EventData
+ });
+
await PublishFromOutboxAsync(outgoingEvent, outboxConfig);
}
-
+
await scope.CompleteAsync();
}
}
@@ -262,7 +285,7 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen
var eventData = Serializer.Deserialize(incomingEvent.EventData, eventType);
var exceptions = new List();
- await TriggerHandlersAsync(eventType, eventData, exceptions, inboxConfig);
+ await TriggerHandlersFromInboxAsync(eventType, eventData, exceptions, inboxConfig);
if (exceptions.Any())
{
ThrowOriginalExceptions(eventType, exceptions);
diff --git a/framework/src/Volo.Abp.EventBus/Volo.Abp.EventBus.csproj b/framework/src/Volo.Abp.EventBus/Volo.Abp.EventBus.csproj
index bee75bf7ff..500c6cc507 100644
--- a/framework/src/Volo.Abp.EventBus/Volo.Abp.EventBus.csproj
+++ b/framework/src/Volo.Abp.EventBus/Volo.Abp.EventBus.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.EventBus
Volo.Abp.EventBus
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs
index 5da66e03cd..89423ce111 100644
--- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs
+++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
+using Volo.Abp.EventBus.Local;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Timing;
@@ -16,6 +17,7 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
protected IGuidGenerator GuidGenerator { get; }
protected IClock Clock { get; }
protected AbpDistributedEventBusOptions AbpDistributedEventBusOptions { get; }
+ protected ILocalEventBus LocalEventBus { get; }
protected DistributedEventBusBase(
IServiceScopeFactory serviceScopeFactory,
@@ -24,8 +26,8 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
IOptions abpDistributedEventBusOptions,
IGuidGenerator guidGenerator,
IClock clock,
- IEventHandlerInvoker eventHandlerInvoker
- ) : base(
+ IEventHandlerInvoker eventHandlerInvoker,
+ ILocalEventBus localEventBus) : base(
serviceScopeFactory,
currentTenant,
unitOfWorkManager,
@@ -34,6 +36,7 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
GuidGenerator = guidGenerator;
Clock = clock;
AbpDistributedEventBusOptions = abpDistributedEventBusOptions.Value;
+ LocalEventBus = localEventBus;
}
public IDisposable Subscribe(IDistributedEventHandler handler) where TEvent : class
@@ -78,6 +81,13 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
}
}
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Direct,
+ EventName = EventNameAttribute.GetNameOrDefault(eventType),
+ EventData = eventData
+ });
+
await PublishToEventBusAsync(eventType, eventData);
}
@@ -95,7 +105,7 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
IncomingEventInfo incomingEvent,
InboxConfig inboxConfig);
- private async Task AddToOutboxAsync(Type eventType, object eventData)
+ protected virtual async Task AddToOutboxAsync(Type eventType, object eventData)
{
var unitOfWork = UnitOfWorkManager.Current;
if (unitOfWork == null)
@@ -107,9 +117,18 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
{
if (outboxConfig.Selector == null || outboxConfig.Selector(eventType))
{
- var eventOutbox =
- (IEventOutbox)unitOfWork.ServiceProvider.GetRequiredService(outboxConfig.ImplementationType);
+ var eventOutbox = (IEventOutbox)unitOfWork.ServiceProvider.GetRequiredService(outboxConfig.ImplementationType);
var eventName = EventNameAttribute.GetNameOrDefault(eventType);
+
+ await OnAddToOutboxAsync(eventName, eventType, eventData);
+
+ await TriggerDistributedEventSentAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Direct,
+ EventName = eventName,
+ EventData = eventData
+ });
+
await eventOutbox.EnqueueAsync(
new OutgoingEventInfo(
GuidGenerator.Create(),
@@ -125,11 +144,16 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
return false;
}
+ protected virtual Task OnAddToOutboxAsync(string eventName, Type eventType, object eventData)
+ {
+ return Task.CompletedTask;
+ }
+
protected async Task AddToInboxAsync(
string messageId,
string eventName,
Type eventType,
- byte[] eventBytes)
+ object eventData)
{
if (AbpDistributedEventBusOptions.Inboxes.Count <= 0)
{
@@ -153,12 +177,19 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
}
}
+ await TriggerDistributedEventReceivedAsync(new DistributedEventReceived
+ {
+ Source = DistributedEventSource.Direct,
+ EventName = EventNameAttribute.GetNameOrDefault(eventType),
+ EventData = eventData
+ });
+
await eventInbox.EnqueueAsync(
new IncomingEventInfo(
GuidGenerator.Create(),
messageId,
eventName,
- eventBytes,
+ Serialize(eventData),
Clock.Now
)
);
@@ -170,4 +201,52 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
}
protected abstract byte[] Serialize(object eventData);
+
+ protected virtual async Task TriggerHandlersDirectAsync(Type eventType, object eventData)
+ {
+ await TriggerDistributedEventReceivedAsync(new DistributedEventReceived
+ {
+ Source = DistributedEventSource.Direct,
+ EventName = EventNameAttribute.GetNameOrDefault(eventType),
+ EventData = eventData
+ });
+
+ await TriggerHandlersAsync(eventType, eventData);
+ }
+
+ protected virtual async Task TriggerHandlersFromInboxAsync(Type eventType, object eventData, List exceptions, InboxConfig inboxConfig = null)
+ {
+ await TriggerDistributedEventReceivedAsync(new DistributedEventReceived
+ {
+ Source = DistributedEventSource.Inbox,
+ EventName = EventNameAttribute.GetNameOrDefault(eventType),
+ EventData = eventData
+ });
+
+ await TriggerHandlersAsync(eventType, eventData, exceptions, inboxConfig);
+ }
+
+ public virtual async Task TriggerDistributedEventSentAsync(DistributedEventSent distributedEvent)
+ {
+ try
+ {
+ await LocalEventBus.PublishAsync(distributedEvent);
+ }
+ catch (Exception _)
+ {
+ // ignored
+ }
+ }
+
+ public virtual async Task TriggerDistributedEventReceivedAsync(DistributedEventReceived distributedEvent)
+ {
+ try
+ {
+ await LocalEventBus.PublishAsync(distributedEvent);
+ }
+ catch (Exception _)
+ {
+ // ignored
+ }
+ }
}
diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs
index 64f375130b..b63133a388 100644
--- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs
+++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs
@@ -28,6 +28,30 @@ public class LocalDistributedEventBus : IDistributedEventBus, ISingletonDependen
ServiceScopeFactory = serviceScopeFactory;
AbpDistributedEventBusOptions = distributedEventBusOptions.Value;
Subscribe(distributedEventBusOptions.Value.Handlers);
+
+ // For unit testing
+ if (localEventBus is LocalEventBus eventBus)
+ {
+ eventBus.OnEventHandleInvoking = async (eventType, eventData) =>
+ {
+ await localEventBus.PublishAsync(new DistributedEventReceived()
+ {
+ Source = DistributedEventSource.Direct,
+ EventName = EventNameAttribute.GetNameOrDefault(eventType),
+ EventData = eventData
+ }, onUnitOfWorkComplete: false);
+ };
+
+ eventBus.OnPublishing = async (eventType, eventData) =>
+ {
+ await localEventBus.PublishAsync(new DistributedEventSent()
+ {
+ Source = DistributedEventSource.Direct,
+ EventName = EventNameAttribute.GetNameOrDefault(eventType),
+ EventData = eventData
+ }, onUnitOfWorkComplete: false);
+ };
+ }
}
public virtual void Subscribe(ITypeList handlers)
@@ -132,7 +156,7 @@ public class LocalDistributedEventBus : IDistributedEventBus, ISingletonDependen
{
return _localEventBus.PublishAsync(eventType, eventData, onUnitOfWorkComplete);
}
-
+
public Task PublishAsync(TEvent eventData, bool onUnitOfWorkComplete = true, bool useOutbox = true) where TEvent : class
{
return _localEventBus.PublishAsync(eventData, onUnitOfWorkComplete);
@@ -142,4 +166,4 @@ public class LocalDistributedEventBus : IDistributedEventBus, ISingletonDependen
{
return _localEventBus.PublishAsync(eventType, eventData, onUnitOfWorkComplete);
}
-}
\ No newline at end of file
+}
diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs
index 6e48b27e5f..516a0008d7 100644
--- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs
+++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs
@@ -9,7 +9,6 @@ using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Collections;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy;
-using Volo.Abp.Reflection;
using Volo.Abp.Uow;
namespace Volo.Abp.EventBus;
@@ -214,7 +213,7 @@ public abstract class EventBusBase : IEventBus
using (CurrentTenant.Change(GetEventDataTenantId(eventData)))
{
- await EventHandlerInvoker.InvokeAsync(eventHandlerWrapper.EventHandler, eventData, eventType);
+ await InvokeEventHandlerAsync(eventHandlerWrapper.EventHandler, eventData, eventType);
}
}
catch (TargetInvocationException ex)
@@ -228,6 +227,11 @@ public abstract class EventBusBase : IEventBus
}
}
+ protected virtual Task InvokeEventHandlerAsync(IEventHandler eventHandler, object eventData, Type eventType)
+ {
+ return EventHandlerInvoker.InvokeAsync(eventHandler, eventData, eventType);
+ }
+
protected virtual Guid? GetEventDataTenantId(object eventData)
{
return eventData switch
diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs
index 3f7dbbc851..9570bf80e1 100644
--- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs
+++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs
@@ -8,6 +8,7 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
+using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Threading;
using Volo.Abp.Uow;
@@ -168,4 +169,45 @@ public class LocalEventBus : EventBusBase, ILocalEventBus, ISingletonDependency
return false;
}
+
+ // Internal for unit testing
+ internal Func OnEventHandleInvoking { get; set; }
+
+ // Internal for unit testing
+ protected async override Task InvokeEventHandlerAsync(IEventHandler eventHandler, object eventData, Type eventType)
+ {
+ if (OnEventHandleInvoking != null && eventType != typeof(DistributedEventSent) && eventType != typeof(DistributedEventReceived))
+ {
+ await OnEventHandleInvoking(eventType, eventData);
+ }
+
+ await base.InvokeEventHandlerAsync(eventHandler, eventData, eventType);
+ }
+
+ // Internal for unit testing
+ internal Func OnPublishing { get; set; }
+
+ // For unit testing
+ public async override Task PublishAsync(
+ Type eventType,
+ object eventData,
+ bool onUnitOfWorkComplete = true)
+ {
+ if (onUnitOfWorkComplete && UnitOfWorkManager.Current != null)
+ {
+ AddToUnitOfWork(
+ UnitOfWorkManager.Current,
+ new UnitOfWorkEventRecord(eventType, eventData, EventOrderGenerator.GetNext())
+ );
+ return;
+ }
+
+ // For unit testing
+ if (OnPublishing != null && eventType != typeof(DistributedEventSent) && eventType != typeof(DistributedEventReceived))
+ {
+ await OnPublishing(eventType, eventData);
+ }
+
+ await PublishToEventBusAsync(eventType, eventData);
+ }
}
diff --git a/framework/src/Volo.Abp.ExceptionHandling/Volo.Abp.ExceptionHandling.csproj b/framework/src/Volo.Abp.ExceptionHandling/Volo.Abp.ExceptionHandling.csproj
index b1d60e60c7..96c708d6c6 100644
--- a/framework/src/Volo.Abp.ExceptionHandling/Volo.Abp.ExceptionHandling.csproj
+++ b/framework/src/Volo.Abp.ExceptionHandling/Volo.Abp.ExceptionHandling.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
true
diff --git a/framework/src/Volo.Abp.Features/Volo.Abp.Features.csproj b/framework/src/Volo.Abp.Features/Volo.Abp.Features.csproj
index 3b58621b45..08f5621892 100644
--- a/framework/src/Volo.Abp.Features/Volo.Abp.Features.csproj
+++ b/framework/src/Volo.Abp.Features/Volo.Abp.Features.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Features
Volo.Abp.Features
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj b/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj
index 4722fac1b0..af4f5c21c0 100644
--- a/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj
+++ b/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.FluentValidation
Volo.Abp.FluentValidation
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Gdpr.Abstractions/Volo.Abp.Gdpr.Abstractions.csproj b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo.Abp.Gdpr.Abstractions.csproj
index 8af8416bb0..412f2f38e4 100644
--- a/framework/src/Volo.Abp.Gdpr.Abstractions/Volo.Abp.Gdpr.Abstractions.csproj
+++ b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo.Abp.Gdpr.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/framework/src/Volo.Abp.GlobalFeatures/Volo.Abp.GlobalFeatures.csproj b/framework/src/Volo.Abp.GlobalFeatures/Volo.Abp.GlobalFeatures.csproj
index 024ec5ec17..7862b829c7 100644
--- a/framework/src/Volo.Abp.GlobalFeatures/Volo.Abp.GlobalFeatures.csproj
+++ b/framework/src/Volo.Abp.GlobalFeatures/Volo.Abp.GlobalFeatures.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.GlobalFeatures
Volo.Abp.GlobalFeatures
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Guids/Volo.Abp.Guids.csproj b/framework/src/Volo.Abp.Guids/Volo.Abp.Guids.csproj
index 6c8c4c4916..ed4e0af802 100644
--- a/framework/src/Volo.Abp.Guids/Volo.Abp.Guids.csproj
+++ b/framework/src/Volo.Abp.Guids/Volo.Abp.Guids.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Guids
Volo.Abp.Guids
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj b/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj
index 2a3d6fe8ba..40d03c2f15 100644
--- a/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj
+++ b/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.HangFire
Volo.Abp.HangFire
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Http.Abstractions/Volo.Abp.Http.Abstractions.csproj b/framework/src/Volo.Abp.Http.Abstractions/Volo.Abp.Http.Abstractions.csproj
index 59de087fc4..332c803147 100644
--- a/framework/src/Volo.Abp.Http.Abstractions/Volo.Abp.Http.Abstractions.csproj
+++ b/framework/src/Volo.Abp.Http.Abstractions/Volo.Abp.Http.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Http.Abstractions
Volo.Abp.Http.Abstractions
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo.Abp.Http.Client.IdentityModel.csproj b/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo.Abp.Http.Client.IdentityModel.csproj
index d8eef1ba5d..083e987d49 100644
--- a/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo.Abp.Http.Client.IdentityModel.csproj
+++ b/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo.Abp.Http.Client.IdentityModel.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Http.Client.IdentityModel
Volo.Abp.Http.Client.IdentityModel
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Http.Client/Volo.Abp.Http.Client.csproj b/framework/src/Volo.Abp.Http.Client/Volo.Abp.Http.Client.csproj
index 67aef7dd89..26708da6b7 100644
--- a/framework/src/Volo.Abp.Http.Client/Volo.Abp.Http.Client.csproj
+++ b/framework/src/Volo.Abp.Http.Client/Volo.Abp.Http.Client.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Http.Client
Volo.Abp.Http.Client
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Http/Volo.Abp.Http.csproj b/framework/src/Volo.Abp.Http/Volo.Abp.Http.csproj
index d707299f21..3b029e3b9d 100644
--- a/framework/src/Volo.Abp.Http/Volo.Abp.Http.csproj
+++ b/framework/src/Volo.Abp.Http/Volo.Abp.Http.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Http
Volo.Abp.Http
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj b/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj
index 8bc6b1b5de..a707f58b9c 100644
--- a/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj
+++ b/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.IdentityModel
Volo.Abp.IdentityModel
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Json.Abstractions/Volo.Abp.Json.Abstractions.csproj b/framework/src/Volo.Abp.Json.Abstractions/Volo.Abp.Json.Abstractions.csproj
index 15130c129c..d3f63e6e20 100644
--- a/framework/src/Volo.Abp.Json.Abstractions/Volo.Abp.Json.Abstractions.csproj
+++ b/framework/src/Volo.Abp.Json.Abstractions/Volo.Abp.Json.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Json.Abstractions
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
false
diff --git a/framework/src/Volo.Abp.Json.Newtonsoft/Volo.Abp.Json.Newtonsoft.csproj b/framework/src/Volo.Abp.Json.Newtonsoft/Volo.Abp.Json.Newtonsoft.csproj
index 6927cff0db..5349254ea3 100644
--- a/framework/src/Volo.Abp.Json.Newtonsoft/Volo.Abp.Json.Newtonsoft.csproj
+++ b/framework/src/Volo.Abp.Json.Newtonsoft/Volo.Abp.Json.Newtonsoft.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Json.Newtonsoft
Volo.Abp.Json.Newtonsoft
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Json.SystemTextJson/Volo.Abp.Json.SystemTextJson.csproj b/framework/src/Volo.Abp.Json.SystemTextJson/Volo.Abp.Json.SystemTextJson.csproj
index b3aba746a3..e7551a0e42 100644
--- a/framework/src/Volo.Abp.Json.SystemTextJson/Volo.Abp.Json.SystemTextJson.csproj
+++ b/framework/src/Volo.Abp.Json.SystemTextJson/Volo.Abp.Json.SystemTextJson.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Json.SystemTextJson
Volo.Abp.Json.SystemTextJson
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Json/Volo.Abp.Json.csproj b/framework/src/Volo.Abp.Json/Volo.Abp.Json.csproj
index eee618b18d..40049addba 100644
--- a/framework/src/Volo.Abp.Json/Volo.Abp.Json.csproj
+++ b/framework/src/Volo.Abp.Json/Volo.Abp.Json.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Json
Volo.Abp.Json
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Kafka/Volo.Abp.Kafka.csproj b/framework/src/Volo.Abp.Kafka/Volo.Abp.Kafka.csproj
index 762ef89854..f66761fc2a 100644
--- a/framework/src/Volo.Abp.Kafka/Volo.Abp.Kafka.csproj
+++ b/framework/src/Volo.Abp.Kafka/Volo.Abp.Kafka.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/framework/src/Volo.Abp.Ldap.Abstractions/Volo.Abp.Ldap.Abstractions.csproj b/framework/src/Volo.Abp.Ldap.Abstractions/Volo.Abp.Ldap.Abstractions.csproj
index 69c8d8930a..9a61150096 100644
--- a/framework/src/Volo.Abp.Ldap.Abstractions/Volo.Abp.Ldap.Abstractions.csproj
+++ b/framework/src/Volo.Abp.Ldap.Abstractions/Volo.Abp.Ldap.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Ldap.Abstractions
Volo.Abp.Ldap.Abstractions
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Ldap/Volo.Abp.Ldap.csproj b/framework/src/Volo.Abp.Ldap/Volo.Abp.Ldap.csproj
index 886787cdf9..951cbf3be2 100644
--- a/framework/src/Volo.Abp.Ldap/Volo.Abp.Ldap.csproj
+++ b/framework/src/Volo.Abp.Ldap/Volo.Abp.Ldap.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Ldap
Volo.Abp.Ldap
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Localization.Abstractions/Volo.Abp.Localization.Abstractions.csproj b/framework/src/Volo.Abp.Localization.Abstractions/Volo.Abp.Localization.Abstractions.csproj
index b883ae7011..952d59b739 100644
--- a/framework/src/Volo.Abp.Localization.Abstractions/Volo.Abp.Localization.Abstractions.csproj
+++ b/framework/src/Volo.Abp.Localization.Abstractions/Volo.Abp.Localization.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Localization.Abstractions
Volo.Abp.Localization.Abstractions
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj
index 53e71d1c38..8b889e2057 100644
--- a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj
+++ b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Localization
Volo.Abp.Localization
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.MailKit/Volo.Abp.MailKit.csproj b/framework/src/Volo.Abp.MailKit/Volo.Abp.MailKit.csproj
index 0665aa9cf2..bec6f35355 100644
--- a/framework/src/Volo.Abp.MailKit/Volo.Abp.MailKit.csproj
+++ b/framework/src/Volo.Abp.MailKit/Volo.Abp.MailKit.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.MailKit
Volo.Abp.MailKit
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.MemoryDb/Volo.Abp.MemoryDb.csproj b/framework/src/Volo.Abp.MemoryDb/Volo.Abp.MemoryDb.csproj
index 1a896b8891..07ddca1d7a 100644
--- a/framework/src/Volo.Abp.MemoryDb/Volo.Abp.MemoryDb.csproj
+++ b/framework/src/Volo.Abp.MemoryDb/Volo.Abp.MemoryDb.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.MemoryDb
Volo.Abp.MemoryDb
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj b/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj
index e260f450d6..f552541094 100644
--- a/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj
+++ b/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Minify
Volo.Abp.Minify
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj b/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj
index 4a9c323e58..5857929d00 100644
--- a/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj
+++ b/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.MongoDB
Volo.Abp.MongoDB
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
@@ -15,7 +15,7 @@
-
+
diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbDateTimeSerializer.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbDateTimeSerializer.cs
index f8619602cb..c1d8b8f514 100644
--- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbDateTimeSerializer.cs
+++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbDateTimeSerializer.cs
@@ -34,7 +34,7 @@ public class AbpMongoDbDateTimeSerializer : DateTimeSerializer
return (dateTime - BsonConstants.UnixEpoch).Ticks / 10000L;
}
- // For unit testing.
+ // For unit testing
internal void SetDateTimeKind(DateTimeKind dateTimeKind)
{
DateTimeKind = dateTimeKind;
diff --git a/framework/src/Volo.Abp.MultiLingualObjects/Volo.Abp.MultiLingualObjects.csproj b/framework/src/Volo.Abp.MultiLingualObjects/Volo.Abp.MultiLingualObjects.csproj
index 77da44eb47..54c8469153 100644
--- a/framework/src/Volo.Abp.MultiLingualObjects/Volo.Abp.MultiLingualObjects.csproj
+++ b/framework/src/Volo.Abp.MultiLingualObjects/Volo.Abp.MultiLingualObjects.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.MultiLingualObject
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
false
diff --git a/framework/src/Volo.Abp.MultiTenancy/Volo.Abp.MultiTenancy.csproj b/framework/src/Volo.Abp.MultiTenancy/Volo.Abp.MultiTenancy.csproj
index 344dbfdec0..b8948be49f 100644
--- a/framework/src/Volo.Abp.MultiTenancy/Volo.Abp.MultiTenancy.csproj
+++ b/framework/src/Volo.Abp.MultiTenancy/Volo.Abp.MultiTenancy.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.MultiTenancy
Volo.Abp.MultiTenancy
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo.Abp.ObjectExtending.csproj b/framework/src/Volo.Abp.ObjectExtending/Volo.Abp.ObjectExtending.csproj
index 19f549b36a..de9711ff6a 100644
--- a/framework/src/Volo.Abp.ObjectExtending/Volo.Abp.ObjectExtending.csproj
+++ b/framework/src/Volo.Abp.ObjectExtending/Volo.Abp.ObjectExtending.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.ObjectExtending
Volo.Abp.ObjectExtending
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.ObjectMapping/Volo.Abp.ObjectMapping.csproj b/framework/src/Volo.Abp.ObjectMapping/Volo.Abp.ObjectMapping.csproj
index 163fd6d534..14d738ab6c 100644
--- a/framework/src/Volo.Abp.ObjectMapping/Volo.Abp.ObjectMapping.csproj
+++ b/framework/src/Volo.Abp.ObjectMapping/Volo.Abp.ObjectMapping.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.ObjectMapping
Volo.Abp.ObjectMapping
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Quartz/Volo.Abp.Quartz.csproj b/framework/src/Volo.Abp.Quartz/Volo.Abp.Quartz.csproj
index efa11dc9aa..71c3dd4caf 100644
--- a/framework/src/Volo.Abp.Quartz/Volo.Abp.Quartz.csproj
+++ b/framework/src/Volo.Abp.Quartz/Volo.Abp.Quartz.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Quartz
Volo.Abp.Quartz
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj b/framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj
index 98cc95fecb..eed4f273fd 100644
--- a/framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj
+++ b/framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.RabbitMQ
Volo.Abp.RabbitMQ
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.RemoteServices/Volo.Abp.RemoteServices.csproj b/framework/src/Volo.Abp.RemoteServices/Volo.Abp.RemoteServices.csproj
index 74ad1df500..52d536b51a 100644
--- a/framework/src/Volo.Abp.RemoteServices/Volo.Abp.RemoteServices.csproj
+++ b/framework/src/Volo.Abp.RemoteServices/Volo.Abp.RemoteServices.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.RemoteServices
Volo.Abp.RemoteServices
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Security/Volo.Abp.Security.csproj b/framework/src/Volo.Abp.Security/Volo.Abp.Security.csproj
index 65aca85c88..ab99014a5d 100644
--- a/framework/src/Volo.Abp.Security/Volo.Abp.Security.csproj
+++ b/framework/src/Volo.Abp.Security/Volo.Abp.Security.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Security
Volo.Abp.Security
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Serialization/Volo.Abp.Serialization.csproj b/framework/src/Volo.Abp.Serialization/Volo.Abp.Serialization.csproj
index b23178d760..f410670e83 100644
--- a/framework/src/Volo.Abp.Serialization/Volo.Abp.Serialization.csproj
+++ b/framework/src/Volo.Abp.Serialization/Volo.Abp.Serialization.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Serialization
Volo.Abp.Serialization
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Settings/Volo.Abp.Settings.csproj b/framework/src/Volo.Abp.Settings/Volo.Abp.Settings.csproj
index 65f985a87b..fdedd2fc69 100644
--- a/framework/src/Volo.Abp.Settings/Volo.Abp.Settings.csproj
+++ b/framework/src/Volo.Abp.Settings/Volo.Abp.Settings.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Settings
Volo.Abp.Settings
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Sms.Aliyun/Volo.Abp.Sms.Aliyun.csproj b/framework/src/Volo.Abp.Sms.Aliyun/Volo.Abp.Sms.Aliyun.csproj
index 763e5d1804..8b007b7a4a 100644
--- a/framework/src/Volo.Abp.Sms.Aliyun/Volo.Abp.Sms.Aliyun.csproj
+++ b/framework/src/Volo.Abp.Sms.Aliyun/Volo.Abp.Sms.Aliyun.csproj
@@ -3,7 +3,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Sms.Aliyun
Volo.Abp.Sms.Aliyun
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Sms/Volo.Abp.Sms.csproj b/framework/src/Volo.Abp.Sms/Volo.Abp.Sms.csproj
index 35adb7e62c..becbe00e65 100644
--- a/framework/src/Volo.Abp.Sms/Volo.Abp.Sms.csproj
+++ b/framework/src/Volo.Abp.Sms/Volo.Abp.Sms.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Sms
Volo.Abp.Sms
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Specifications/Volo.Abp.Specifications.csproj b/framework/src/Volo.Abp.Specifications/Volo.Abp.Specifications.csproj
index 6e17993ba1..f6a5b54948 100644
--- a/framework/src/Volo.Abp.Specifications/Volo.Abp.Specifications.csproj
+++ b/framework/src/Volo.Abp.Specifications/Volo.Abp.Specifications.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Specifications
Volo.Abp.Specifications
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.TestBase/Volo.Abp.TestBase.csproj b/framework/src/Volo.Abp.TestBase/Volo.Abp.TestBase.csproj
index 004a0fa4d6..4b90693b3e 100644
--- a/framework/src/Volo.Abp.TestBase/Volo.Abp.TestBase.csproj
+++ b/framework/src/Volo.Abp.TestBase/Volo.Abp.TestBase.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.TestBase
Volo.Abp.TestBase
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.TextTemplating.Core/Volo.Abp.TextTemplating.Core.csproj b/framework/src/Volo.Abp.TextTemplating.Core/Volo.Abp.TextTemplating.Core.csproj
index 649bdc2912..8581d01dc4 100644
--- a/framework/src/Volo.Abp.TextTemplating.Core/Volo.Abp.TextTemplating.Core.csproj
+++ b/framework/src/Volo.Abp.TextTemplating.Core/Volo.Abp.TextTemplating.Core.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/framework/src/Volo.Abp.TextTemplating.Razor/Volo.Abp.TextTemplating.Razor.csproj b/framework/src/Volo.Abp.TextTemplating.Razor/Volo.Abp.TextTemplating.Razor.csproj
index 670502cdb7..962746bd0a 100644
--- a/framework/src/Volo.Abp.TextTemplating.Razor/Volo.Abp.TextTemplating.Razor.csproj
+++ b/framework/src/Volo.Abp.TextTemplating.Razor/Volo.Abp.TextTemplating.Razor.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/framework/src/Volo.Abp.TextTemplating.Scriban/Volo.Abp.TextTemplating.Scriban.csproj b/framework/src/Volo.Abp.TextTemplating.Scriban/Volo.Abp.TextTemplating.Scriban.csproj
index a6f7c5eb35..d18d90c8f9 100644
--- a/framework/src/Volo.Abp.TextTemplating.Scriban/Volo.Abp.TextTemplating.Scriban.csproj
+++ b/framework/src/Volo.Abp.TextTemplating.Scriban/Volo.Abp.TextTemplating.Scriban.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj b/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj
index 3af0ba984d..27907183c0 100644
--- a/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj
+++ b/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/framework/src/Volo.Abp.Threading/Volo.Abp.Threading.csproj b/framework/src/Volo.Abp.Threading/Volo.Abp.Threading.csproj
index 0f5fbf3e9a..70f9ecb0f8 100644
--- a/framework/src/Volo.Abp.Threading/Volo.Abp.Threading.csproj
+++ b/framework/src/Volo.Abp.Threading/Volo.Abp.Threading.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Threading
Volo.Abp.Threading
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj b/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj
index 25c6bddc59..4ba0547035 100644
--- a/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj
+++ b/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Timing
Volo.Abp.Timing
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj
index 77d95d186d..657911f50d 100644
--- a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.UI.Navigation
Volo.Abp.UI.Navigation
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj b/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj
index 7cf2afccb1..0cf11fba78 100644
--- a/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj
+++ b/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.UI
Volo.Abp.UI
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Uow/Volo.Abp.Uow.csproj b/framework/src/Volo.Abp.Uow/Volo.Abp.Uow.csproj
index 1c5552d1da..f33af433e7 100644
--- a/framework/src/Volo.Abp.Uow/Volo.Abp.Uow.csproj
+++ b/framework/src/Volo.Abp.Uow/Volo.Abp.Uow.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Uow
Volo.Abp.Uow
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Validation.Abstractions/Volo.Abp.Validation.Abstractions.csproj b/framework/src/Volo.Abp.Validation.Abstractions/Volo.Abp.Validation.Abstractions.csproj
index 32ada2ce09..ff9731ff00 100644
--- a/framework/src/Volo.Abp.Validation.Abstractions/Volo.Abp.Validation.Abstractions.csproj
+++ b/framework/src/Volo.Abp.Validation.Abstractions/Volo.Abp.Validation.Abstractions.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Validation.Abstractions
Volo.Abp.Validation.Abstractions
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.Validation/Volo.Abp.Validation.csproj b/framework/src/Volo.Abp.Validation/Volo.Abp.Validation.csproj
index 10daff842e..b8f10667a2 100644
--- a/framework/src/Volo.Abp.Validation/Volo.Abp.Validation.csproj
+++ b/framework/src/Volo.Abp.Validation/Volo.Abp.Validation.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Validation
Volo.Abp.Validation
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.VirtualFileSystem/Volo.Abp.VirtualFileSystem.csproj b/framework/src/Volo.Abp.VirtualFileSystem/Volo.Abp.VirtualFileSystem.csproj
index 64425620dc..7e4ade4eca 100644
--- a/framework/src/Volo.Abp.VirtualFileSystem/Volo.Abp.VirtualFileSystem.csproj
+++ b/framework/src/Volo.Abp.VirtualFileSystem/Volo.Abp.VirtualFileSystem.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.VirtualFileSystem
Volo.Abp.VirtualFileSystem
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp/Volo.Abp.csproj b/framework/src/Volo.Abp/Volo.Abp.csproj
index 37f9ded71c..53fede568c 100644
--- a/framework/src/Volo.Abp/Volo.Abp.csproj
+++ b/framework/src/Volo.Abp/Volo.Abp.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp
Volo.Abp
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Auditing/Auditing_Tests.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Auditing/Auditing_Tests.cs
index 3f6e11c02d..8ad0029cc0 100644
--- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Auditing/Auditing_Tests.cs
+++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Auditing/Auditing_Tests.cs
@@ -29,6 +29,28 @@ public class Auditing_Tests : Auditing_Tests
}));
}
+ [Fact]
+ public async Task Should_Set_Modification_If_Properties_Changed_With_Default_Value()
+ {
+ var date = DateTime.Parse("2022-01-01");
+ await WithUnitOfWorkAsync((async () =>
+ {
+ var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId);
+ douglas.HasDefaultValue = date;
+ }));
+
+ await WithUnitOfWorkAsync((async () =>
+ {
+ var douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId);
+
+ douglas.ShouldNotBeNull();
+ douglas.HasDefaultValue.ShouldBe(date);
+ douglas.LastModificationTime.ShouldNotBeNull();
+ douglas.LastModificationTime.Value.ShouldBeLessThanOrEqualTo(Clock.Now);
+ douglas.LastModifierId.ShouldBe(CurrentUserId);
+ }));
+ }
+
[Fact]
public async Task Should_Set_Modification_If_Properties_Not_Generated_By_Database()
{
diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs
index 529912aa68..99e689bdd4 100644
--- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs
+++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs
@@ -20,7 +20,7 @@ public class TestMigrationsDbContext : AbpDbContext
public DbSet EntityWithIntPks { get; set; }
public DbSet Author { get; set; }
-
+
public DbSet Products { get; set; }
public TestMigrationsDbContext(DbContextOptions options)
@@ -44,6 +44,7 @@ public class TestMigrationsDbContext : AbpDbContext
modelBuilder.Entity(b =>
{
b.Property(x => x.LastActiveTime).ValueGeneratedOnAddOrUpdate().HasDefaultValue(DateTime.Now);
+ b.Property(x => x.HasDefaultValue).HasDefaultValue(DateTime.Now);
});
modelBuilder.Entity(b =>
diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs
index 921b97f6a4..66772343af 100644
--- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs
+++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs
@@ -29,7 +29,7 @@ public class TestAppDbContext : AbpDbContext, IThirdDbContext,
public DbSet Author { get; set; }
public DbSet FourthDummyEntities { get; set; }
-
+
public DbSet Products { get; set; }
public TestAppDbContext(DbContextOptions options)
@@ -60,6 +60,7 @@ public class TestAppDbContext : AbpDbContext, IThirdDbContext,
modelBuilder.Entity(b =>
{
b.Property(x => x.LastActiveTime).ValueGeneratedOnAddOrUpdate().HasDefaultValue(DateTime.Now);
+ b.Property(x => x.HasDefaultValue).HasDefaultValue(DateTime.Now);
});
modelBuilder
diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/DistributedEventHandles.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/DistributedEventHandles.cs
new file mode 100644
index 0000000000..eb1f1a52df
--- /dev/null
+++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/DistributedEventHandles.cs
@@ -0,0 +1,22 @@
+using System.Threading.Tasks;
+
+namespace Volo.Abp.EventBus.Distributed;
+
+public class DistributedEventHandles : ILocalEventHandler, ILocalEventHandler
+{
+ public static int SentCount { get; set; }
+
+ public static int ReceivedCount { get; set; }
+
+ public Task HandleEventAsync(DistributedEventSent eventData)
+ {
+ SentCount++;
+ return Task.CompletedTask;
+ }
+
+ public Task HandleEventAsync(DistributedEventReceived eventData)
+ {
+ ReceivedCount++;
+ return Task.CompletedTask;
+ }
+}
diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus_Test.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus_Test.cs
index c239df38c9..bbb8838cf6 100644
--- a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus_Test.cs
+++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus_Test.cs
@@ -1,7 +1,8 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Events.Distributed;
-using Volo.Abp.MultiTenancy;
+using Volo.Abp.EventBus.Local;
+using Volo.Abp.Uow;
using Xunit;
namespace Volo.Abp.EventBus.Distributed;
@@ -49,7 +50,7 @@ public class LocalDistributedEventBus_Test : LocalDistributedEventBusTestBase
public async Task Should_Get_TenantId_From_EventEto_Extra_Property()
{
var tenantId = Guid.NewGuid();
-
+
DistributedEventBus.Subscribe(GetRequiredService());
await DistributedEventBus.PublishAsync(new MySimpleEto
@@ -59,7 +60,44 @@ public class LocalDistributedEventBus_Test : LocalDistributedEventBusTestBase
{"TenantId", tenantId.ToString()}
}
});
-
+
Assert.Equal(tenantId, MySimpleDistributedSingleInstanceEventHandler.TenantId);
}
+
+ [Fact]
+ public async Task DistributedEventSentAndReceived_Test()
+ {
+ GetRequiredService().Subscribe();
+ GetRequiredService().Subscribe();
+
+ DistributedEventBus.Subscribe();
+
+ using (var uow = GetRequiredService().Begin())
+ {
+ await DistributedEventBus.PublishAsync(new MyEventDate(), onUnitOfWorkComplete: false);
+
+ Assert.Equal(1, DistributedEventHandles.SentCount);
+ Assert.Equal(1, DistributedEventHandles.ReceivedCount);
+
+ await DistributedEventBus.PublishAsync(new MyEventDate(), onUnitOfWorkComplete: true);
+
+ await uow.CompleteAsync();
+
+ Assert.Equal(2, DistributedEventHandles.SentCount);
+ Assert.Equal(2, DistributedEventHandles.ReceivedCount);
+ }
+ }
+
+ class MyEventDate
+ {
+
+ }
+
+ class MyEventHandle : IDistributedEventHandler
+ {
+ public Task HandleEventAsync(MyEventDate eventData)
+ {
+ return Task.CompletedTask;
+ }
+ }
}
diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj b/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj
index ef1ff44a00..a504a13e19 100644
--- a/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj
+++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj
@@ -15,7 +15,10 @@
-
+
+
+
+
diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs
index 3d4c0468ab..ed967fdb92 100644
--- a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs
+++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs
@@ -21,14 +21,9 @@ public class AbpMongoDbTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
- var stringArray = MongoDbFixture.ConnectionString.Split('?');
- var connectionString = stringArray[0].EnsureEndsWith('/') +
- "Db_" +
- Guid.NewGuid().ToString("N") + "/?" + stringArray[1];
-
Configure(options =>
{
- options.ConnectionStrings.Default = connectionString;
+ options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString();
});
context.Services.AddMongoDbContext(options =>
diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/MongoDbFixture.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/MongoDbFixture.cs
index c92dbbbd50..9b70fe2681 100644
--- a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/MongoDbFixture.cs
+++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/MongoDbFixture.cs
@@ -1,17 +1,30 @@
using System;
-using Mongo2Go;
+using EphemeralMongo;
namespace Volo.Abp.MongoDB;
public class MongoDbFixture : IDisposable
{
- private static readonly MongoDbRunner MongoDbRunner;
- public static readonly string ConnectionString;
+ public readonly static IMongoRunner MongoDbRunner;
static MongoDbFixture()
{
- MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20);
- ConnectionString = MongoDbRunner.ConnectionString;
+ MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions
+ {
+ UseSingleNodeReplicaSet = true
+ });
+ }
+
+ public static string GetRandomConnectionString()
+ {
+ return GetConnectionString("Db_" + Guid.NewGuid().ToString("N"));
+ }
+
+ public static string GetConnectionString(string databaseName)
+ {
+ var stringArray = MongoDbRunner.ConnectionString.Split('?');
+ var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1];
+ return connectionString;
}
public void Dispose()
diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Transactions/Transaction_Tests.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Transactions/Transaction_Tests.cs
index 935846d662..5fae3353d2 100644
--- a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Transactions/Transaction_Tests.cs
+++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Transactions/Transaction_Tests.cs
@@ -10,6 +10,7 @@ using Xunit;
namespace Volo.Abp.MongoDB.Transactions;
+[Collection(MongoTestCollection.Name)]
public class Transaction_Tests : TestAppTestBase
{
private readonly IBasicRepository _personRepository;
diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs
index 0726126eba..5d78236fca 100644
--- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs
+++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs
@@ -30,6 +30,8 @@ public class Person : FullAuditedAggregateRoot, IMultiTenant, IHasEntityVe
public virtual DateTime LastActiveTime { get; set; }
+ public virtual DateTime HasDefaultValue { get; set; }
+
public int EntityVersion { get; set; }
private Person()
diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj
index d6b87b957d..296077aa8c 100644
--- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj
+++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Account.Application.Contracts
Volo.Abp.Account.Application.Contracts
true
diff --git a/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo.Abp.Account.HttpApi.Client.csproj b/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo.Abp.Account.HttpApi.Client.csproj
index aef884dbe2..ebbf58da1f 100644
--- a/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo.Abp.Account.HttpApi.Client.csproj
+++ b/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo.Abp.Account.HttpApi.Client.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Abp.Account.HttpApi.Client
Volo.Abp.Account.HttpApi.Client
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo.Abp.AuditLogging.Domain.Shared.csproj b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo.Abp.AuditLogging.Domain.Shared.csproj
index e59e988f46..18d18ad117 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo.Abp.AuditLogging.Domain.Shared.csproj
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo.Abp.AuditLogging.Domain.Shared.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
true
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo.Abp.AuditLogging.Domain.csproj b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo.Abp.AuditLogging.Domain.csproj
index df43919393..f0bd42709d 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo.Abp.AuditLogging.Domain.csproj
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo.Abp.AuditLogging.Domain.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo.Abp.AuditLogging.MongoDB.csproj b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo.Abp.AuditLogging.MongoDB.csproj
index c22202f7f9..43bdcb53c0 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo.Abp.AuditLogging.MongoDB.csproj
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo.Abp.AuditLogging.MongoDB.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs
index 5bb84197fa..1dc8b50778 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs
@@ -262,7 +262,7 @@ public class MongoAuditLogRepository : MongoDbRepository e.Id == auditLogId)
.WhereIf(startTime.HasValue, e => e.ChangeTime >= startTime)
.WhereIf(endTime.HasValue, e => e.ChangeTime <= endTime)
- .WhereIf(changeType.HasValue, e => e.ChangeType == changeType)
+ .WhereIf(changeType.HasValue, e => e.ChangeType == changeType.Value)
.WhereIf(!string.IsNullOrWhiteSpace(entityId), e => e.EntityId == entityId)
.WhereIf(!string.IsNullOrWhiteSpace(entityTypeFullName),
e => e.EntityTypeFullName.Contains(entityTypeFullName));
diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj
index 6599d1e446..5739f6fb34 100644
--- a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj
+++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj
@@ -14,7 +14,10 @@
-
+
+
+
+
diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs
index 592d11a480..ca021f1f1d 100644
--- a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs
+++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs
@@ -13,14 +13,9 @@ public class AbpAuditLoggingMongoDbTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
- var stringArray = MongoDbFixture.ConnectionString.Split('?');
- var connectionString = stringArray[0].EnsureEndsWith('/') +
- "Db_" +
- Guid.NewGuid().ToString("N") + "/?" + stringArray[1];
-
Configure(options =>
{
- options.ConnectionStrings.Default = connectionString;
+ options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString();
});
}
}
diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs
index ea7be8dd53..a68f246c78 100644
--- a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs
+++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs
@@ -1,17 +1,30 @@
using System;
-using Mongo2Go;
+using EphemeralMongo;
namespace Volo.Abp.AuditLogging.MongoDB;
public class MongoDbFixture : IDisposable
{
- private static readonly MongoDbRunner MongoDbRunner;
- public static readonly string ConnectionString;
+ public readonly static IMongoRunner MongoDbRunner;
static MongoDbFixture()
{
- MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20);
- ConnectionString = MongoDbRunner.ConnectionString;
+ MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions
+ {
+ UseSingleNodeReplicaSet = true
+ });
+ }
+
+ public static string GetRandomConnectionString()
+ {
+ return GetConnectionString("Db_" + Guid.NewGuid().ToString("N"));
+ }
+
+ public static string GetConnectionString(string databaseName)
+ {
+ var stringArray = MongoDbRunner.ConnectionString.Split('?');
+ var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1];
+ return connectionString;
}
public void Dispose()
diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Shared/Volo.Abp.BackgroundJobs.DemoApp.Shared.csproj b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Shared/Volo.Abp.BackgroundJobs.DemoApp.Shared.csproj
index a32ea90b09..e6a08dbd02 100644
--- a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Shared/Volo.Abp.BackgroundJobs.DemoApp.Shared.csproj
+++ b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Shared/Volo.Abp.BackgroundJobs.DemoApp.Shared.csproj
@@ -3,7 +3,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo.Abp.BackgroundJobs.Domain.Shared.csproj b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo.Abp.BackgroundJobs.Domain.Shared.csproj
index 4c79e9bcfd..ab2ccc71a4 100644
--- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo.Abp.BackgroundJobs.Domain.Shared.csproj
+++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo.Abp.BackgroundJobs.Domain.Shared.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj
index 7e763bdcc0..c985df35ca 100644
--- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj
+++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj
@@ -14,7 +14,10 @@
-
+
+
+
+
diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs
index 77a6dc6321..84f9f0731e 100644
--- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs
+++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs
@@ -13,14 +13,9 @@ public class AbpBackgroundJobsMongoDbTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
- var stringArray = MongoDbFixture.ConnectionString.Split('?');
- var connectionString = stringArray[0].EnsureEndsWith('/') +
- "Db_" +
- Guid.NewGuid().ToString("N") + "/?" + stringArray[1];
-
Configure(options =>
{
- options.ConnectionStrings.Default = connectionString;
+ options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString();
});
}
}
diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs
index 45a4e14bc7..97bd35c6fa 100644
--- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs
+++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs
@@ -1,17 +1,30 @@
using System;
-using Mongo2Go;
+using EphemeralMongo;
namespace Volo.Abp.BackgroundJobs.MongoDB;
public class MongoDbFixture : IDisposable
{
- private static readonly MongoDbRunner MongoDbRunner;
- public static readonly string ConnectionString;
+ public readonly static IMongoRunner MongoDbRunner;
static MongoDbFixture()
{
- MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20);
- ConnectionString = MongoDbRunner.ConnectionString;
+ MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions
+ {
+ UseSingleNodeReplicaSet = true
+ });
+ }
+
+ public static string GetRandomConnectionString()
+ {
+ return GetConnectionString("Db_" + Guid.NewGuid().ToString("N"));
+ }
+
+ public static string GetConnectionString(string databaseName)
+ {
+ var stringArray = MongoDbRunner.ConnectionString.Split('?');
+ var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1];
+ return connectionString;
}
public void Dispose()
diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo.Abp.BlobStoring.Database.Domain.Shared.csproj b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo.Abp.BlobStoring.Database.Domain.Shared.csproj
index 899a964810..09592bce70 100644
--- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo.Abp.BlobStoring.Database.Domain.Shared.csproj
+++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo.Abp.BlobStoring.Database.Domain.Shared.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo.Abp.BlobStoring.Database.Domain.csproj b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo.Abp.BlobStoring.Database.Domain.csproj
index c3ac872d18..bc2af4186c 100644
--- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo.Abp.BlobStoring.Database.Domain.csproj
+++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo.Abp.BlobStoring.Database.Domain.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo.Abp.BlobStoring.Database.MongoDB.csproj b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo.Abp.BlobStoring.Database.MongoDB.csproj
index 6b1f447f8a..27d7a12bf1 100644
--- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo.Abp.BlobStoring.Database.MongoDB.csproj
+++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo.Abp.BlobStoring.Database.MongoDB.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
diff --git a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs
index 982a389404..32a94b9642 100644
--- a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs
+++ b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs
@@ -13,14 +13,9 @@ public class BlobStoringDatabaseMongoDbTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
- var stringArray = MongoDbFixture.ConnectionString.Split('?');
- var connectionString = stringArray[0].EnsureEndsWith('/') +
- "Db_" +
- Guid.NewGuid().ToString("N") + "/?" + stringArray[1];
-
Configure(options =>
{
- options.ConnectionStrings.Default = connectionString;
+ options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString();
});
}
}
diff --git a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs
index 875d510727..8952236f43 100644
--- a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs
+++ b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs
@@ -1,17 +1,30 @@
using System;
-using Mongo2Go;
+using EphemeralMongo;
namespace Volo.Abp.BlobStoring.Database.MongoDB;
public class MongoDbFixture : IDisposable
{
- private static readonly MongoDbRunner MongoDbRunner;
- public static readonly string ConnectionString;
+ public readonly static IMongoRunner MongoDbRunner;
static MongoDbFixture()
{
- MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20);
- ConnectionString = MongoDbRunner.ConnectionString;
+ MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions
+ {
+ UseSingleNodeReplicaSet = true
+ });
+ }
+
+ public static string GetRandomConnectionString()
+ {
+ return GetConnectionString("Db_" + Guid.NewGuid().ToString("N"));
+ }
+
+ public static string GetConnectionString(string databaseName)
+ {
+ var stringArray = MongoDbRunner.ConnectionString.Split('?');
+ var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1];
+ return connectionString;
}
public void Dispose()
diff --git a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj
index c4d517912b..12d6f00f28 100644
--- a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj
+++ b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj
@@ -7,7 +7,10 @@
-
+
+
+
+
diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo.Blogging.Admin.Application.Contracts.csproj b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo.Blogging.Admin.Application.Contracts.csproj
index 2af8db519c..c033f7bbd5 100644
--- a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo.Blogging.Admin.Application.Contracts.csproj
+++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo.Blogging.Admin.Application.Contracts.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Blogging.Admin.Application.Contracts
Volo.Blogging.Admin.Application.Contracts
true
diff --git a/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/Volo.Blogging.Admin.HttpApi.Client.csproj b/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/Volo.Blogging.Admin.HttpApi.Client.csproj
index 55b11f728d..6a666bb915 100644
--- a/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/Volo.Blogging.Admin.HttpApi.Client.csproj
+++ b/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/Volo.Blogging.Admin.HttpApi.Client.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Blogging.Admin.HttpApi.Client
Volo.Blogging.Admin.HttpApi.Client
diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo.Blogging.Application.Contracts.Shared.csproj b/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo.Blogging.Application.Contracts.Shared.csproj
index 83c53a8d5d..2f5bce179d 100644
--- a/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo.Blogging.Application.Contracts.Shared.csproj
+++ b/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo.Blogging.Application.Contracts.Shared.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Blogging.Application.Contracts.Shared
Volo.Blogging.Application.Contracts.Shared
diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo.Blogging.Application.Contracts.csproj b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo.Blogging.Application.Contracts.csproj
index 2483d728b4..039ed80868 100644
--- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo.Blogging.Application.Contracts.csproj
+++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo.Blogging.Application.Contracts.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Blogging.Application.Contracts
Volo.Blogging.Application.Contracts
true
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo.Blogging.Domain.Shared.csproj b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo.Blogging.Domain.Shared.csproj
index c56b888d38..b18e3f290a 100644
--- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo.Blogging.Domain.Shared.csproj
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo.Blogging.Domain.Shared.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Blogging.Domain.Shared
Volo.Blogging.Domain.Shared
true
diff --git a/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo.Blogging.HttpApi.Client.csproj b/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo.Blogging.HttpApi.Client.csproj
index 68b3775baa..c9e1ccfd75 100644
--- a/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo.Blogging.HttpApi.Client.csproj
+++ b/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo.Blogging.HttpApi.Client.csproj
@@ -4,7 +4,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.Blogging.HttpApi.Client
Volo.Blogging.HttpApi.Client
diff --git a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj
index a2bfdf915a..4d32836bbe 100644
--- a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj
+++ b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj
@@ -7,7 +7,10 @@
-
+
+
+
+
diff --git a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs
index 41942f75d0..364aa4dc0e 100644
--- a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs
+++ b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs
@@ -13,14 +13,9 @@ namespace Volo.Blogging.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
- var stringArray = MongoDbFixture.ConnectionString.Split('?');
- var connectionString = stringArray[0].EnsureEndsWith('/') +
- "Db_" +
- Guid.NewGuid().ToString("N") + "/?" + stringArray[1];
-
Configure(options =>
{
- options.ConnectionStrings.Default = connectionString;
+ options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString();
});
}
}
diff --git a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs
index 6da6ba3662..ad1fce80e5 100644
--- a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs
+++ b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs
@@ -1,22 +1,32 @@
using System;
-using Mongo2Go;
+using EphemeralMongo;
-namespace Volo.Blogging.MongoDB
+public class MongoDbFixture : IDisposable
{
- public class MongoDbFixture : IDisposable
- {
- private static readonly MongoDbRunner MongoDbRunner;
- public static readonly string ConnectionString;
+ public readonly static IMongoRunner MongoDbRunner;
- static MongoDbFixture()
+ static MongoDbFixture()
+ {
+ MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions
{
- MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20);
- ConnectionString = MongoDbRunner.ConnectionString;
- }
+ UseSingleNodeReplicaSet = true
+ });
+ }
- public void Dispose()
- {
- MongoDbRunner?.Dispose();
- }
+ public static string GetRandomConnectionString()
+ {
+ return GetConnectionString("Db_" + Guid.NewGuid().ToString("N"));
+ }
+
+ public static string GetConnectionString(string databaseName)
+ {
+ var stringArray = MongoDbRunner.ConnectionString.Split('?');
+ var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1];
+ return connectionString;
+ }
+
+ public void Dispose()
+ {
+ MongoDbRunner?.Dispose();
}
}
diff --git a/modules/cms-kit/host/Volo.CmsKit.Host.Shared/Volo.CmsKit.Host.Shared.csproj b/modules/cms-kit/host/Volo.CmsKit.Host.Shared/Volo.CmsKit.Host.Shared.csproj
index aca54af174..ca4506de62 100644
--- a/modules/cms-kit/host/Volo.CmsKit.Host.Shared/Volo.CmsKit.Host.Shared.csproj
+++ b/modules/cms-kit/host/Volo.CmsKit.Host.Shared/Volo.CmsKit.Host.Shared.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netstandard2.0;netstandard2.1;net7.0
Volo.CmsKit
diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.Designer.cs
deleted file mode 100644
index 62e4c309ca..0000000000
--- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.Designer.cs
+++ /dev/null
@@ -1,2303 +0,0 @@
-//
-using System;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Volo.Abp.EntityFrameworkCore;
-using Volo.CmsKit.EntityFrameworkCore;
-
-#nullable disable
-
-namespace Volo.CmsKit.Migrations
-{
- [DbContext(typeof(UnifiedDbContext))]
- [Migration("20221216140823_Initial")]
- partial class Initial
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
- .HasAnnotation("ProductVersion", "7.0.0")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
-
- modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("ApplicationName")
- .HasMaxLength(96)
- .HasColumnType("nvarchar(96)")
- .HasColumnName("ApplicationName");
-
- b.Property("BrowserInfo")
- .HasMaxLength(512)
- .HasColumnType("nvarchar(512)")
- .HasColumnName("BrowserInfo");
-
- b.Property("ClientId")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("ClientId");
-
- b.Property("ClientIpAddress")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("ClientIpAddress");
-
- b.Property("ClientName")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)")
- .HasColumnName("ClientName");
-
- b.Property("Comments")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("Comments");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("CorrelationId")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("CorrelationId");
-
- b.Property("Exceptions")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ExecutionDuration")
- .HasColumnType("int")
- .HasColumnName("ExecutionDuration");
-
- b.Property("ExecutionTime")
- .HasColumnType("datetime2");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("HttpMethod")
- .HasMaxLength(16)
- .HasColumnType("nvarchar(16)")
- .HasColumnName("HttpMethod");
-
- b.Property("HttpStatusCode")
- .HasColumnType("int")
- .HasColumnName("HttpStatusCode");
-
- b.Property("ImpersonatorTenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("ImpersonatorTenantId");
-
- b.Property("ImpersonatorTenantName")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("ImpersonatorTenantName");
-
- b.Property("ImpersonatorUserId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("ImpersonatorUserId");
-
- b.Property("ImpersonatorUserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("ImpersonatorUserName");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.Property("TenantName")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("TenantName");
-
- b.Property("Url")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("Url");
-
- b.Property("UserId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("UserId");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("UserName");
-
- b.HasKey("Id");
-
- b.HasIndex("TenantId", "ExecutionTime");
-
- b.HasIndex("TenantId", "UserId", "ExecutionTime");
-
- b.ToTable("AbpAuditLogs", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("AuditLogId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("AuditLogId");
-
- b.Property("ExecutionDuration")
- .HasColumnType("int")
- .HasColumnName("ExecutionDuration");
-
- b.Property("ExecutionTime")
- .HasColumnType("datetime2")
- .HasColumnName("ExecutionTime");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("MethodName")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)")
- .HasColumnName("MethodName");
-
- b.Property("Parameters")
- .HasMaxLength(2000)
- .HasColumnType("nvarchar(2000)")
- .HasColumnName("Parameters");
-
- b.Property("ServiceName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("ServiceName");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("AuditLogId");
-
- b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
-
- b.ToTable("AbpAuditLogActions", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("AuditLogId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("AuditLogId");
-
- b.Property("ChangeTime")
- .HasColumnType("datetime2")
- .HasColumnName("ChangeTime");
-
- b.Property("ChangeType")
- .HasColumnType("tinyint")
- .HasColumnName("ChangeType");
-
- b.Property("EntityId")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)")
- .HasColumnName("EntityId");
-
- b.Property("EntityTenantId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("EntityTypeFullName")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)")
- .HasColumnName("EntityTypeFullName");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("AuditLogId");
-
- b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
-
- b.ToTable("AbpEntityChanges", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("EntityChangeId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("NewValue")
- .HasMaxLength(512)
- .HasColumnType("nvarchar(512)")
- .HasColumnName("NewValue");
-
- b.Property("OriginalValue")
- .HasMaxLength(512)
- .HasColumnType("nvarchar(512)")
- .HasColumnName("OriginalValue");
-
- b.Property("PropertyName")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)")
- .HasColumnName("PropertyName");
-
- b.Property("PropertyTypeFullName")
- .IsRequired()
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("PropertyTypeFullName");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("EntityChangeId");
-
- b.ToTable("AbpEntityPropertyChanges", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("ContainerId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("Content")
- .HasMaxLength(2147483647)
- .HasColumnType("varbinary(max)");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("ContainerId");
-
- b.HasIndex("TenantId", "ContainerId", "Name");
-
- b.ToTable("AbpBlobs", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("TenantId", "Name");
-
- b.ToTable("AbpBlobContainers", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("AllowedProviders")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("DefaultValue")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("Description")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("DisplayName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("GroupName")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("IsAvailableToHost")
- .HasColumnType("bit");
-
- b.Property("IsVisibleToClients")
- .HasColumnType("bit");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("ParentName")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("ValueType")
- .HasMaxLength(2048)
- .HasColumnType("nvarchar(2048)");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupName");
-
- b.HasIndex("Name")
- .IsUnique();
-
- b.ToTable("AbpFeatures", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("DisplayName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique();
-
- b.ToTable("AbpFeatureGroups", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("ProviderKey")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("ProviderName")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("Value")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.HasKey("Id");
-
- b.HasIndex("Name", "ProviderName", "ProviderKey")
- .IsUnique()
- .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL");
-
- b.ToTable("AbpFeatureValues", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("Description")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("IsStatic")
- .HasColumnType("bit");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("Regex")
- .HasMaxLength(512)
- .HasColumnType("nvarchar(512)");
-
- b.Property("RegexDescription")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("Required")
- .HasColumnType("bit");
-
- b.Property("ValueType")
- .HasColumnType("int");
-
- b.HasKey("Id");
-
- b.ToTable("AbpClaimTypes", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("SourceTenantId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("SourceUserId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("TargetTenantId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("TargetUserId")
- .HasColumnType("uniqueidentifier");
-
- b.HasKey("Id");
-
- b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId")
- .IsUnique()
- .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL");
-
- b.ToTable("AbpLinkUsers", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("IsDefault")
- .HasColumnType("bit")
- .HasColumnName("IsDefault");
-
- b.Property("IsPublic")
- .HasColumnType("bit")
- .HasColumnName("IsPublic");
-
- b.Property("IsStatic")
- .HasColumnType("bit")
- .HasColumnName("IsStatic");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("NormalizedName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName");
-
- b.ToTable("AbpRoles", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .HasColumnType("uniqueidentifier");
-
- b.Property("ClaimType")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("ClaimValue")
- .HasMaxLength(1024)
- .HasColumnType("nvarchar(1024)");
-
- b.Property("RoleId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AbpRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("Action")
- .HasMaxLength(96)
- .HasColumnType("nvarchar(96)");
-
- b.Property("ApplicationName")
- .HasMaxLength(96)
- .HasColumnType("nvarchar(96)");
-
- b.Property("BrowserInfo")
- .HasMaxLength(512)
- .HasColumnType("nvarchar(512)");
-
- b.Property("ClientId")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("ClientIpAddress")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("CorrelationId")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("CreationTime")
- .HasColumnType("datetime2");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("Identity")
- .HasMaxLength(96)
- .HasColumnType("nvarchar(96)");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.Property("TenantName")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("UserId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("TenantId", "Action");
-
- b.HasIndex("TenantId", "ApplicationName");
-
- b.HasIndex("TenantId", "Identity");
-
- b.HasIndex("TenantId", "UserId");
-
- b.ToTable("AbpSecurityLogs", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("AccessFailedCount")
- .ValueGeneratedOnAdd()
- .HasColumnType("int")
- .HasDefaultValue(0)
- .HasColumnName("AccessFailedCount");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("CreationTime")
- .HasColumnType("datetime2")
- .HasColumnName("CreationTime");
-
- b.Property("CreatorId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("CreatorId");
-
- b.Property("DeleterId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("DeleterId");
-
- b.Property("DeletionTime")
- .HasColumnType("datetime2")
- .HasColumnName("DeletionTime");
-
- b.Property("Email")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("Email");
-
- b.Property("EmailConfirmed")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("EmailConfirmed");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("IsActive")
- .HasColumnType("bit")
- .HasColumnName("IsActive");
-
- b.Property("IsDeleted")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("IsDeleted");
-
- b.Property("IsExternal")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("IsExternal");
-
- b.Property("LastModificationTime")
- .HasColumnType("datetime2")
- .HasColumnName("LastModificationTime");
-
- b.Property("LastModifierId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("LastModifierId");
-
- b.Property("LockoutEnabled")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("LockoutEnabled");
-
- b.Property("LockoutEnd")
- .HasColumnType("datetimeoffset");
-
- b.Property("Name")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("Name");
-
- b.Property("NormalizedEmail")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("NormalizedEmail");
-
- b.Property("NormalizedUserName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("NormalizedUserName");
-
- b.Property("PasswordHash")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("PasswordHash");
-
- b.Property("PhoneNumber")
- .HasMaxLength(16)
- .HasColumnType("nvarchar(16)")
- .HasColumnName("PhoneNumber");
-
- b.Property("PhoneNumberConfirmed")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("PhoneNumberConfirmed");
-
- b.Property("SecurityStamp")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("SecurityStamp");
-
- b.Property("Surname")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("Surname");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.Property("TwoFactorEnabled")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("TwoFactorEnabled");
-
- b.Property("UserName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("UserName");
-
- b.HasKey("Id");
-
- b.HasIndex("Email");
-
- b.HasIndex("NormalizedEmail");
-
- b.HasIndex("NormalizedUserName");
-
- b.HasIndex("UserName");
-
- b.ToTable("AbpUsers", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .HasColumnType("uniqueidentifier");
-
- b.Property("ClaimType")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("ClaimValue")
- .HasMaxLength(1024)
- .HasColumnType("nvarchar(1024)");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.Property("UserId")
- .HasColumnType("uniqueidentifier");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AbpUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
- {
- b.Property