From c4f0d34515087506c58e30cf4de2ef31177b9136 Mon Sep 17 00:00:00 2001
From: cKey <35512826+colinin@users.noreply.github.com>
Date: Sun, 21 Feb 2021 14:23:01 +0800
Subject: [PATCH] upgrade abp framework 4.2.1
---
...N.Abp.Account.Application.Contracts.csproj | 2 +-
.../LINGYUN.Abp.Account.Application.csproj | 4 +-
.../LINGYUN.Abp.Account.Domain.Shared.csproj | 2 +-
.../LINGYUN.Abp.Account.Domain.csproj | 2 +-
.../LINGYUN.Abp.Account.HttpApi.csproj | 2 +-
.../LINGYUN.Abp.Account.Web.csproj | 6 +--
...UN.ApiGateway.Application.Contracts.csproj | 4 +-
.../LINGYUN.ApiGateway.Application.csproj | 4 +-
.../Ocelot/AggregateReRouteAppService.cs | 3 +-
.../Ocelot/GlobalConfigurationAppService.cs | 3 +-
.../ApiGateway/Ocelot/ReRouteAppService.cs | 3 +-
.../ApiGateway/Ocelot/RouteGroupAppService.cs | 3 +-
.../LINGYUN.ApiGateway.Domain.Shared.csproj | 2 +-
.../LINGYUN.ApiGateway.Domain.csproj | 4 +-
...GYUN.ApiGateway.EntityFrameworkCore.csproj | 2 +-
.../EfCoreAggregateReRouteRepository.cs | 12 +++--
.../Ocelot/EfCoreDynamicReRouteRepository.cs | 9 +++-
.../Ocelot/EfCoreGlobalConfigRepository.cs | 18 +++++--
.../Ocelot/EfCoreReRouteRepository.cs | 31 ++++++++----
.../Ocelot/EfCoreRouteGroupRepository.cs | 9 ++--
.../LINGYUN.ApiGateway.HttpApi.Client.csproj | 2 +-
.../LINGYUN.ApiGateway.HttpApi.csproj | 2 +-
.../Ocelot/GlobalConfigurationController.cs | 6 +--
....Abp.Auditing.Application.Contracts.csproj | 10 ++--
.../LINGYUN.Abp.Auditing.Application.csproj | 8 +--
.../LINGYUN.Abp.Auditing.HttpApi.csproj | 2 +-
.../LINGYUN.Abp.Aliyun.csproj | 8 +--
.../LINGYUN.Abp.Tencent.csproj | 6 +--
.../LINGYUN.Abp.Aliyun.Authorization.csproj | 2 +-
...NGYUN.Abp.AspNetCore.Mvc.Validation.csproj | 2 +-
...bp.AspNetCore.SignalR.Protocol.Json.csproj | 2 +-
...YUN.Abp.AspNetCore.SignalR.JwtToken.csproj | 2 +-
...LINGYUN.Abp.BackgroundJobs.Hangfire.csproj | 4 +-
.../LINGYUN.Abp.BackgroundJobs.csproj | 2 +-
.../LINGYUN.Abp.BlobStoring.Aliyun.csproj | 2 +-
.../LINGYUN.Abp.Core/LINGYUN.Abp.Core.csproj | 2 +-
.../LINGYUN.Abp.DistributedLock.Redis.csproj | 2 +-
.../LINGYUN.Abp.Domain.Entities.Events.csproj | 2 +-
.../LINGYUN.Abp.EventBus.CAP.csproj | 4 +-
...GYUN.Abp.ExceptionHandling.Emailing.csproj | 2 +-
...Abp.ExceptionHandling.Notifications.csproj | 2 +-
.../LINGYUN.Abp.ExceptionHandling.csproj | 2 +-
....Abp.Features.LimitValidation.Redis.csproj | 2 +-
...INGYUN.Abp.Features.LimitValidation.csproj | 2 +-
.../LINGYUN.Abp.Hangfire.Storage.MySql.csproj | 2 +-
...GYUN.Abp.Hangfire.Storage.SqlServer.csproj | 2 +-
.../LINGYUN.Abp.IM.SignalR.csproj | 4 +-
.../LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj | 4 +-
.../LINGYUN.Abp.IdentityModel.csproj | 4 +-
.../LINGYUN.Abp.Location.Amap.csproj | 6 +--
.../LINGYUN.Abp.Location.Baidu.csproj | 6 +--
.../LINGYUN.Abp.Location.Tencent.csproj | 6 +--
.../LINGYUN.Abp.Location.csproj | 2 +-
.../LINGYUN.Abp.Notifications.SignalR.csproj | 4 +-
.../SignalR/Hubs/NotificationsHub.cs | 3 +-
.../LINGYUN.Abp.Notifications.Sms.csproj | 2 +-
.../LINGYUN.Abp.Notifications.csproj | 6 +--
.../LINGYUN.Abp.RealTime.SignalR.csproj | 2 +-
.../SignalR/Hubs/OnlineClientHubBase.cs | 7 +--
.../LINGYUN.Abp.RealTime.csproj | 2 +-
.../LINGYUN.Abp.Rules.csproj | 2 +-
.../LINGYUN.Abp.Settings.csproj | 2 +-
.../LINGYUN.Abp.Sms.Aliyun.csproj | 2 +-
.../LINGYUN.Abp.Encryption.Console.csproj | 2 +-
...INGYUN.Abp.FeatureManagement.Client.csproj | 4 +-
.../Client/ClientFeatureManagementProvider.cs | 8 +--
.../LINGYUN.Abp.Features.Client.csproj | 2 +-
...ileManagement.Application.Contracts.csproj | 2 +-
...UN.Abp.FileManagement.Domain.Shared.csproj | 2 +-
.../LINGYUN.Abp.FileManagement.Domain.csproj | 4 +-
.../LINGYUN.Abp.FileManagement.HttpApi.csproj | 2 +-
....Abp.Identity.Application.Contracts.csproj | 2 +-
.../LINGYUN.Abp.Identity.Application.csproj | 2 +-
.../LINGYUN.Abp.Identity.Domain.Shared.csproj | 2 +-
.../LINGYUN.Abp.Identity.Domain.csproj | 2 +-
...UN.Abp.Identity.EntityFrameworkCore.csproj | 2 +-
.../EfCoreIdentityRoleRepository.cs | 23 ++++-----
.../EfCoreIdentityUserRepository.cs | 49 +++++++++++--------
...LINGYUN.Abp.Identity.HttpApi.Client.csproj | 2 +-
.../LINGYUN.Abp.Identity.HttpApi.csproj | 2 +-
...ermissionManagement.Domain.Identity.csproj | 4 +-
...dentityServer.Application.Contracts.csproj | 6 +--
...GYUN.Abp.IdentityServer.Application.csproj | 2 +-
.../AbpIdentityServerAppServiceBase.cs | 3 +-
.../LINGYUN.Abp.IdentityServer.Domain.csproj | 2 +-
.../ApiScopes/IApiScopeRepository.cs | 13 -----
....IdentityServer.EntityFrameworkCore.csproj | 2 +-
.../EfCoreApiResourceRepository.cs | 2 +-
.../ApiScopes/EfCoreApiScopeRepository.cs | 37 --------------
.../Grants/EfCorePersistentGrantRepository.cs | 4 +-
.../EfCoreIdentityResourceRepository.cs | 2 +-
.../LINGYUN.Abp.IdentityServer.HttpApi.csproj | 2 +-
...YUN.Abp.IdentityServer.SmsValidator.csproj | 2 +-
.../LINGYUN.Abp.IdentityServer.WeChat.csproj | 2 +-
....Abp.IdentityServer.WeChatValidator.csproj | 2 +-
...essageService.Application.Contracts.csproj | 4 +-
...GYUN.Abp.MessageService.Application.csproj | 2 +-
.../Abp/MessageService/Chat/ChatAppService.cs | 5 +-
...UN.Abp.MessageService.Domain.Shared.csproj | 4 +-
.../LINGYUN.Abp.MessageService.Domain.csproj | 10 ++--
....MessageService.EntityFrameworkCore.csproj | 2 +-
.../Chat/EfCoreMessageRepository.cs | 29 +++++------
.../Chat/EfCoreUserChatCardRepository.cs | 8 +--
.../Chat/EfCoreUserChatFriendRepository.cs | 36 ++++++++------
.../Chat/EfCoreUserChatSettingRepository.cs | 5 +-
.../Group/EfCoreGroupRepository.cs | 11 +++--
.../Group/EfCoreUserChatGroupRepository.cs | 35 +++++++------
.../EfCoreNotificationRepository.cs | 9 ++--
.../EfCoreUserNotificationRepository.cs | 22 +++++----
.../EfCoreUserSubscribeRepository.cs | 43 ++++++++--------
...N.Abp.MessageService.HttpApi.Client.csproj | 2 +-
.../LINGYUN.Abp.MessageService.HttpApi.csproj | 2 +-
...YUN.Abp.PermissionManagement.Domain.csproj | 2 +-
...GYUN.Platform.Application.Contracts.csproj | 2 +-
.../LINGYUN.Platform.Domain.Shared.csproj | 2 +-
.../LINGYUN.Platform.Domain.csproj | 8 +--
.../BlobStoring/BlobStoringManager.cs | 7 +--
.../LINGYUN/Platform/Menus/MenuManager.cs | 18 +++++--
...INGYUN.Platform.EntityFrameworkCore.csproj | 2 +-
.../Platform/Datas/EfCoreDataRepository.cs | 17 +++++--
.../Layouts/EfCoreLayoutRepository.cs | 11 +++--
.../Platform/Menus/EfCoreMenuRepository.cs | 48 ++++++++++--------
.../Menus/EfCoreRoleMenuRepository.cs | 8 +--
.../Menus/EfCoreUserMenuRepository.cs | 11 +++--
.../Versions/EfCoreVersionRepository.cs | 10 ++--
.../LINGYUN.Platform.HttpApi.csproj | 4 +-
.../Platform/PlatformControllerBase.cs | 3 +-
...lesManagement.Application.Contracts.csproj | 2 +-
...YUN.Abp.RulesManagement.Application.csproj | 2 +-
...N.Abp.RulesManagement.Domain.Shared.csproj | 4 +-
.../LINGYUN.Abp.RulesManagement.Domain.csproj | 4 +-
...RulesManagement.EntityFrameworkCore.csproj | 2 +-
....Abp.RulesManagement.HttpApi.Client.csproj | 2 +-
...LINGYUN.Abp.RulesManagement.HttpApi.csproj | 2 +-
...ingManagement.Application.Contracts.csproj | 4 +-
...N.Abp.SettingManagement.Application.csproj | 4 +-
...NGYUN.Abp.SettingManagement.HttpApi.csproj | 2 +-
.../LINGYUN.Abp.MultiTenancy.DbFinder.csproj | 4 +-
...GYUN.Abp.MultiTenancy.RemoteService.csproj | 2 +-
...antManagement.Application.Contracts.csproj | 4 +-
...UN.Abp.TenantManagement.Application.csproj | 2 +-
...Abp.TenantManagement.HttpApi.Client.csproj | 2 +-
...INGYUN.Abp.TenantManagement.HttpApi.csproj | 2 +-
...INGYUN.Abp.WeChat.SettingManagement.csproj | 4 +-
.../LINGYUN.Abp.WeChat.csproj | 6 +--
.../AuthServer.Host/AuthServer.Host.csproj | 26 +++++-----
.../Emailing/AccountEmailVerifySender.cs | 4 +-
.../account/AuthServer.Host/package.json | 2 +-
.../Handlers/TenantCreateEventHandler.cs | 8 +--
.../Handlers/TenantDeleteEventHandler.cs | 8 +--
...NGYUN.Abp.BackendAdmin.HttpApi.Host.csproj | 36 +++++++-------
.../LINGYUN.ApiGateway.Host.csproj | 14 +++---
.../LINGYUN.ApiGateway.HttpApi.Host.csproj | 14 +++---
...UN.Abp.IdentityServer4.HttpApi.Host.csproj | 26 +++++-----
...YUN.Abp.MessageService.HttpApi.Host.csproj | 16 +++---
.../LINGYUN.Platform.HttpApi.Host.csproj | 26 +++++-----
.../LINGYUN.Abp.Aliyun.Tests.csproj | 2 +-
...NGYUN.Abp.EntityFrameworkCore.Tests.csproj | 2 +-
.../LINGYUN.Abp.Sms.Aliyun.Tests.csproj | 2 +-
.../LINGYUN.Abp.TestsBase.csproj | 8 +--
....Platform.EntityFrameworkCore.Tests.csproj | 2 +-
.../Menus/EfCoreUserMenuRepositoryTests.cs | 8 ++-
162 files changed, 565 insertions(+), 545 deletions(-)
delete mode 100644 aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeRepository.cs
delete mode 100644 aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/ApiScopes/EfCoreApiScopeRepository.cs
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj
index 5af03b5ac..c7b9a6dcc 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj
index 76f881c40..74eb6ad56 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj
@@ -8,8 +8,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN.Abp.Account.Domain.Shared.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN.Abp.Account.Domain.Shared.csproj
index a112fa029..f780f22ba 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN.Abp.Account.Domain.Shared.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN.Abp.Account.Domain.Shared.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj
index 39eb53e30..131db7a6e 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj
index fa41d5931..72231cea6 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj
index e09839e0c..79d80c06d 100644
--- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj
+++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj
@@ -29,9 +29,9 @@
-
-
-
+
+
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj
index 33cd29545..377c06860 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj
@@ -18,8 +18,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj
index 8d12cf4e8..9770e4101 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj
@@ -8,8 +8,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/AggregateReRouteAppService.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/AggregateReRouteAppService.cs
index 77b125687..b9de682e7 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/AggregateReRouteAppService.cs
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/AggregateReRouteAppService.cs
@@ -15,8 +15,7 @@ namespace LINGYUN.ApiGateway.Ocelot
[Authorize(ApiGatewayPermissions.AggregateRoute.Default)]
public class AggregateReRouteAppService : ApiGatewayApplicationServiceBase, IAggregateReRouteAppService
{
- private IDistributedEventBus _eventBus;
- protected IDistributedEventBus DistributedEventBus => LazyGetRequiredService(ref _eventBus);
+ protected IDistributedEventBus DistributedEventBus => LazyServiceProvider.LazyGetRequiredService();
private readonly IAggregateReRouteRepository _aggregateReRouteRepository;
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationAppService.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationAppService.cs
index 3e795b7c2..25043cc1c 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationAppService.cs
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationAppService.cs
@@ -11,8 +11,7 @@ namespace LINGYUN.ApiGateway.Ocelot
[Authorize(ApiGatewayPermissions.Global.Default)]
public class GlobalConfigurationAppService : ApiGatewayApplicationServiceBase, IGlobalConfigurationAppService
{
- private IDistributedEventBus _eventBus;
- protected IDistributedEventBus DistributedEventBus => LazyGetRequiredService(ref _eventBus);
+ protected IDistributedEventBus DistributedEventBus => LazyServiceProvider.LazyGetRequiredService();
private readonly IRouteGroupChecker _routeGroupChecker;
private readonly IGlobalConfigRepository _globalConfigRepository;
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/ReRouteAppService.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/ReRouteAppService.cs
index eb69995cc..3c0f9b466 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/ReRouteAppService.cs
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/ReRouteAppService.cs
@@ -10,8 +10,7 @@ namespace LINGYUN.ApiGateway.Ocelot
[Authorize(ApiGatewayPermissions.Route.Default)]
public class ReRouteAppService : ApiGatewayApplicationServiceBase, IReRouteAppService
{
- private IDistributedEventBus _eventBus;
- protected IDistributedEventBus DistributedEventBus => LazyGetRequiredService(ref _eventBus);
+ protected IDistributedEventBus DistributedEventBus => LazyServiceProvider.LazyGetRequiredService();
private readonly IRouteGroupChecker _routeGroupChecker;
private readonly IReRouteRepository _reRouteRepository;
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/RouteGroupAppService.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/RouteGroupAppService.cs
index 91fb2b0a1..bb5d3ceea 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/RouteGroupAppService.cs
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/RouteGroupAppService.cs
@@ -10,8 +10,7 @@ namespace LINGYUN.ApiGateway.Ocelot
[Authorize(ApiGatewayPermissions.RouteGroup.Default)]
public class RouteGroupAppService : ApiGatewayApplicationServiceBase, IRouteGroupAppService
{
- private IDataFilter _dataFilter;
- protected IDataFilter DataFilter => LazyGetRequiredService(ref _dataFilter);
+ protected IDataFilter DataFilter => LazyServiceProvider.LazyGetRequiredService();
protected IRouteGroupRepository RouterRepository { get; }
public RouteGroupAppService(
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj
index 811736e63..769a43349 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj
index 6e20cad47..6931853e7 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj
@@ -8,8 +8,8 @@
-
-
+
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj
index 6167ff624..7feeb1ba6 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreAggregateReRouteRepository.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreAggregateReRouteRepository.cs
index 1320dda17..8c5ee4121 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreAggregateReRouteRepository.cs
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreAggregateReRouteRepository.cs
@@ -17,23 +17,25 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task AggregateReRouteNameExistsAsync(string name)
{
- return await DbSet.AnyAsync(ar => ar.Name.Equals(name));
+ return await (await GetDbSetAsync()).AnyAsync(ar => ar.Name.Equals(name));
}
public async Task GetByRouteIdAsync(long routeId)
{
- return await WithDetails().Where(ar => ar.ReRouteId.Equals(routeId)).FirstOrDefaultAsync();
+ return await (await WithDetailsAsync())
+ .Where(ar => ar.ReRouteId.Equals(routeId)).FirstOrDefaultAsync();
}
public async Task> GetByAppIdAsync(string appId)
{
- return await WithDetails().Where(ar => ar.AppId.Equals(appId)).ToListAsync();
+ return await (await WithDetailsAsync())
+ .Where(ar => ar.AppId.Equals(appId)).ToListAsync();
}
public async Task<(List routes, long total)> GetPagedListAsync(string appId, string filter = "",
string sorting = "", int skipCount = 1, int maxResultCount = 100)
{
- var resultReRoutes = await WithDetails()
+ var resultReRoutes = await (await WithDetailsAsync())
.Where(ar => ar.AppId.Equals(appId))
.WhereIf(!filter.IsNullOrWhiteSpace(), ar => ar.ReRouteKeys.Contains(filter) ||
ar.UpstreamHost.Contains(filter) || ar.UpstreamPathTemplate.Contains(filter))
@@ -41,7 +43,7 @@ namespace LINGYUN.ApiGateway.Ocelot
.EfPageBy(skipCount, maxResultCount)
.ToListAsync();
- var total = await GetQueryable()
+ var total = await (await GetQueryableAsync())
.Where(ar => ar.AppId.Equals(appId))
.WhereIf(!filter.IsNullOrWhiteSpace(), ar => ar.ReRouteKeys.Contains(filter) ||
ar.UpstreamHost.Contains(filter) || ar.UpstreamPathTemplate.Contains(filter)).LongCountAsync();
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreDynamicReRouteRepository.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreDynamicReRouteRepository.cs
index f8afc828b..ffa1a3cfa 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreDynamicReRouteRepository.cs
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreDynamicReRouteRepository.cs
@@ -17,12 +17,17 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task GetByItemIdAsync(int itemId)
{
- return await GetQueryable().Where(x => x.DynamicReRouteId.Equals(itemId)).FirstOrDefaultAsync();
+ return await (await GetQueryableAsync()).Where(x => x.DynamicReRouteId.Equals(itemId)).FirstOrDefaultAsync();
}
public async Task> GetByAppIdAsync(string appId)
{
- return await WithDetails().Where(x => x.AppId.Equals(appId)).ToListAsync();
+ return await (await WithDetailsAsync()).Where(x => x.AppId.Equals(appId)).ToListAsync();
+ }
+
+ public override async Task> WithDetailsAsync()
+ {
+ return await WithDetailsAsync(x => x.RateLimitRule); ;
}
public override IQueryable WithDetails()
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreGlobalConfigRepository.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreGlobalConfigRepository.cs
index afbb87ea1..a721da01c 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreGlobalConfigRepository.cs
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreGlobalConfigRepository.cs
@@ -19,7 +19,7 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task GetByItemIdAsync(long itemId)
{
- var globalConfiguration = await WithDetails().Where(x => x.ItemId.Equals(itemId)).FirstOrDefaultAsync();
+ var globalConfiguration = await (await WithDetailsAsync()).Where(x => x.ItemId.Equals(itemId)).FirstOrDefaultAsync();
if(globalConfiguration == null)
{
throw new EntityNotFoundException(typeof(GlobalConfiguration));
@@ -29,7 +29,7 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task GetByAppIdAsync(string appId)
{
- return await WithDetails()
+ return await (await WithDetailsAsync())
.Where(g => g.AppId.Equals(appId))
.FirstOrDefaultAsync();
}
@@ -37,13 +37,13 @@ namespace LINGYUN.ApiGateway.Ocelot
public virtual async Task<(List Globals, long TotalCount)> GetPagedListAsync(string filter = "", string sorting = "",
int skipCount = 1, int maxResultCount = 10)
{
- var globals = await WithDetails()
+ var globals = await (await WithDetailsAsync())
.WhereIf(!filter.IsNullOrWhiteSpace(), g => g.AppId.Contains(filter) ||
g.BaseUrl.Contains(filter) || g.DownstreamScheme.Contains(filter))
.OrderBy(g => sorting ?? g.BaseUrl)
.EfPageBy(skipCount, maxResultCount)
.ToListAsync();
- var total = await GetQueryable()
+ var total = await (await GetQueryableAsync())
.WhereIf(!filter.IsNullOrWhiteSpace(), g => g.AppId.Contains(filter) ||
g.BaseUrl.Contains(filter) || g.DownstreamScheme.Contains(filter))
.LongCountAsync();
@@ -51,6 +51,16 @@ namespace LINGYUN.ApiGateway.Ocelot
return ValueTuple.Create(globals, total);
}
+ public override async Task> WithDetailsAsync()
+ {
+ return await WithDetailsAsync(
+ x => x.HttpHandlerOptions,
+ x => x.LoadBalancerOptions,
+ x => x.QoSOptions,
+ x => x.RateLimitOptions,
+ x => x.ServiceDiscoveryProvider);
+ }
+
public override IQueryable WithDetails()
{
return WithDetails(
diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreReRouteRepository.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreReRouteRepository.cs
index 116374712..f3c4df428 100644
--- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreReRouteRepository.cs
+++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreReRouteRepository.cs
@@ -19,19 +19,19 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task GetByNameAsync(string routeName)
{
- var reRoute = await WithDetails().Where(x => x.ReRouteName.Equals(routeName)).FirstOrDefaultAsync();
+ var reRoute = await (await WithDetailsAsync()).Where(x => x.ReRouteName.Equals(routeName)).FirstOrDefaultAsync();
return reRoute ?? throw new EntityNotFoundException(typeof(ReRoute), routeName);
}
public async Task GetByReRouteIdAsync(long routeId)
{
- var reRoute = await WithDetails().Where(x => x.ReRouteId.Equals(routeId)).FirstOrDefaultAsync();
+ var reRoute = await (await WithDetailsAsync()).Where(x => x.ReRouteId.Equals(routeId)).FirstOrDefaultAsync();
return reRoute ?? throw new EntityNotFoundException(typeof(ReRoute), routeId);
}
public async Task> GetByAppIdAsync(string appId)
{
- return await WithDetails()
+ return await (await WithDetailsAsync())
.Where(r => r.AppId.Equals(appId))
.ToListAsync();
}
@@ -39,7 +39,7 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task<(List routes, long total)> GetPagedListAsync(string appId, string filter = "",
string sorting = "", int skipCount = 1, int maxResultCount = 100)
{
- var resultReRoutes = await WithDetails()
+ var resultReRoutes = await (await WithDetailsAsync())
.Where(r => r.AppId.Equals(appId))
.WhereIf(!filter.IsNullOrWhiteSpace(), r => r.ReRouteName.Contains(filter) ||
r.DownstreamHostAndPorts.Contains(filter) || r.ServiceName.Contains(filter))
@@ -47,7 +47,7 @@ namespace LINGYUN.ApiGateway.Ocelot
.EfPageBy(skipCount, maxResultCount)
.ToListAsync();
- var total = await GetQueryable()
+ var total = await (await GetQueryableAsync())
.Where(r => r.AppId.Equals(appId))
.WhereIf(!filter.IsNullOrWhiteSpace(), r => r.ReRouteName.Contains(filter) ||
r.DownstreamHostAndPorts.Contains(filter) || r.ServiceName.Contains(filter))
@@ -58,20 +58,21 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task RemoveAsync(CancellationToken cancellationToken = default(CancellationToken))
{
- var entityType = DbContext.Model.FindEntityType(typeof(ReRoute));
+ var dbContext = await GetDbContextAsync();
+ var entityType = dbContext.Model.FindEntityType(typeof(ReRoute));
var tableName = entityType.GetTableName();//.Relational().TableName;
var sqlText = $"DELETE FROM @tableName";
var sqlParam = new List