From b71e1294af459987fcbddbdb92ab73dfeed2c331 Mon Sep 17 00:00:00 2001 From: "Min.Ling" Date: Wed, 25 Nov 2020 17:42:13 +0800 Subject: [PATCH 001/493] Update Entity-Framework-Core-Other-DBMS.md remove "Change the Migrations DbContext" plate, because no need to manually set database provider after v2.9+ add "Change the Migrations DbContext Factory" plate, because the switch to MySQL, we also need to modify the DbContextOptionsBuilder mark "DBMS restrictions" plate, Add history modification record --- .../Entity-Framework-Core-Other-DBMS.md | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md b/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md index fb8ad15787..a60732f1ee 100644 --- a/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md +++ b/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md @@ -62,22 +62,25 @@ MySQL连接字符串与SQL Server连接字符串不同. 所以检查你的解决 通常需要更改 `.DbMigrator` 和 `.Web` 项目里面的 `appsettings.json` ,但它取决于你的解决方案结构. -## 更改迁移DbContext +## 更改迁移DbContext Factory -MySQL DBMS与SQL Server有一些细微的差异. 某些模块数据库映射配置(尤其是字段长度)会导致MySQL出现问题. 例如某些[IdentityServer模块](Modules/IdentityServer.md)表就存在这样的问题,它提供了一个选项可以根据你的DBMS配置字段. +启动模板包含***YourProjectName*MigrationsDbContextFactory**,这是EF Core控制台命令所必须的类(比如[Add-Migration](https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/#generating--running-migrations)和[Update-Database](https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/#generating--running-migrations)),在切换到MySql数据库时,我们同时也需要修改`DbContextOptionsBuilder` -启动模板包含*YourProjectName*MigrationsDbContext,它负责维护和迁移数据库架构. 此DbContext基本上调用依赖模块的扩展方法来配置其数据库表. +在 *YourProjectName*MigrationsDbContextFactory 类中找到以下代码: -打开 *YourProjectName*MigrationsDbContext 更改 `builder.ConfigureIdentityServer();` 行,如下所示: +````csharp +var builder = new DbContextOptionsBuilder() + .UseSqlServer(configuration.GetConnectionString("Default")); +```` + +将其替换为: ````csharp -builder.ConfigureIdentityServer(options => -{ - options.DatabaseProvider = EfCoreDatabaseProvider.MySql; -}); +var builder = new DbContextOptionsBuilder() + .UseMySql(configuration.GetConnectionString("Default")); ```` -然后 `ConfigureIdentityServer()` 方法会将字段长度设置为超过MySQL的限制. 如果在创建或执行数据库迁移时遇到任何问题请参考相关的模块文档. +如果在创建或执行数据库迁移时遇到任何问题,请参考相关模块文档 ## 重新生成迁移 @@ -105,5 +108,6 @@ builder.ConfigureIdentityServer(options => options.DatabaseProvider = EfCoreDatabaseProvider.MySql; }); ``` +v2.9+版本无需手动设置 ([版本历史](https://github.com/abpframework/abp/blob/dev/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs)) -相关讨论: https://github.com/abpframework/abp/issues/1920 \ No newline at end of file +相关讨论: https://github.com/abpframework/abp/issues/1920 From f287e592c05058423ab0873cbd3d9fdf2b9ad85f Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 3 Dec 2020 18:40:51 +0800 Subject: [PATCH 002/493] Add Autofac.Extensions.DependencyInjection to Volo.Abp.Autofac module. --- .../AutofacRegistration.cs | 140 +++++++++++++----- .../AutofacServiceProvider.cs | 122 --------------- .../AutofacServiceProviderFactory.cs | 77 ---------- .../AutofacServiceScope.cs | 67 --------- .../AutofacServiceScopeFactory.cs | 65 -------- .../Volo.Abp.Autofac/Volo.Abp.Autofac.csproj | 2 + 6 files changed, 108 insertions(+), 365 deletions(-) delete mode 100644 framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProvider.cs delete mode 100644 framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProviderFactory.cs delete mode 100644 framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScope.cs delete mode 100644 framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScopeFactory.cs diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacRegistration.cs b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacRegistration.cs index 024fc3a258..aeb0de9f2f 100644 --- a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacRegistration.cs +++ b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacRegistration.cs @@ -1,6 +1,6 @@ // This software is part of the Autofac IoC container // Copyright © 2015 Autofac Contributors -// http://autofac.org +// https://autofac.org // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation @@ -24,9 +24,12 @@ // OTHER DEALINGS IN THE SOFTWARE. using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Reflection; using Autofac.Builder; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; using Volo.Abp.Modularity; namespace Autofac.Extensions.DependencyInjection @@ -45,16 +48,62 @@ namespace Autofac.Extensions.DependencyInjection /// The into which the registrations should be made. /// /// - /// The set of service descriptors to register in the container. + /// A container builder that can be used to create an . /// public static void Populate( - this ContainerBuilder builder, - IServiceCollection services) + this ContainerBuilder builder, + IServiceCollection services) { - builder.RegisterType().As(); - builder.RegisterType().As(); + Populate(builder, services, null); + } + + /// + /// Populates the Autofac container builder with the set of registered service descriptors + /// and makes and + /// available in the container. Using this overload is incompatible with the ASP.NET Core + /// support for . + /// + /// + /// The into which the registrations should be made. + /// + /// + /// A container builder that can be used to create an . + /// + /// + /// If provided and not then all registrations with lifetime are registered + /// using + /// with provided + /// instead of using . + /// + /// + /// + /// Specifying a addresses a specific case where you have + /// an application that uses Autofac but where you need to isolate a set of services in a child scope. For example, + /// if you have a large application that self-hosts ASP.NET Core items, you may want to isolate the ASP.NET + /// Core registrations in a child lifetime scope so they don't show up for the rest of the application. + /// This overload allows that. Note it is the developer's responsibility to execute this and create an + /// using the child lifetime scope. + /// + /// + public static void Populate( + this ContainerBuilder builder, + IServiceCollection services, + object lifetimeScopeTagForSingletons) + { + if (services == null) + { + throw new ArgumentNullException(nameof(services)); + } - Register(builder, services); + builder.RegisterType().As().ExternallyOwned(); + var autofacServiceScopeFactory = typeof(AutofacServiceProvider).Assembly.GetType("Autofac.Extensions.DependencyInjection.AutofacServiceScopeFactory"); + if (autofacServiceScopeFactory == null) + { + throw new AbpException("Unable get type of Autofac.Extensions.DependencyInjection.AutofacServiceScopeFactory!"); + } + builder.RegisterType(autofacServiceScopeFactory).As(); + + Register(builder, services, lifetimeScopeTagForSingletons); } /// @@ -64,18 +113,33 @@ namespace Autofac.Extensions.DependencyInjection /// The object registration style. /// The registration being built. /// The lifecycle specified on the service registration. + /// + /// If not then all registrations with lifetime are registered + /// using + /// with provided + /// instead of using . + /// /// /// The , configured with the proper lifetime scope, /// and available for additional configuration. /// private static IRegistrationBuilder ConfigureLifecycle( - this IRegistrationBuilder registrationBuilder, - ServiceLifetime lifecycleKind) + this IRegistrationBuilder registrationBuilder, + ServiceLifetime lifecycleKind, + object lifetimeScopeTagForSingleton) { switch (lifecycleKind) { case ServiceLifetime.Singleton: - registrationBuilder.SingleInstance(); + if (lifetimeScopeTagForSingleton == null) + { + registrationBuilder.SingleInstance(); + } + else + { + registrationBuilder.InstancePerMatchingLifetimeScope(lifetimeScopeTagForSingleton); + } + break; case ServiceLifetime.Scoped: registrationBuilder.InstancePerLifetimeScope(); @@ -95,57 +159,65 @@ namespace Autofac.Extensions.DependencyInjection /// The into which the registrations should be made. /// /// - /// The set of service descriptors to register in the container. + /// A container builder that can be used to create an . + /// + /// + /// If not then all registrations with lifetime are registered + /// using + /// with provided + /// instead of using . /// + [SuppressMessage("CA2000", "CA2000", Justification = "Registrations created here are disposed when the built container is disposed.")] private static void Register( - ContainerBuilder builder, - IServiceCollection services) + ContainerBuilder builder, + IServiceCollection services, + object lifetimeScopeTagForSingletons) { var moduleContainer = services.GetSingletonInstance(); var registrationActionList = services.GetRegistrationActionList(); - foreach (var service in services) + foreach (var descriptor in services) { - if (service.ImplementationType != null) + if (descriptor.ImplementationType != null) { // Test if the an open generic type is being registered - var serviceTypeInfo = service.ServiceType.GetTypeInfo(); + var serviceTypeInfo = descriptor.ServiceType.GetTypeInfo(); if (serviceTypeInfo.IsGenericTypeDefinition) { builder - .RegisterGeneric(service.ImplementationType) - .As(service.ServiceType) - .ConfigureLifecycle(service.Lifetime) + .RegisterGeneric(descriptor.ImplementationType) + .As(descriptor.ServiceType) + .ConfigureLifecycle(descriptor.Lifetime, lifetimeScopeTagForSingletons) .ConfigureAbpConventions(moduleContainer, registrationActionList); } else { builder - .RegisterType(service.ImplementationType) - .As(service.ServiceType) - .ConfigureLifecycle(service.Lifetime) + .RegisterType(descriptor.ImplementationType) + .As(descriptor.ServiceType) + .ConfigureLifecycle(descriptor.Lifetime, lifetimeScopeTagForSingletons) .ConfigureAbpConventions(moduleContainer, registrationActionList); } } - else if (service.ImplementationFactory != null) + else if (descriptor.ImplementationFactory != null) { - var registration = RegistrationBuilder.ForDelegate(service.ServiceType, (context, parameters) => - { - var serviceProvider = context.Resolve(); - return service.ImplementationFactory(serviceProvider); - }) - .ConfigureLifecycle(service.Lifetime) - .CreateRegistration(); - //TODO: ConfigureAbpConventions ? + var registration = RegistrationBuilder.ForDelegate(descriptor.ServiceType, (context, parameters) => + { + var serviceProvider = context.Resolve(); + return descriptor.ImplementationFactory(serviceProvider); + }) + .ConfigureLifecycle(descriptor.Lifetime, lifetimeScopeTagForSingletons) + .CreateRegistration(); + //TODO: ConfigureAbpConventions ? builder.RegisterComponent(registration); } else { builder - .RegisterInstance(service.ImplementationInstance) - .As(service.ServiceType) - .ConfigureLifecycle(service.Lifetime); + .RegisterInstance(descriptor.ImplementationInstance) + .As(descriptor.ServiceType) + .ConfigureLifecycle(descriptor.Lifetime, null); } } } diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProvider.cs b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProvider.cs deleted file mode 100644 index 1c1a24ff66..0000000000 --- a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProvider.cs +++ /dev/null @@ -1,122 +0,0 @@ -// This software is part of the Autofac IoC container -// Copyright © 2015 Autofac Contributors -// https://autofac.org -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace Autofac.Extensions.DependencyInjection -{ - /// - /// Autofac implementation of the ASP.NET Core . - /// - /// - /// - public class AutofacServiceProvider : IServiceProvider, ISupportRequiredService, IDisposable - { - private readonly ILifetimeScope _lifetimeScope; - - private bool _disposed = false; - - /// - /// Initializes a new instance of the class. - /// - /// - /// The lifetime scope from which services will be resolved. - /// - public AutofacServiceProvider(ILifetimeScope lifetimeScope) - { - this._lifetimeScope = lifetimeScope; - } - - /// - /// Gets service of type from the - /// and requires it be present. - /// - /// - /// An object that specifies the type of service object to get. - /// - /// - /// A service object of type . - /// - /// - /// Thrown if the isn't registered with the container. - /// - /// - /// Thrown if the object can't be resolved from the container. - /// - public object GetRequiredService(Type serviceType) - { - return this._lifetimeScope.Resolve(serviceType); - } - - /// - /// Gets the service object of the specified type. - /// - /// - /// An object that specifies the type of service object to get. - /// - /// - /// A service object of type ; or - /// if there is no service object of type . - /// - public object GetService(Type serviceType) - { - return this._lifetimeScope.ResolveOptional(serviceType); - } - - /// - /// Gets the underlying instance of . - /// - public ILifetimeScope LifetimeScope => _lifetimeScope; - - /// - /// Releases unmanaged and - optionally - managed resources. - /// - /// - /// to release both managed and unmanaged resources; - /// to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (!this._disposed) - { - this._disposed = true; - if (disposing) - { - this._lifetimeScope.Dispose(); - } - } - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - } -} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProviderFactory.cs b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProviderFactory.cs deleted file mode 100644 index 21a7ca331d..0000000000 --- a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProviderFactory.cs +++ /dev/null @@ -1,77 +0,0 @@ -// This software is part of the Autofac IoC container -// Copyright © 2017 Autofac Contributors -// http://autofac.org -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace Autofac.Extensions.DependencyInjection -{ - /// - /// A factory for creating a and an . - /// - public class AutofacServiceProviderFactory : IServiceProviderFactory - { - private readonly Action _configurationAction; - - /// - /// Initializes a new instance of the class. - /// - /// Action on a that adds component registrations to the container. - public AutofacServiceProviderFactory(Action configurationAction = null) - { - _configurationAction = configurationAction ?? (builder => { }); - } - - /// - /// Creates a container builder from an . - /// - /// The collection of services - /// A container builder that can be used to create an . - public ContainerBuilder CreateBuilder(IServiceCollection services) - { - var builder = new ContainerBuilder(); - - builder.Populate(services); - - _configurationAction(builder); - - return builder; - } - - /// - /// Creates an from the container builder. - /// - /// The container builder - /// An - public IServiceProvider CreateServiceProvider(ContainerBuilder containerBuilder) - { - if (containerBuilder == null) throw new ArgumentNullException(nameof(containerBuilder)); - - var container = containerBuilder.Build(); - - return new AutofacServiceProvider(container); - } - } -} diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScope.cs b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScope.cs deleted file mode 100644 index 425c6769da..0000000000 --- a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScope.cs +++ /dev/null @@ -1,67 +0,0 @@ -// This software is part of the Autofac IoC container -// Copyright © 2015 Autofac Contributors -// http://autofac.org -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace Autofac.Extensions.DependencyInjection -{ - /// - /// Autofac implementation of the ASP.NET Core . - /// - /// - internal class AutofacServiceScope : IServiceScope - { - private readonly ILifetimeScope _lifetimeScope; - - /// - /// Initializes a new instance of the class. - /// - /// - /// The lifetime scope from which services should be resolved for this service scope. - /// - public AutofacServiceScope(ILifetimeScope lifetimeScope) - { - this._lifetimeScope = lifetimeScope; - this.ServiceProvider = this._lifetimeScope.Resolve(); - } - - /// - /// Gets an corresponding to this service scope. - /// - /// - /// An that can be used to resolve dependencies from the scope. - /// - public IServiceProvider ServiceProvider { get; } - - /// - /// Disposes of the lifetime scope and resolved disposable services. - /// - public void Dispose() - { - this._lifetimeScope.Dispose(); - } - } -} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScopeFactory.cs b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScopeFactory.cs deleted file mode 100644 index 31917fd079..0000000000 --- a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScopeFactory.cs +++ /dev/null @@ -1,65 +0,0 @@ -// This software is part of the Autofac IoC container -// Copyright © 2015 Autofac Contributors -// http://autofac.org -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. - -using System.Diagnostics.CodeAnalysis; -using Microsoft.Extensions.DependencyInjection; - -namespace Autofac.Extensions.DependencyInjection -{ - /// - /// Autofac implementation of the ASP.NET Core . - /// - /// - [SuppressMessage("Microsoft.ApiDesignGuidelines", "CA2213", Justification = "The creator of the root service lifetime scope is responsible for disposal.")] - internal class AutofacServiceScopeFactory : IServiceScopeFactory - { - private readonly ILifetimeScope _lifetimeScope; - - /// - /// Initializes a new instance of the class. - /// - /// The lifetime scope. - public AutofacServiceScopeFactory(ILifetimeScope lifetimeScope) - { - this._lifetimeScope = lifetimeScope; - } - - /// - /// Creates an which contains an - /// used to resolve dependencies within - /// the scope. - /// - /// - /// An controlling the lifetime of the scope. Once - /// this is disposed, any scoped services that have been resolved - /// from the - /// will also be disposed. - /// - public IServiceScope CreateScope() - { - return new AutofacServiceScope(this._lifetimeScope.BeginLifetimeScope()); - } - } -} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj b/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj index 2032464676..465c645328 100644 --- a/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj +++ b/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj @@ -17,6 +17,8 @@ + + From 6a3e229837dcde31b90d0e1e06309564462f7871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 15 Dec 2020 16:46:28 +0300 Subject: [PATCH 003/493] Draft implementation of IRepository.InsertManyAsync(); --- common.DotSettings | 1 + .../Repositories/BasicRepositoryBase.cs | 40 +++++++++++++++++-- .../Domain/Repositories/IBasicRepository.cs | 7 +++- .../Abp/Domain/Repositories/RepositoryBase.cs | 8 ---- .../EntityFrameworkCore/EfCoreRepository.cs | 23 +++++++++++ .../IEfCoreBulkOperationProvider.cs | 20 ++++++++++ 6 files changed, 86 insertions(+), 13 deletions(-) create mode 100644 framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs diff --git a/common.DotSettings b/common.DotSettings index 7edbd05e75..5c1cda48fd 100644 --- a/common.DotSettings +++ b/common.DotSettings @@ -29,6 +29,7 @@ Never Never Never + True True True False diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs index ae1b03475c..1235dc3714 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs @@ -2,15 +2,18 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities; +using Volo.Abp.Linq; +using Volo.Abp.MultiTenancy; using Volo.Abp.Threading; using Volo.Abp.Uow; namespace Volo.Abp.Domain.Repositories { - public abstract class BasicRepositoryBase : - IBasicRepository, + public abstract class BasicRepositoryBase : + IBasicRepository, IServiceProviderAccessor, IUnitOfWorkEnabled, ITransientDependency @@ -18,6 +21,14 @@ namespace Volo.Abp.Domain.Repositories { public IServiceProvider ServiceProvider { get; set; } + public IDataFilter DataFilter { get; set; } + + public ICurrentTenant CurrentTenant { get; set; } + + public IAsyncQueryableExecuter AsyncExecuter { get; set; } + + public IUnitOfWorkManager UnitOfWorkManager { get; set; } + public ICancellationTokenProvider CancellationTokenProvider { get; set; } protected BasicRepositoryBase() @@ -27,6 +38,29 @@ namespace Volo.Abp.Domain.Repositories public abstract Task InsertAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); + public virtual async Task InsertManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await InsertAsync(entity, cancellationToken: cancellationToken); + } + + if (autoSave) + { + await SaveChangesAsync(cancellationToken); + } + } + + protected virtual Task SaveChangesAsync(CancellationToken cancellationToken) + { + if (UnitOfWorkManager?.Current != null) + { + return UnitOfWorkManager?.Current.SaveChangesAsync(cancellationToken); + } + + return Task.CompletedTask; + } + public abstract Task UpdateAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); public abstract Task DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); @@ -59,7 +93,7 @@ namespace Volo.Abp.Domain.Repositories } public abstract Task FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default); - + public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) { var entity = await FindAsync(id, cancellationToken: cancellationToken); diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs index 6b62691ed8..0637225229 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs @@ -1,4 +1,5 @@ -using System.Threading; +using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using JetBrains.Annotations; using Volo.Abp.Domain.Entities; @@ -20,8 +21,10 @@ namespace Volo.Abp.Domain.Repositories [NotNull] Task InsertAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); + Task InsertManyAsync([NotNull] IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default); + /// - /// Updates an existing entity. + /// Updates an existing entity. /// /// /// Set true to automatically save changes to database. diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs index fd66b293c9..6c4d7a31f4 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs @@ -16,14 +16,6 @@ namespace Volo.Abp.Domain.Repositories public abstract class RepositoryBase : BasicRepositoryBase, IRepository, IUnitOfWorkManagerAccessor where TEntity : class, IEntity { - public IDataFilter DataFilter { get; set; } - - public ICurrentTenant CurrentTenant { get; set; } - - public IAsyncQueryableExecuter AsyncExecuter { get; set; } - - public IUnitOfWorkManager UnitOfWorkManager { get; set; } - public virtual Type ElementType => GetQueryable().ElementType; public virtual Expression Expression => GetQueryable().Expression; diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs index 0d44fd1249..c8e4b6e7e4 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs @@ -32,6 +32,8 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore public virtual IGuidGenerator GuidGenerator { get; set; } + public IEfCoreBulkOperationProvider BulkOperationProvider { get; set; } + public EfCoreRepository(IDbContextProvider dbContextProvider) { _dbContextProvider = dbContextProvider; @@ -110,11 +112,32 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore .ToListAsync(GetCancellationToken(cancellationToken)); } + public override async Task InsertManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + if (BulkOperationProvider != null) + { + await BulkOperationProvider.InsertManyAsync( + this, + entities, + autoSave, + cancellationToken + ); + return; + } + + await base.InsertManyAsync(entities, autoSave, cancellationToken); + } + protected override IQueryable GetQueryable() { return DbSet.AsQueryable(); } + protected override Task SaveChangesAsync(CancellationToken cancellationToken) + { + return DbContext.SaveChangesAsync(cancellationToken); + } + public async override Task FindAsync( Expression> predicate, bool includeDetails = true, diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs new file mode 100644 index 0000000000..6ff6e2bdc0 --- /dev/null +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Entities; +using Volo.Abp.EntityFrameworkCore; + +namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore +{ + public interface IEfCoreBulkOperationProvider + { + Task InsertManyAsync( + IEfCoreRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TDbContext : IEfCoreDbContext + where TEntity : class, IEntity; + } +} From 4e4b2454c02298ecb9ff95d3401046971d1725e1 Mon Sep 17 00:00:00 2001 From: enisn Date: Tue, 15 Dec 2020 17:48:56 +0300 Subject: [PATCH 004/493] Add Bulk Operation method to IBasicRepository - Related with #6654 --- .../Domain/Repositories/IBasicRepository.cs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs index 0637225229..24ec027b06 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs @@ -21,6 +21,16 @@ namespace Volo.Abp.Domain.Repositories [NotNull] Task InsertAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); + /// + /// Inserts multiple new entities. + /// + /// + /// Set true to automatically save changes to database. + /// This is useful for ORMs / database APIs those only save changes with an explicit method call, but you need to immediately save changes to the database. + /// + /// A to observe while waiting for the task to complete. + /// Entities to be inserted. + /// Awaitable . Task InsertManyAsync([NotNull] IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default); /// @@ -35,6 +45,17 @@ namespace Volo.Abp.Domain.Repositories [NotNull] Task UpdateAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); + /// + /// Updates multiple entities. + /// + /// Entities to be updated. + /// + /// Set true to automatically save changes to database. + /// This is useful for ORMs / database APIs those only save changes with an explicit method call, but you need to immediately save changes to the database. + /// A to observe while waiting for the task to complete. + /// Awaitable . + + Task UpdateManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default); /// /// Deletes an entity. /// @@ -45,6 +66,18 @@ namespace Volo.Abp.Domain.Repositories /// /// A to observe while waiting for the task to complete. Task DeleteAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); + + /// + /// Deletes multiple entities. + /// + /// Entities to be deleted. + /// + /// Set true to automatically save changes to database. + /// This is useful for ORMs / database APIs those only save changes with an explicit method call, but you need to immediately save changes to the database. + /// + /// A to observe while waiting for the task to complete. + /// Awaitable . + Task DeleteManyAsync([NotNull] IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default); } public interface IBasicRepository : IBasicRepository, IReadOnlyBasicRepository From dd01731d12b9cd010abee2184aed0144484001ea Mon Sep 17 00:00:00 2001 From: enisn Date: Tue, 15 Dec 2020 17:49:29 +0300 Subject: [PATCH 005/493] Default implementation of Bulk Operations - Related with #6654 --- .../Repositories/BasicRepositoryBase.cs | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs index 1235dc3714..4be7954a35 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs @@ -55,7 +55,7 @@ namespace Volo.Abp.Domain.Repositories { if (UnitOfWorkManager?.Current != null) { - return UnitOfWorkManager?.Current.SaveChangesAsync(cancellationToken); + return UnitOfWorkManager.Current.SaveChangesAsync(cancellationToken); } return Task.CompletedTask; @@ -63,8 +63,34 @@ namespace Volo.Abp.Domain.Repositories public abstract Task UpdateAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); + public virtual async Task UpdateManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await UpdateAsync(entity, cancellationToken: cancellationToken); + } + + if (autoSave) + { + await SaveChangesAsync(cancellationToken); + } + } + public abstract Task DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); + public virtual async Task DeleteManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await DeleteAsync(entity, cancellationToken: cancellationToken); + } + + if (autoSave) + { + await SaveChangesAsync(cancellationToken); + } + } + public abstract Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default); public abstract Task GetCountAsync(CancellationToken cancellationToken = default); From bc8ea33ec7dd6538012dc017a06fcfc2c32ffcb9 Mon Sep 17 00:00:00 2001 From: enisn Date: Tue, 15 Dec 2020 18:10:56 +0300 Subject: [PATCH 006/493] Add BulkOperationProviders for both Db Provider - Related with #6654 --- .../IEfCoreBulkOperationProvider.cs | 20 ++++++++++ .../MongoDB/IMongoDbBulkOperationProvider.cs | 37 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs index 6ff6e2bdc0..55883cb9ad 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs @@ -16,5 +16,25 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore ) where TDbContext : IEfCoreDbContext where TEntity : class, IEntity; + + + Task UpdateManyAsync( + IEfCoreRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TDbContext : IEfCoreDbContext + where TEntity : class, IEntity; + + + Task DeleteManyAsync( + IEfCoreRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TDbContext : IEfCoreDbContext + where TEntity : class, IEntity; } } diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs new file mode 100644 index 0000000000..a4751839da --- /dev/null +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories.MongoDB; + +namespace Volo.Abp.MongoDB.Volo.Abp.Domain.Repositories.MongoDB +{ + public interface IMongoDbBulkOperationProvider + { + Task InsertManyAsync( + IMongoDbRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TEntity : class, IEntity; + + + Task UpdateManyAsync( + IMongoDbRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TEntity : class, IEntity; + + + Task DeleteManyAsync( + IMongoDbRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TEntity : class, IEntity; + } +} From dc3e4a7a44e15b86759eddff7a4b0400e1d841fa Mon Sep 17 00:00:00 2001 From: enisn Date: Tue, 15 Dec 2020 18:27:30 +0300 Subject: [PATCH 007/493] Draft provider specified implementation of Bulk Operations --- .../Repositories/BasicRepositoryBase.cs | 16 ++++- .../Domain/Repositories/IBasicRepository.cs | 14 ++++- .../Abp/Domain/Repositories/RepositoryBase.cs | 18 +++++- .../EntityFrameworkCore/EfCoreRepository.cs | 60 ++++++++++++++++--- .../MemoryDb/MemoryDbRepository.cs | 14 +++++ .../Repositories/MongoDB/MongoDbRepository.cs | 6 ++ 6 files changed, 116 insertions(+), 12 deletions(-) diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs index 4be7954a35..f9100d43bb 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs @@ -1,4 +1,5 @@ -using System; +using JetBrains.Annotations; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -130,5 +131,18 @@ namespace Volo.Abp.Domain.Repositories await DeleteAsync(entity, autoSave, cancellationToken); } + + public async Task DeleteManyAsync([NotNull] IEnumerable ids, bool autoSave = false, CancellationToken cancellationToken = default) + { + foreach (var id in ids) + { + await DeleteAsync(id, cancellationToken: cancellationToken); + } + + if (autoSave) + { + await SaveChangesAsync(cancellationToken); + } + } } } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs index 24ec027b06..06a222cda7 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs @@ -55,7 +55,7 @@ namespace Volo.Abp.Domain.Repositories /// A to observe while waiting for the task to complete. /// Awaitable . - Task UpdateManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default); + Task UpdateManyAsync([NotNull] IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default); /// /// Deletes an entity. /// @@ -93,5 +93,17 @@ namespace Volo.Abp.Domain.Repositories /// /// A to observe while waiting for the task to complete. Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default); //TODO: Return true if deleted + + /// + /// Deletes multiple entities by primary keys. + /// + /// Primary keys of the each entity. + /// + /// Set true to automatically save changes to database. + /// This is useful for ORMs / database APIs those only save changes with an explicit method call, but you need to immediately save changes to the database. + /// + /// A to observe while waiting for the task to complete. + /// Awaitable . + Task DeleteManyAsync([NotNull] IEnumerable ids, bool autoSave = false, CancellationToken cancellationToken = default); } } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs index 6c4d7a31f4..db0ec2b11c 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs @@ -1,4 +1,5 @@ -using System; +using JetBrains.Annotations; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -101,5 +102,20 @@ namespace Volo.Abp.Domain.Repositories await DeleteAsync(entity, autoSave, cancellationToken); } + + + + public async Task DeleteManyAsync([NotNull] IEnumerable ids, bool autoSave = false, CancellationToken cancellationToken = default) + { + foreach (var id in ids) + { + await DeleteAsync(id, cancellationToken: cancellationToken); + } + + if (autoSave) + { + await SaveChangesAsync(cancellationToken); + } + } } } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs index c8e4b6e7e4..4866b9daea 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs @@ -1,13 +1,14 @@ -using System; +using JetBrains.Annotations; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; using Volo.Abp.Domain.Entities; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.DependencyInjection; @@ -112,20 +113,48 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore .ToListAsync(GetCancellationToken(cancellationToken)); } - public override async Task InsertManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + public override Task InsertManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) { if (BulkOperationProvider != null) { - await BulkOperationProvider.InsertManyAsync( + return BulkOperationProvider.InsertManyAsync( this, entities, autoSave, cancellationToken ); - return; } - await base.InsertManyAsync(entities, autoSave, cancellationToken); + return base.InsertManyAsync(entities, autoSave, cancellationToken); + } + + public override Task UpdateManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + if (BulkOperationProvider != null) + { + return BulkOperationProvider.UpdateManyAsync( + this, + entities, + autoSave, + cancellationToken + ); + } + + return base.UpdateManyAsync(entities, autoSave, cancellationToken); + } + + public override Task DeleteManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + if (BulkOperationProvider != null) + { + return BulkOperationProvider.DeleteManyAsync( + this, + entities, + autoSave, + cancellationToken); + } + + return base.DeleteManyAsync(entities, autoSave, cancellationToken); } protected override IQueryable GetQueryable() @@ -275,7 +304,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore { return includeDetails ? await WithDetails().FirstOrDefaultAsync(e => e.Id.Equals(id), GetCancellationToken(cancellationToken)) - : await DbSet.FindAsync(new object[] {id}, GetCancellationToken(cancellationToken)); + : await DbSet.FindAsync(new object[] { id }, GetCancellationToken(cancellationToken)); } public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) @@ -288,5 +317,18 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore await DeleteAsync(entity, autoSave, cancellationToken); } + + public async Task DeleteManyAsync([NotNull] IEnumerable ids, bool autoSave = false, CancellationToken cancellationToken = default) + { + foreach (var id in ids) + { + await DeleteAsync(id, cancellationToken: cancellationToken); + } + + if (autoSave) + { + await SaveChangesAsync(cancellationToken); + } + } } } diff --git a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs index bb77149a29..63203d8b0f 100644 --- a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs +++ b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs @@ -1,3 +1,4 @@ +using JetBrains.Annotations; using System; using System.Collections.Generic; using System.Linq; @@ -309,5 +310,18 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb { await DeleteAsync(x => x.Id.Equals(id), autoSave, cancellationToken); } + + public virtual async Task DeleteManyAsync([NotNull] IEnumerable ids, bool autoSave = false, CancellationToken cancellationToken = default) + { + foreach (var id in ids) + { + await DeleteAsync(id, cancellationToken: cancellationToken); + } + + if (autoSave) + { + await SaveChangesAsync(cancellationToken); + } + } } } diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index 6af98da56b..35d75629b0 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -1,3 +1,4 @@ +using JetBrains.Annotations; using MongoDB.Driver; using MongoDB.Driver.Linq; using System; @@ -481,5 +482,10 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { return RepositoryFilterer.CreateEntityFilter(entity, withConcurrencyStamp, concurrencyStamp); } + + public async Task DeleteManyAsync([NotNull] IEnumerable ids, bool autoSave = false, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } } } From 0a96808d15bc3e33693fa73da853bf06e9094474 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 16 Dec 2020 11:50:22 +0300 Subject: [PATCH 008/493] Add multiple entity filtering to MongoDbRepositoryFilterer --- .../MongoDB/IMongoDbRepositoryFilterer.cs | 21 +++++++++++++++ .../MongoDB/MongoDbRepositoryFilterer.cs | 27 ++++++++++++++++--- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepositoryFilterer.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepositoryFilterer.cs index 1790c8af6b..5a96a29022 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepositoryFilterer.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepositoryFilterer.cs @@ -14,5 +14,26 @@ namespace Volo.Abp.Domain.Repositories.MongoDB FilterDefinition CreateEntityFilter(TKey id, bool applyFilters = false); FilterDefinition CreateEntityFilter(TEntity entity, bool withConcurrencyStamp = false, string concurrencyStamp = null); + + /// + /// Creates 'In' filter for mongoDb. + /// + /// + /// Visit https://docs.mongodb.com/manual/reference/operator/query/in/ to get more information about 'in' operator. + /// + /// Entities to be filtered. + /// Set true to use GlobalFilters. Default is false. + /// Created . + FilterDefinition CreateEntitiesFilter(IEnumerable entities, bool applyFilters = false); + + /// + /// Creates 'In' filter for mongoDb. + /// + /// + /// Visit https://docs.mongodb.com/manual/reference/operator/query/in/ to get more information about 'in' operator. + /// + /// Entity Ids to be filtered. + /// Set true to use GlobalFilters. Default is false. + FilterDefinition CreateEntitiesFilter(IEnumerable ids, bool applyFilters = false); } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepositoryFilterer.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepositoryFilterer.cs index 4c07c747f3..bee66efba5 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepositoryFilterer.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepositoryFilterer.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.Domain.Entities; @@ -23,13 +24,13 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)) && DataFilter.IsEnabled()) { - filters.Add(Builders.Filter.Eq(e => ((ISoftDelete) e).IsDeleted, false)); + filters.Add(Builders.Filter.Eq(e => ((ISoftDelete)e).IsDeleted, false)); } if (typeof(IMultiTenant).IsAssignableFrom(typeof(TEntity))) { var tenantId = CurrentTenant.Id; - filters.Add(Builders.Filter.Eq(e => ((IMultiTenant) e).TenantId, tenantId)); + filters.Add(Builders.Filter.Eq(e => ((IMultiTenant)e).TenantId, tenantId)); } } } @@ -72,8 +73,28 @@ namespace Volo.Abp.Domain.Repositories.MongoDB return Builders.Filter.And( Builders.Filter.Eq(e => e.Id, entity.Id), - Builders.Filter.Eq(e => ((IHasConcurrencyStamp) e).ConcurrencyStamp, concurrencyStamp) + Builders.Filter.Eq(e => ((IHasConcurrencyStamp)e).ConcurrencyStamp, concurrencyStamp) ); } + + public FilterDefinition CreateEntitiesFilter(IEnumerable entities, bool applyFilters = false) + { + return CreateEntitiesFilter(entities.Select(s => s.Id), applyFilters); + } + + public FilterDefinition CreateEntitiesFilter(IEnumerable ids, bool applyFilters = false) + { + var filters = new List>() + { + Builders.Filter.In(e => e.Id, ids), + }; + + if (applyFilters) + { + AddGlobalFilters(filters); + } + + return Builders.Filter.And(filters); + } } } \ No newline at end of file From 7d39d8a37fc563e6509646128f1b07baac8ee3fa Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 16 Dec 2020 11:50:56 +0300 Subject: [PATCH 009/493] Implementation of Bulk Operations to MonboDbRepository - InsertMany - UpdateMany - DeleteMany - Related with #6654 --- .../Repositories/MongoDB/MongoDbRepository.cs | 146 +++++++++++++++++- 1 file changed, 145 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index 35d75629b0..308b7d98ed 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -82,6 +82,28 @@ namespace Volo.Abp.Domain.Repositories.MongoDB return entity; } + public override async Task InsertManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await ApplyAbpConceptsForAddedEntityAsync(entity); + } + + if (SessionHandle != null) + { + await Collection.InsertManyAsync( + SessionHandle, + entities, + cancellationToken: cancellationToken); + } + else + { + await Collection.InsertManyAsync( + entities, + cancellationToken: cancellationToken); + } + } + public async override Task UpdateAsync( TEntity entity, bool autoSave = false, @@ -132,6 +154,55 @@ namespace Volo.Abp.Domain.Repositories.MongoDB return entity; } + public override async Task UpdateManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + var isSoftDeleteEntity = typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)); + + foreach (var entity in entities) + { + SetModificationAuditProperties(entity); + + if (isSoftDeleteEntity) + { + SetDeletionAuditProperties(entity); + await TriggerEntityDeleteEventsAsync(entity); + } + else + { + await TriggerEntityUpdateEventsAsync(entity); + } + + await TriggerDomainEventsAsync(entity); + + SetNewConcurrencyStamp(entity); + } + + var entitiesCount = entities.Count(); + BulkWriteResult result; + + if (SessionHandle != null) + { + result = await Collection.BulkWriteAsync(SessionHandle, GetReplaceRequests()); + } + else + { + result = await Collection.BulkWriteAsync(GetReplaceRequests()); + } + + if (result.MatchedCount < entitiesCount) + { + ThrowOptimisticConcurrencyException(); + } + + IEnumerable> GetReplaceRequests() + { + foreach (var entity in entities) + { + yield return new ReplaceOneModel(CreateEntityFilter(entity), entity); + } + } + } + public async override Task DeleteAsync( TEntity entity, bool autoSave = false, @@ -195,6 +266,67 @@ namespace Volo.Abp.Domain.Repositories.MongoDB } } + public override async Task DeleteManyAsync( + IEnumerable entities, + bool autoSave = false, + CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await ApplyAbpConceptsForDeletedEntityAsync(entity); + var oldConcurrencyStamp = SetNewConcurrencyStamp(entity); + } + + var entitiesCount = entities.Count(); + + if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity))) + { + UpdateResult updateResult; + if (SessionHandle != null) + { + updateResult = await Collection.UpdateManyAsync( + SessionHandle, + CreateEntitiesFilter(entities), + Builders.Update.Set(x => ((ISoftDelete)x).IsDeleted, true) + ); + } + else + { + updateResult = await Collection.UpdateManyAsync( + CreateEntitiesFilter(entities), + Builders.Update.Set(x => ((ISoftDelete)x).IsDeleted, true) + ); + } + + if (updateResult.MatchedCount < entitiesCount) + { + ThrowOptimisticConcurrencyException(); + } + } + else + { + DeleteResult deleteResult; + if (SessionHandle != null) + { + deleteResult = await Collection.DeleteManyAsync( + SessionHandle, + CreateEntitiesFilter(entities) + ); + } + else + { + deleteResult = await Collection.DeleteManyAsync( + CreateEntitiesFilter(entities) + ); + } + + if (deleteResult.DeletedCount < entitiesCount) + { + ThrowOptimisticConcurrencyException(); + } + } + } + public async override Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default) { return await GetMongoQueryable().ToListAsync(GetCancellationToken(cancellationToken)); @@ -271,6 +403,13 @@ namespace Volo.Abp.Domain.Repositories.MongoDB ); } + protected virtual FilterDefinition CreateEntitiesFilter(IEnumerable entities, bool withConcurrencyStamp = false) + { + throw new NotImplementedException( + $"{nameof(CreateEntitiesFilter)} is not implemented for MongoDB by default. It should be overriden and implemented by the deriving class!" + ); + } + protected virtual async Task ApplyAbpConceptsForAddedEntityAsync(TEntity entity) { CheckAndSetId(entity); @@ -483,9 +622,14 @@ namespace Volo.Abp.Domain.Repositories.MongoDB return RepositoryFilterer.CreateEntityFilter(entity, withConcurrencyStamp, concurrencyStamp); } + protected override FilterDefinition CreateEntitiesFilter(IEnumerable entities, bool withConcurrencyStamp = false) + { + return RepositoryFilterer.CreateEntitiesFilter(entities, withConcurrencyStamp); + } + public async Task DeleteManyAsync([NotNull] IEnumerable ids, bool autoSave = false, CancellationToken cancellationToken = default) { - throw new NotImplementedException(); + } } } From a1a0f99bdbd14ec17e9075bde2c9955ffecbff2d Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 16 Dec 2020 12:33:48 +0300 Subject: [PATCH 010/493] Implementation of IMongoDbBulkOperationProvider into repository --- .../MongoDB/IMongoDbBulkOperationProvider.cs | 4 ++-- .../Repositories/MongoDB/MongoDbRepository.cs | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs index a4751839da..367a70bb86 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.MongoDB.Volo.Abp.Domain.Repositories.MongoDB where TEntity : class, IEntity; - Task UpdateManyAsync( + Task UpdateManyAsync( IMongoDbRepository repository, IEnumerable entities, bool autoSave, @@ -26,7 +26,7 @@ namespace Volo.Abp.MongoDB.Volo.Abp.Domain.Repositories.MongoDB where TEntity : class, IEntity; - Task DeleteManyAsync( + Task DeleteManyAsync( IMongoDbRepository repository, IEnumerable entities, bool autoSave, diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index 308b7d98ed..938899d2c2 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -16,6 +16,7 @@ using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Local; using Volo.Abp.Guids; using Volo.Abp.MongoDB; +using Volo.Abp.MongoDB.Volo.Abp.Domain.Repositories.MongoDB; namespace Volo.Abp.Domain.Repositories.MongoDB { @@ -46,6 +47,8 @@ namespace Volo.Abp.Domain.Repositories.MongoDB public IAuditPropertySetter AuditPropertySetter { get; set; } + public IMongoDbBulkOperationProvider BulkOperationProvider { get; set; } + public MongoDbRepository(IMongoDbContextProvider dbContextProvider) { DbContextProvider = dbContextProvider; @@ -89,6 +92,12 @@ namespace Volo.Abp.Domain.Repositories.MongoDB await ApplyAbpConceptsForAddedEntityAsync(entity); } + if (BulkOperationProvider != null) + { + await BulkOperationProvider.InsertManyAsync(this, entities, autoSave, cancellationToken); + return; + } + if (SessionHandle != null) { await Collection.InsertManyAsync( @@ -177,6 +186,12 @@ namespace Volo.Abp.Domain.Repositories.MongoDB SetNewConcurrencyStamp(entity); } + if (BulkOperationProvider != null) + { + await BulkOperationProvider.UpdateManyAsync(this, entities, autoSave, cancellationToken); + return; + } + var entitiesCount = entities.Count(); BulkWriteResult result; @@ -277,6 +292,12 @@ namespace Volo.Abp.Domain.Repositories.MongoDB var oldConcurrencyStamp = SetNewConcurrencyStamp(entity); } + if (BulkOperationProvider != null) + { + await BulkOperationProvider.DeleteManyAsync(this, entities, autoSave, cancellationToken); + return; + } + var entitiesCount = entities.Count(); if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity))) From 3f51368ac398597d076e9c9f43fa6086dde550b2 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 16 Dec 2020 12:48:34 +0300 Subject: [PATCH 011/493] Blank implementation for RepositoryRegistration_Tests --- .../Abp/Domain/Repositories/RepositoryRegistration_Tests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/framework/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs b/framework/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs index 57b8054784..baf49f4314 100644 --- a/framework/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs +++ b/framework/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities; @@ -305,6 +306,11 @@ namespace Volo.Abp.Domain.Repositories { throw new NotImplementedException(); } + + public Task DeleteManyAsync([NotNull] IEnumerable ids, bool autoSave = false, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } } public class MyTestCustomBaseRepository : MyTestDefaultRepository From 855f1eec226dd7724d28be5abcb5b6dca73bcac0 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 16 Dec 2020 15:59:31 +0300 Subject: [PATCH 012/493] DeleteMany with id implementation for MongoRepository --- .../Repositories/MongoDB/MongoDbRepository.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index 938899d2c2..7c910d350f 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -638,6 +638,15 @@ namespace Volo.Abp.Domain.Repositories.MongoDB return DeleteAsync(x => x.Id.Equals(id), autoSave, cancellationToken); } + public virtual async Task DeleteManyAsync([NotNull] IEnumerable ids, bool autoSave = false, CancellationToken cancellationToken = default) + { + var entities = await GetMongoQueryable() + .Where(x => ids.Contains(x.Id)) + .ToListAsync(GetCancellationToken(cancellationToken)); + + await DeleteManyAsync(entities, autoSave, cancellationToken); + } + protected override FilterDefinition CreateEntityFilter(TEntity entity, bool withConcurrencyStamp = false, string concurrencyStamp = null) { return RepositoryFilterer.CreateEntityFilter(entity, withConcurrencyStamp, concurrencyStamp); @@ -647,10 +656,5 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { return RepositoryFilterer.CreateEntitiesFilter(entities, withConcurrencyStamp); } - - public async Task DeleteManyAsync([NotNull] IEnumerable ids, bool autoSave = false, CancellationToken cancellationToken = default) - { - - } } } From 87e9d02248a74f86b5b689ec95e48d2f7379999c Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 16 Dec 2020 15:59:48 +0300 Subject: [PATCH 013/493] Bulk Operations Simple tests --- .../TestApp/Testing/Repository_Basic_Tests.cs | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests.cs index a93123c1ca..a1b08194c3 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Shouldly; using Volo.Abp.Domain.Repositories; @@ -115,5 +117,72 @@ namespace Volo.Abp.TestApp.Testing person.Id.ShouldNotBe(Guid.Empty); } + + [Fact] + public async Task InserManyAsync() + { + var entities = new List + { + new Person(Guid.NewGuid(), "Person 1", 30), + new Person(Guid.NewGuid(), "Person 2", 31), + new Person(Guid.NewGuid(), "Person 3", 32), + new Person(Guid.NewGuid(), "Person 4", 33), + }; + + await PersonRepository.InsertManyAsync(entities); + + foreach (var entity in entities) + { + var person = await PersonRepository.FindAsync(entity.Id); + person.ShouldNotBeNull(); + } + } + + [Fact] + public async Task UpdateManyAsync() + { + var entities = await PersonRepository.GetListAsync(); + var random = new Random(); + entities.ForEach(f => f.Age = random.Next()); + + await PersonRepository.UpdateManyAsync(entities); + + foreach (var entity in entities) + { + var person = await PersonRepository.FindAsync(entity.Id); + person.ShouldNotBeNull(); + person.Age.ShouldBe(entity.Age); + } + } + + [Fact] + public async Task DeleteManyAsync() + { + var entities = await PersonRepository.GetListAsync(); + + await PersonRepository.DeleteManyAsync(entities); + + foreach (var entity in entities) + { + var person = await PersonRepository.FindAsync(entity.Id); + person.ShouldBeNull(); + } + } + + [Fact] + public async Task DeleteManyAsync_WithId() + { + var entities = await PersonRepository.GetListAsync(); + + var ids = entities.Select(s => s.Id).ToArray(); + + await PersonRepository.DeleteManyAsync(ids); + + foreach (var id in ids) + { + var person = await PersonRepository.FindAsync(id); + person.ShouldBeNull(); + } + } } } From 2d2f3cb6cb4f2e34b4941afd5804042e396ff36a Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 16 Dec 2020 16:26:49 +0300 Subject: [PATCH 014/493] Docs for Bulk Operations --- docs/en/Repositories.md | 82 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/docs/en/Repositories.md b/docs/en/Repositories.md index 5ff8372af8..1162e6a248 100644 --- a/docs/en/Repositories.md +++ b/docs/en/Repositories.md @@ -87,6 +87,88 @@ If your entity is a soft-delete entity, you can use the `HardDeleteAsync` method See the [Data Filtering](Data-Filtering.md) documentation for more about soft-delete. +## Bulk Operations +You can execute bulk operations with `InsertMany`, `UpdateMany`, `DeleteMany` methods. + +Both providers `MongoDb` and `Ef Core` support bulk operations. + +### Customization + +If you have better logic or using an external library for bulk operations, you can override the logic via implementing `IMongoDbBulkOperationProvider` for MongoDb and `IEfCoreBulkOperationProvider` for Ef Core. + +- MongoDb Customization: + +```csharp +public class MyCustomMongoDbBulkOperationProvider : IMongoDbBulkOperationProvider, ITransientDependency +{ + public async Task DeleteManyAsync(IMongoDbRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken) + where TEntity : class, IEntity + { + // Your logic here. + } + + public async Task InsertManyAsync(IMongoDbRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken) + where TEntity : class, IEntity + { + // Your logic here. + } + + public async Task UpdateManyAsync(IMongoDbRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken) + where TEntity : class, IEntity + { + // Your logic here. + } +} +``` + +- Entitiy Framework Core Customization +```csharp +public class MyCustomEfCoreBulkOperationProvider : IEfCoreBulkOperationProvider, ITransientDependency +{ + public async Task DeleteManyAsync(IEfCoreRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken) + where TDbContext : IEfCoreDbContext + where TEntity : class, IEntity + { + // Your logic here. + } + + public async Task InsertManyAsync(IEfCoreRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken) + where TDbContext : IEfCoreDbContext + where TEntity : class, IEntity + { + // Your logic here. + } + + public async Task UpdateManyAsync(IEfCoreRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken) + where TDbContext : IEfCoreDbContext + where TEntity : class, IEntity + { + // Your logic here. + } +} +``` + + + + ## Custom Repositories Default generic repositories will be sufficient for most cases. However, you may need to create a custom repository class for your entity. From b09b1d343694daeb70022f809bf0881f1cc219d3 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 16 Dec 2020 19:08:55 +0300 Subject: [PATCH 015/493] Add ConcurrencyStamp warning to Repositories.md --- docs/en/Repositories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Repositories.md b/docs/en/Repositories.md index 1162e6a248..0920a293fa 100644 --- a/docs/en/Repositories.md +++ b/docs/en/Repositories.md @@ -166,7 +166,7 @@ public class MyCustomEfCoreBulkOperationProvider : IEfCoreBulkOperationProvider, } ``` - +> **WARNING:** ConcurrencyStamp can't be checked at bulk operations! ## Custom Repositories From 2c0b11336ce7e9429dbbbba62f209878a3d26769 Mon Sep 17 00:00:00 2001 From: enisn Date: Thu, 17 Dec 2020 13:36:20 +0300 Subject: [PATCH 016/493] Update BulkOperations implementation as xxRange methods for EfCoreRepository --- .../EntityFrameworkCore/EfCoreRepository.cs | 114 +++++++++++------- 1 file changed, 70 insertions(+), 44 deletions(-) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs index 4866b9daea..437e32ad40 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; +using Nito.AsyncEx; using System; using System.Collections.Generic; using System.Linq; @@ -62,6 +63,32 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore return savedEntity; } + public override async Task InsertManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + CheckAndSetId(entity); + } + + if (BulkOperationProvider != null) + { + await BulkOperationProvider.InsertManyAsync( + this, + entities, + autoSave, + cancellationToken + ); + return; + } + + await DbSet.AddRangeAsync(entities); + + if (autoSave) + { + await DbContext.SaveChangesAsync(); + } + } + public async override Task UpdateAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { DbContext.Attach(entity); @@ -76,6 +103,28 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore return updatedEntity; } + public override async Task UpdateManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + if (BulkOperationProvider != null) + { + await BulkOperationProvider.UpdateManyAsync( + this, + entities, + autoSave, + cancellationToken + ); + + return; + } + + DbSet.UpdateRange(entities); + + if (autoSave) + { + await DbContext.SaveChangesAsync(); + } + } + public async override Task DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { DbSet.Remove(entity); @@ -86,6 +135,27 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore } } + public override async Task DeleteManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) + { + if (BulkOperationProvider != null) + { + await BulkOperationProvider.DeleteManyAsync( + this, + entities, + autoSave, + cancellationToken); + + return; + } + + DbSet.RemoveRange(entities); + + if (autoSave) + { + await DbContext.SaveChangesAsync(); + } + } + public async override Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default) { return includeDetails @@ -113,50 +183,6 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore .ToListAsync(GetCancellationToken(cancellationToken)); } - public override Task InsertManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) - { - if (BulkOperationProvider != null) - { - return BulkOperationProvider.InsertManyAsync( - this, - entities, - autoSave, - cancellationToken - ); - } - - return base.InsertManyAsync(entities, autoSave, cancellationToken); - } - - public override Task UpdateManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) - { - if (BulkOperationProvider != null) - { - return BulkOperationProvider.UpdateManyAsync( - this, - entities, - autoSave, - cancellationToken - ); - } - - return base.UpdateManyAsync(entities, autoSave, cancellationToken); - } - - public override Task DeleteManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) - { - if (BulkOperationProvider != null) - { - return BulkOperationProvider.DeleteManyAsync( - this, - entities, - autoSave, - cancellationToken); - } - - return base.DeleteManyAsync(entities, autoSave, cancellationToken); - } - protected override IQueryable GetQueryable() { return DbSet.AsQueryable(); From c14761a72309e3b30e0df4a2bb9e3c6e9543d9c3 Mon Sep 17 00:00:00 2001 From: EngincanV Date: Thu, 17 Dec 2020 16:19:18 +0300 Subject: [PATCH 017/493] Update POST.md --- .../POST.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/Community-Articles/2020-12-10-How-to-Integrate-the-Telerik-Blazor-Component/POST.md b/docs/en/Community-Articles/2020-12-10-How-to-Integrate-the-Telerik-Blazor-Component/POST.md index 4bdebb6234..971eb88f97 100644 --- a/docs/en/Community-Articles/2020-12-10-How-to-Integrate-the-Telerik-Blazor-Component/POST.md +++ b/docs/en/Community-Articles/2020-12-10-How-to-Integrate-the-Telerik-Blazor-Component/POST.md @@ -52,7 +52,10 @@ abp new TelerikComponents --ui blazor --database-provider ef ```html ... - + + - true - snupkg - + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb diff --git a/nupkg/pack.ps1 b/nupkg/pack.ps1 index 8c1dcdf10c..4799ba36f2 100644 --- a/nupkg/pack.ps1 +++ b/nupkg/pack.ps1 @@ -26,8 +26,6 @@ foreach($project in $projects) { $projectName = $project.Substring($project.LastIndexOf("/") + 1) $projectPackPath = Join-Path $projectFolder ("/bin/Release/" + $projectName + ".*.nupkg") Move-Item $projectPackPath $packFolder - $projectSymbolPackPath = Join-Path $projectFolder ("/bin/Release/" + $projectName + ".*.snupkg") - Move-Item $projectSymbolPackPath $packFolder } # Go back to the pack folder From fdb5bbadd0527fb341cb7cbd2b280ab216c7abbe Mon Sep 17 00:00:00 2001 From: Ilkay Ilknur Date: Wed, 6 Jan 2021 12:47:02 +0300 Subject: [PATCH 315/493] missing dbsets added. Resolves global filter issues. --- .../EntityFrameworkCore/CmsKitDbContext.cs | 17 ++++++++++++++- .../EntityFrameworkCore/ICmsKitDbContext.cs | 21 ++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs index 65d9b55181..0a4213e1b4 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs @@ -1,12 +1,28 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.CmsKit.Comments; +using Volo.CmsKit.Contents; +using Volo.CmsKit.Pages; +using Volo.CmsKit.Ratings; +using Volo.CmsKit.Reactions; +using Volo.CmsKit.Tags; +using Volo.CmsKit.Users; namespace Volo.CmsKit.EntityFrameworkCore { [ConnectionStringName(CmsKitDbProperties.ConnectionStringName)] public class CmsKitDbContext : AbpDbContext, ICmsKitDbContext { + public DbSet Contents { get; set; } + public DbSet Comments { get; set; } + public DbSet User { get; set; } + public DbSet Reactions { get; set; } + public DbSet Ratings { get; set; } + public DbSet Tags { get; set; } + public DbSet EntityTags { get; set; } + public DbSet Pages { get; set; } + public CmsKitDbContext(DbContextOptions options) : base(options) { @@ -16,7 +32,6 @@ namespace Volo.CmsKit.EntityFrameworkCore protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); - builder.ConfigureCmsKit(); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs index 80bfeb1f5a..a5981fd000 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs @@ -1,11 +1,26 @@ -using Volo.Abp.Data; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.CmsKit.Comments; +using Volo.CmsKit.Contents; +using Volo.CmsKit.Pages; +using Volo.CmsKit.Ratings; +using Volo.CmsKit.Reactions; +using Volo.CmsKit.Tags; +using Volo.CmsKit.Users; namespace Volo.CmsKit.EntityFrameworkCore { [ConnectionStringName(CmsKitDbProperties.ConnectionStringName)] public interface ICmsKitDbContext : IEfCoreDbContext { - + DbSet Contents { get; set; } + DbSet Comments { get; set; } + DbSet User { get; set; } + DbSet Reactions { get; set; } + DbSet Ratings { get; set; } + DbSet Tags { get; set; } + DbSet EntityTags { get; set; } + DbSet Pages { get; set; } } -} +} \ No newline at end of file From 9f67b5ddb1a7ddca36712406ec1adcf74328ae80 Mon Sep 17 00:00:00 2001 From: Ilkay Ilknur Date: Wed, 6 Jan 2021 12:47:17 +0300 Subject: [PATCH 316/493] CMS Menu localization key added. --- .../Volo/CmsKit/Localization/Resources/en.json | 1 + .../Volo/CmsKit/Localization/Resources/tr.json | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json index 42d56b8d16..27c5b3fad0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json @@ -8,6 +8,7 @@ "LoginToAddComment": "Login to add comment", "LoginToRate": "Login to rate", "LoginToReply": "Login to reply", + "Menu:CMS": "CMS", "MessageDeletionConfirmationMessage": "This comment will be deleted completely.", "Permission:CmsKit": "CmsKit", "Permission:TagManagement": "Tag Management", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json index ac8bd98a9f..2433aca4ac 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json @@ -8,6 +8,7 @@ "LoginToAddComment": "Yorum yapmak için giriş yap", "LoginToRate": "Oylamak için giriş yapın", "LoginToReply": "Cevap vermek için giriş yap", + "Menu:CMS": "CMS", "MessageDeletionConfirmationMessage": "Bu yorum tamamen silinecektir", "Permission:CmsKit": "CmsKit", "Permission:TagManagement": "Etiket Yönetimi", From f5a8e82e13344adf95fbcaed8ce5737f5e832dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 6 Jan 2021 13:33:44 +0300 Subject: [PATCH 317/493] Fix the version --- common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.props b/common.props index 39ce965ec0..ccfc483027 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 4.1.0-rc.2 + 4.2.0 $(NoWarn);CS1591;CS0436 https://abp.io/assets/abp_nupkg.png https://abp.io/ From 94dce9a925e8c8cbee1f895db084567b1c622d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 6 Jan 2021 13:39:11 +0300 Subject: [PATCH 318/493] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd27da8fe0..a73e9ef3ed 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ ![build and test](https://github.com/abpframework/abp/workflows/build%20and%20test/badge.svg) [![NuGet](https://img.shields.io/nuget/v/Volo.Abp.Core.svg?style=flat-square)](https://www.nuget.org/packages/Volo.Abp.Core) -[![MyGet (with prereleases)](https://img.shields.io/myget/abp-nightly/vpre/Volo.Abp.svg?style=flat-square)](https://docs.abp.io/en/abp/latest/Nightly-Builds) +[![NuGet (with prereleases)](https://img.shields.io/nuget/vpre/Volo.Abp.Core.svg?style=flat-square)](https://www.nuget.org/packages/Volo.Abp.Core) +[![MyGet (nightly builds)](https://img.shields.io/myget/abp-nightly/vpre/Volo.Abp.svg?style=flat-square)](https://docs.abp.io/en/abp/latest/Nightly-Builds) [![NuGet Download](https://img.shields.io/nuget/dt/Volo.Abp.Core.svg?style=flat-square)](https://www.nuget.org/packages/Volo.Abp.Core) ABP Framework is a complete **infrastructure** based on the **ASP.NET Core** to create **modern web applications** and **APIs** by following the software development **best practices** and the **latest technologies**. @@ -103,4 +104,4 @@ ABP is a community-driven open source project. See [the contribution guide](http ## Support the ABP Framework -Love ABP Framework? **Please give a star** to this repository :star: \ No newline at end of file +Love ABP Framework? **Please give a star** to this repository :star: From 751658f18a04815fb6c476292fd202e894fe36b8 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 6 Jan 2021 13:40:49 +0300 Subject: [PATCH 319/493] fix: Clear filter doesn't work on Docs resolves https://github.com/abpframework/abp/issues/6709 --- .../docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 33f0c96624..88ab199f2e 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -71,9 +71,11 @@ }); }; - $('#filter').keyup(function (e) { + $('#filter').on('input', (e) => { filterDocumentItems(e.target.value); + }) + $('#filter').keyup(function (e) { if (e.key === 'Enter') { gotoFilteredDocumentIfThereIsOnlyOne(); } From 23e14c03cdd9c6044cac728fba7d7efef8c74d95 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 6 Jan 2021 14:32:37 +0300 Subject: [PATCH 320/493] CmsKit - Refactor on ContentAdminController --- .../{ContentController.cs => ContentAdminController.cs} | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/{ContentController.cs => ContentAdminController.cs} (85%) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs similarity index 85% rename from modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentController.cs rename to modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs index 2dec4b60d5..935606b686 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs @@ -4,20 +4,23 @@ using System; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.GlobalFeatures; using Volo.CmsKit.Admin.Contents; +using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Contents { [Authorize(CmsKitAdminPermissions.Contents.Default)] + [RequiresGlobalFeature(typeof(ContentsFeature))] [RemoteService(Name = CmsKitCommonRemoteServiceConsts.RemoteServiceName)] [Area("cms-kit")] [Route("api/cms-kit-admin/contents")] - public class ContentController : CmsKitAdminController, IContentAdminAppService + public class ContentAdminController : CmsKitAdminController, IContentAdminAppService { protected IContentAdminAppService ContentAdminAppService { get; } - public ContentController(IContentAdminAppService contentAdminAppService) + public ContentAdminController(IContentAdminAppService contentAdminAppService) { ContentAdminAppService = contentAdminAppService; } From 3f721592441b4f7cf645c5d66be061e811d1f09c Mon Sep 17 00:00:00 2001 From: Ilkay Ilknur Date: Wed, 6 Jan 2021 14:34:23 +0300 Subject: [PATCH 321/493] rename tag controller to tag admin controller. --- .../Admin/Tags/{TagController.cs => TagAdminController.cs} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/{TagController.cs => TagAdminController.cs} (90%) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/TagController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/TagAdminController.cs similarity index 90% rename from modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/TagController.cs rename to modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/TagAdminController.cs index 11dcc9a846..54cc4b1499 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/TagController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/TagAdminController.cs @@ -9,11 +9,11 @@ using Volo.CmsKit.Tags; namespace Volo.CmsKit.Admin.Tags { - public class TagController : CmsKitAdminController, ITagAdminAppService + public class TagAdminController : CmsKitAdminController, ITagAdminAppService { protected ITagAdminAppService TagAdminAppService { get; } - public TagController(ITagAdminAppService tagAdminAppService) + public TagAdminController(ITagAdminAppService tagAdminAppService) { TagAdminAppService = tagAdminAppService; } From d3c7b5fc9867289a2f2bcc7dcd2b59325cd5aaa0 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 6 Jan 2021 14:35:30 +0300 Subject: [PATCH 322/493] CmsKit - Remove custom queryfilter from Content entity --- .../CmsKitDbContextModelCreatingExtensions.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs index b61b35a363..3c937a3432 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs @@ -105,8 +105,6 @@ namespace Volo.CmsKit.EntityFrameworkCore b.ConfigureByConvention(); - b.HasQueryFilter(x => !x.IsDeleted); // TODO: Find out why default filter doesn't work. - b.Property(x => x.EntityType).IsRequired().HasMaxLength(ContentConsts.MaxEntityTypeLength); b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength); b.Property(x => x.Value).IsRequired().HasMaxLength(ContentConsts.MaxValueLength); From f48409be6c6f2f6ed745be5b62a63c8ee48d81a5 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 6 Jan 2021 14:42:23 +0300 Subject: [PATCH 323/493] CmsKit - Add GlobalFeature check to configuration of ModelBuilder --- .../CmsKitDbContextModelCreatingExtensions.cs | 53 ++++++++++--------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs index 8d32de7958..a0a4ca06d0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs @@ -41,8 +41,8 @@ namespace Volo.CmsKit.EntityFrameworkCore b.ConfigureByConvention(); b.ConfigureAbpUser(); - b.HasIndex(x => new {x.TenantId, x.UserName}); - b.HasIndex(x => new {x.TenantId, x.Email}); + b.HasIndex(x => new { x.TenantId, x.UserName }); + b.HasIndex(x => new { x.TenantId, x.Email }); }); } @@ -93,59 +93,62 @@ namespace Volo.CmsKit.EntityFrameworkCore r.Property(x => x.EntityType).IsRequired().HasMaxLength(RatingConsts.MaxEntityTypeLength); r.Property(x => x.EntityId).IsRequired().HasMaxLength(RatingConsts.MaxEntityIdLength); - r.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId, x.CreatorId}); + r.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId, x.CreatorId }); }); } builder.Entity(b => { b.ToTable(options.TablePrefix + "Contents", options.Schema); - + b.ConfigureByConvention(); - + b.Property(x => x.EntityType).IsRequired().HasMaxLength(ContentConsts.MaxEntityTypeLength); b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength); b.Property(x => x.Value).IsRequired().HasMaxLength(ContentConsts.MaxValueLength); - + b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); }); - - builder.Entity(b => + + if (GlobalFeatureManager.Instance.IsEnabled()) { - b.ToTable(options.TablePrefix + "Tags", options.Schema); - - b.ConfigureByConvention(); - - b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength); - b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength); - - b.HasIndex(x => new { x.TenantId, x.Name }); - }); - + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Tags", options.Schema); + + b.ConfigureByConvention(); + + b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength); + b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength); + + b.HasIndex(x => new { x.TenantId, x.Name }); + }); + } + builder.Entity(b => { b.ToTable(options.TablePrefix + "EntityTags", options.Schema); - + b.ConfigureByConvention(); b.HasKey(x => new { x.EntityId, x.TagId }); - + b.Property(x => x.EntityId).IsRequired(); b.Property(x => x.TagId).IsRequired(); - + b.HasIndex(x => new { x.TenantId, x.EntityId, x.TagId }); }); - + builder.Entity(b => { b.ToTable(options.TablePrefix + "Pages", options.Schema); - + b.ConfigureByConvention(); - + b.Property(x => x.Title).IsRequired().HasMaxLength(PageConsts.MaxTitleLength); b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength); b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength); - + b.HasIndex(x => new { x.TenantId, x.Url }); }); } From 2192f20df593d8612ffff7a9ac9a5f31f4811420 Mon Sep 17 00:00:00 2001 From: Ilkay Ilknur Date: Wed, 6 Jan 2021 15:39:17 +0300 Subject: [PATCH 324/493] fix build break caused by conflict resolving. --- .../CmsKitDbContextModelCreatingExtensions.cs | 71 ++++++++++--------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs index 6a077b4f4d..5de45ed8b8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs @@ -41,8 +41,8 @@ namespace Volo.CmsKit.EntityFrameworkCore b.ConfigureByConvention(); b.ConfigureAbpUser(); - b.HasIndex(x => new { x.TenantId, x.UserName }); - b.HasIndex(x => new { x.TenantId, x.Email }); + b.HasIndex(x => new {x.TenantId, x.UserName}); + b.HasIndex(x => new {x.TenantId, x.Email}); }); } @@ -58,8 +58,8 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.EntityId).IsRequired().HasMaxLength(UserReactionConsts.MaxEntityIdLength); b.Property(x => x.ReactionName).IsRequired().HasMaxLength(UserReactionConsts.MaxReactionNameLength); - b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId, x.ReactionName }); - b.HasIndex(x => new { x.TenantId, x.CreatorId, x.EntityType, x.EntityId, x.ReactionName }); + b.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId, x.ReactionName}); + b.HasIndex(x => new {x.TenantId, x.CreatorId, x.EntityType, x.EntityId, x.ReactionName}); }); } @@ -76,8 +76,8 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.Text).IsRequired().HasMaxLength(CommentConsts.MaxTextLength); b.Property(x => x.RepliedCommentId); - b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); - b.HasIndex(x => new { x.TenantId, x.RepliedCommentId }); + b.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId}); + b.HasIndex(x => new {x.TenantId, x.RepliedCommentId}); }); } @@ -93,7 +93,7 @@ namespace Volo.CmsKit.EntityFrameworkCore r.Property(x => x.EntityType).IsRequired().HasMaxLength(RatingConsts.MaxEntityTypeLength); r.Property(x => x.EntityId).IsRequired().HasMaxLength(RatingConsts.MaxEntityIdLength); - r.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId, x.CreatorId }); + r.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId, x.CreatorId}); }); } @@ -109,49 +109,52 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength); b.Property(x => x.Value).IsRequired().HasMaxLength(ContentConsts.MaxValueLength); - b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); + b.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId}); }); } - builder.Entity(b => + if (GlobalFeatureManager.Instance.IsEnabled()) { - b.ToTable(options.TablePrefix + "Tags", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Tags", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength); - b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength); + b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength); + b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength); - b.HasIndex(x => new { x.TenantId, x.Name }); - }); + b.HasIndex(x => new {x.TenantId, x.Name}); + }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "EntityTags", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "EntityTags", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasKey(x => new { x.EntityId, x.TagId }); + b.HasKey(x => new {x.EntityId, x.TagId}); - b.Property(x => x.EntityId).IsRequired(); - b.Property(x => x.TagId).IsRequired(); + b.Property(x => x.EntityId).IsRequired(); + b.Property(x => x.TagId).IsRequired(); - b.HasIndex(x => new { x.TenantId, x.EntityId, x.TagId }); - }); + b.HasIndex(x => new {x.TenantId, x.EntityId, x.TagId}); + }); + } - builder.Entity(b => + if (GlobalFeatureManager.Instance.IsEnabled()) { - b.ToTable(options.TablePrefix + "Pages", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Pages", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.Property(x => x.Title).IsRequired().HasMaxLength(PageConsts.MaxTitleLength); - b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength); - b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength); + b.Property(x => x.Title).IsRequired().HasMaxLength(PageConsts.MaxTitleLength); + b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength); + b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength); - b.HasIndex(x => new { x.TenantId, x.Url }); - }); - b.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId}); + b.HasIndex(x => new {x.TenantId, x.Url}); }); } @@ -201,4 +204,4 @@ namespace Volo.CmsKit.EntityFrameworkCore } } } -} +} \ No newline at end of file From 80b7eea884d7f30c9eef3f7dc32d109742bb93e0 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 7 Jan 2021 13:39:40 +0800 Subject: [PATCH 325/493] Update [How to fix the Chrome login issue for the IdentityServer4] --- .../POST.md | 140 ++++-------------- 1 file changed, 27 insertions(+), 113 deletions(-) diff --git a/docs/en/Community-Articles/2020-08-12-Patch-Chrome-Login-Issue-For-IdentityServer4/POST.md b/docs/en/Community-Articles/2020-08-12-Patch-Chrome-Login-Issue-For-IdentityServer4/POST.md index 718a949f3a..d0d2b1ccee 100644 --- a/docs/en/Community-Articles/2020-08-12-Patch-Chrome-Login-Issue-For-IdentityServer4/POST.md +++ b/docs/en/Community-Articles/2020-08-12-Patch-Chrome-Login-Issue-For-IdentityServer4/POST.md @@ -11,157 +11,75 @@ When you use HTTP on your Identity Server 4 enabled website, users may not login Create the below extension in your ***.Web** project. ```csharp -using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.Extensions.DependencyInjection { public static class SameSiteCookiesServiceCollectionExtensions { - /// - /// -1 defines the unspecified value, which tells ASPNET Core to NOT - /// send the SameSite attribute. With ASPNET Core 3.1 the - /// enum will have a definition for - /// Unspecified. - /// - private const SameSiteMode Unspecified = (SameSiteMode)(-1); - - /// - /// Configures a cookie policy to properly set the SameSite attribute - /// for Browsers that handle unknown values as Strict. Ensure that you - /// add the - /// into the pipeline before sending any cookies! - /// - /// - /// Minimum ASPNET Core Version required for this code: - /// - 2.1.14 - /// - 2.2.8 - /// - 3.0.1 - /// - 3.1.0-preview1 - /// Starting with version 80 of Chrome (to be released in February 2020) - /// cookies with NO SameSite attribute are treated as SameSite=Lax. - /// In order to always get the cookies send they need to be set to - /// SameSite=None. But since the current standard only defines Lax and - /// Strict as valid values there are some browsers that treat invalid - /// values as SameSite=Strict. We therefore need to check the browser - /// and either send SameSite=None or prevent the sending of SameSite=None. - /// Relevant links: - /// - https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1 - /// - https://tools.ietf.org/html/draft-west-cookie-incrementalism-00 - /// - https://www.chromium.org/updates/same-site - /// - https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/ - /// - https://bugs.webkit.org/show_bug.cgi?id=198181 - /// - /// The service collection to register into. - /// The modified . - public static IServiceCollection ConfigureNonBreakingSameSiteCookies(this IServiceCollection services) + public static IServiceCollection AddSameSiteCookiePolicy(this IServiceCollection services) { services.Configure(options => { - options.MinimumSameSitePolicy = Unspecified; - options.OnAppendCookie = cookieContext => - CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); - options.OnDeleteCookie = cookieContext => - CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); + options.MinimumSameSitePolicy = SameSiteMode.Unspecified; + options.OnAppendCookie = cookieContext => + CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); + options.OnDeleteCookie = cookieContext => + CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); }); return services; } - + private static void CheckSameSite(HttpContext httpContext, CookieOptions options) { if (options.SameSite == SameSiteMode.None) { var userAgent = httpContext.Request.Headers["User-Agent"].ToString(); - - if (DisallowsSameSiteNone(userAgent)) + if (!httpContext.Request.IsHttps || DisallowsSameSiteNone(userAgent)) { - options.SameSite = Unspecified; + // For .NET Core < 3.1 set SameSite = (SameSiteMode)(-1) + options.SameSite = SameSiteMode.Unspecified; } } } - /// - /// Checks if the UserAgent is known to interpret an unknown value as Strict. - /// For those the property should be - /// set to . - /// - /// - /// This code is taken from Microsoft: - /// https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/ - /// - /// The user agent string to check. - /// Whether the specified user agent (browser) accepts SameSite=None or not. private static bool DisallowsSameSiteNone(string userAgent) { // Cover all iOS based browsers here. This includes: - // - Safari on iOS 12 for iPhone, iPod Touch, iPad - // - WkWebview on iOS 12 for iPhone, iPod Touch, iPad - // - Chrome on iOS 12 for iPhone, iPod Touch, iPad - // All of which are broken by SameSite=None, because they use the - // iOS networking stack. - // Notes from Thinktecture: - // Regarding https://caniuse.com/#search=samesite iOS versions lower - // than 12 are not supporting SameSite at all. Starting with version 13 - // unknown values are NOT treated as strict anymore. Therefore we only - // need to check version 12. - if (userAgent.Contains("CPU iPhone OS 12") - || userAgent.Contains("iPad; CPU OS 12")) + // - Safari on iOS 12 for iPhone, iPod Touch, iPad + // - WkWebview on iOS 12 for iPhone, iPod Touch, iPad + // - Chrome on iOS 12 for iPhone, iPod Touch, iPad + // All of which are broken by SameSite=None, because they use the iOS networking stack + if (userAgent.Contains("CPU iPhone OS 12") || userAgent.Contains("iPad; CPU OS 12")) { return true; } - // Cover Mac OS X based browsers that use the Mac OS networking stack. - // This includes: - // - Safari on Mac OS X. + // Cover Mac OS X based browsers that use the Mac OS networking stack. This includes: + // - Safari on Mac OS X. // This does not include: - // - Chrome on Mac OS X - // because they do not use the Mac OS networking stack. - // Notes from Thinktecture: - // Regarding https://caniuse.com/#search=samesite MacOS X versions lower - // than 10.14 are not supporting SameSite at all. Starting with version - // 10.15 unknown values are NOT treated as strict anymore. Therefore we - // only need to check version 10.14. - if (userAgent.Contains("Safari") - && userAgent.Contains("Macintosh; Intel Mac OS X 10_14") - && userAgent.Contains("Version/")) + // - Chrome on Mac OS X + // Because they do not use the Mac OS networking stack. + if (userAgent.Contains("Macintosh; Intel Mac OS X 10_14") && + userAgent.Contains("Version/") && userAgent.Contains("Safari")) { return true; } - // Cover Chrome 50-69, because some versions are broken by SameSite=None + // Cover Chrome 50-69, because some versions are broken by SameSite=None, // and none in this range require it. - // Note: this covers some pre-Chromium Edge versions, + // Note: this covers some pre-Chromium Edge versions, // but pre-Chromium Edge does not require SameSite=None. - // Notes from Thinktecture: - // We can not validate this assumption, but we trust Microsofts - // evaluation. And overall not sending a SameSite value equals to the same - // behavior as SameSite=None for these old versions anyways. if (userAgent.Contains("Chrome/5") || userAgent.Contains("Chrome/6")) { return true; } - - if (GetChromeVersion(userAgent) >= 80) - { - return true; - } return false; } - - private static int GetChromeVersion(string userAgent) - { - try - { - return Convert.ToInt32(userAgent.Split("Chrome/")[1].Split('.')[0]); - } - catch (Exception) - { - return 0; - } - } } } ``` @@ -173,7 +91,7 @@ Assume that your project name is *Acme.BookStore*. Then open `AcmeBookStoreWebMo Add the following line to `ConfigureServices()` method. ```csharp - context.Services.ConfigureNonBreakingSameSiteCookies(); + context.Services.AddSameSiteCookiePolicy(); // cookie policy to deal with temporary browser incompatibilities ``` ### Step-3 @@ -195,18 +113,14 @@ public override void OnApplicationInitialization(ApplicationInitializationContex app.UseHsts(); } - app.UseCookiePolicy(); //<--- added this ---> + app.UseCookiePolicy(); // added this, Before UseAuthentication or anything else that writes cookies. //.... } ``` - - It's all! You are ready to go! - - --- -Referenced from https://www.thinktecture.com/en/identity/samesite/prepare-your-identityserver/ +Referenced from https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/ From 79575ff040747def938f1670f4926afca5b0b988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 7 Jan 2021 09:55:00 +0300 Subject: [PATCH 326/493] #6853 Document improved. --- docs/en/UI/Blazor/Page-Progress.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/docs/en/UI/Blazor/Page-Progress.md b/docs/en/UI/Blazor/Page-Progress.md index 14daa41d3c..b1d5b0df12 100644 --- a/docs/en/UI/Blazor/Page-Progress.md +++ b/docs/en/UI/Blazor/Page-Progress.md @@ -1,30 +1,25 @@ # Blazor UI: Page Progress -Page progress is the newest component introduced with Blazorise and ABP Framework. It is used to show scoped page progress on top of the page and to indicate to the user that currently a long running process is in the work. By default you don't need to do anything to show the progress indicator, as all the work is done automatically by the ABP Framework internals. This means that all calls to the ABP backend(through Rest API) will activate page progress and show the loading indicator. +Page Progress is used to show a progress bar indicator on top of the page and to show to the user that currently a long running process is in the work. -This doesn't mean that you don't have the control over it. On the contrary. If you also want to show progress for your own processes, it is really easy to do. All you have to do is to use `IUiPageProgressService`. +By default you don't need to do anything to show the progress indicator, as all the work is done automatically by the ABP Framework internals. This means that all calls to the ABP backend (through your HTTP API) will activate page progress and show the loading indicator. -To use `IUiPageProgressService` you need to inject it into your own Blazor component or page. You have two options of injection. - -1. Parameter injection -2. Constructor injection - -Whichever you chose the end result is the same. In this guide we're going to use parameter injection. So let us begin. +This doesn't mean that you don't have the control over it. On the contrary, if you want to show progress for your own processes, it is really easy to do. All you have to do is to use inject and use the `IUiPageProgressService`. ## Example -First, inject the `IUiPageProgressService` +First, inject the `IUiPageProgressService` into your page/component. ```cs @inject IUiPageProgressService pageProgressService ``` -Next, all you have to do is invoke the `Go` method in `IUiPageProgressService`. It's that simple. +Next, invoke the `Go` method in `IUiPageProgressService`. It's that simple: ```cs Task OnClick() { - return pageProgressService.Go(null); + return pageProgressService.Go(null); } ``` @@ -53,7 +48,7 @@ pageProgressService.Go(25) 1. `null` - show _indeterminate_ indicator 2. `>= 0` and `<= 100` - show the regular _percentage_ progress -## Hiding progress +### Hiding progress To hide the progress just set the actual values to something other then the _Valid value_. From d49e39d588eeb295544df47ab984e6fbbdf1b327 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 7 Jan 2021 10:30:59 +0300 Subject: [PATCH 327/493] Update index.js --- .../src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js index 9216480c95..d3671e3758 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js @@ -55,6 +55,7 @@ service .removeFromCache(data.record.id) .then(function () { + abp.notify.success(l('RemovedFromCache')); dataTable.ajax.reload(); }); }, From 35940db969a88ced5659afd37319134b51de5511 Mon Sep 17 00:00:00 2001 From: EngincanV Date: Thu, 7 Jan 2021 11:15:25 +0300 Subject: [PATCH 328/493] Add missing community localizations --- .../Admin/Localization/Resources/en.json | 3 ++- .../Community/Localization/Resources/en.json | 20 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json index 32d3c16a01..f425e66079 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json @@ -197,6 +197,7 @@ "RemoveCache": "Remove Cache", "Language": "Language", "Optional": "Optional", - "CreateArticleLanguageInfo": "The language in which the article is written" + "CreateArticleLanguageInfo": "The language in which the article is written", + "Enum:ContentSource:2": "Video Post" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json index a92c20a991..8b5fa2014e 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json @@ -25,17 +25,16 @@ "MostRead": "Most Read", "Latest": "Latest", "ContributeAbpCommunity": "Contribute to the ABP Community", - "SubmitYourArticle": "Submit Your Article", + "SubmitYourArticle": "Submit Your Post", "ContributionGuide": "Contribution Guide", "BugReport": "Bug Report", - "SeeAllArticles": "See All Articles", + "SeeAllArticles": "See All Posts", "WelcomeToABPCommunity!": "Welcome to the ABP Community!", "MyProfile": "My profile", "MyOrganizations": "My organizations", "EmailNotValid": "Please enter a valid email address.", "FeatureRequest": "Feature Request", "CreateArticleTitleInfo": "Title of the article to be shown on the article list.", - "CreateArticleUrlInfo": "Original GitHub/External URL of the article.", "CreateArticleSummaryInfo": "A short summary of the article to be shown on the article list.", "CreateArticleCoverInfo": "For creating an effective article, add a cover photo. Upload 16:9 aspect ratio pictures for the best view. Maximum file size: 1MB.", "ThisExtensionIsNotAllowed": "This extension is not allowed.", @@ -87,7 +86,7 @@ "PlannedReleaseDate": "Planned release date", "CommunityArticleRequestErrorMessage": "Could not get the latest article request from Github.", "ArticleRequestFromGithubIssue": "There are not any article requests now.", - "LatestArticles": "Latest Articles", + "LatestArticles": "Latest Posts", "ArticleRequests": "Article Requests", "AllArticleRequests": "See All Article Requests", "SubscribeToTheNewsletter": "Subscribe to the Newsletter", @@ -101,6 +100,17 @@ "ArticleRequestMessageTitle": "Open an issue on the GitHub to request an article/tutorial you want to see on this web site.", "ArticleRequestMessageBody": "Here, the list of the requested articles by the community. Do you want to write a requested article? Please click to the request and join to the discussion.", "Language": "Language", - "CreateArticleLanguageInfo": "The language in which the article is written" + "CreateArticleLanguageInfo": "The language in which the article is written", + "VideoPost": "Video Post", + "Article": "Article", + "Read": "Read", + "CreateGithubArticleUrlInfo": "Original GitHub URL of the article.", + "CreateVideoContentUrlInfo": "Original Youtube URL of the article.", + "CreateExternalArticleUrlInfo": "Original External Url of the article.", + "VideoContentForm": "Video Content Form", + "GithubPostForm": "Github Post Form", + "ExternalPostForm": "External Post Form", + "PostSourceTypeChooses": "We accept three source types for the posts;", + "Posts": "Posts" } } From 0adc4afb5cb23e1bc86536b8945f73b4a1558121 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 7 Jan 2021 16:55:45 +0800 Subject: [PATCH 329/493] Set DispatchConsumersAsync to true --- .../Volo/Abp/RabbitMQ/ConnectionPool.cs | 5 ++-- .../Volo/Abp/RabbitMQ/RabbitMqConnections.cs | 6 ++--- .../Abp/RabbitMQ/RabbitMqMessageConsumer.cs | 23 ++++++++----------- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/ConnectionPool.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/ConnectionPool.cs index 08d9d48036..5856f7bb16 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/ConnectionPool.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/ConnectionPool.cs @@ -22,8 +22,7 @@ namespace Volo.Abp.RabbitMQ public virtual IConnection Get(string connectionName = null) { - connectionName = connectionName - ?? RabbitMqConnections.DefaultConnectionName; + connectionName ??= RabbitMqConnections.DefaultConnectionName; return Connections.GetOrAdd( connectionName, @@ -58,4 +57,4 @@ namespace Volo.Abp.RabbitMQ Connections.Clear(); } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConnections.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConnections.cs index a30db4c96a..f2b5168d82 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConnections.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConnections.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.RabbitMQ public class RabbitMqConnections : Dictionary { public const string DefaultConnectionName = "Default"; - + [NotNull] public ConnectionFactory Default { @@ -19,7 +19,7 @@ namespace Volo.Abp.RabbitMQ public RabbitMqConnections() { - Default = new ConnectionFactory(); + Default = new ConnectionFactory() { DispatchConsumersAsync = true }; } public ConnectionFactory GetOrDefault(string connectionName) @@ -32,4 +32,4 @@ namespace Volo.Abp.RabbitMQ return Default; } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs index fb1b0c7fe2..b94663d886 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs @@ -143,10 +143,10 @@ namespace Volo.Abp.RabbitMQ try { - var channel = ConnectionPool + Channel = ConnectionPool .Get(ConnectionName) .CreateModel(); - channel.ExchangeDeclare( + Channel.ExchangeDeclare( exchange: Exchange.ExchangeName, type: Exchange.Type, durable: Exchange.Durable, @@ -154,7 +154,7 @@ namespace Volo.Abp.RabbitMQ arguments: Exchange.Arguments ); - channel.QueueDeclare( + Channel.QueueDeclare( queue: Queue.QueueName, durable: Queue.Durable, exclusive: Queue.Exclusive, @@ -162,19 +162,14 @@ namespace Volo.Abp.RabbitMQ arguments: Queue.Arguments ); - var consumer = new EventingBasicConsumer(channel); - consumer.Received += async (model, basicDeliverEventArgs) => - { - await HandleIncomingMessageAsync(channel, basicDeliverEventArgs); - }; + var consumer = new AsyncEventingBasicConsumer(Channel); + consumer.Received += HandleIncomingMessageAsync; - channel.BasicConsume( + Channel.BasicConsume( queue: Queue.QueueName, autoAck: false, consumer: consumer ); - - Channel = channel; } catch (Exception ex) { @@ -183,16 +178,16 @@ namespace Volo.Abp.RabbitMQ } } - protected virtual async Task HandleIncomingMessageAsync(IModel channel, BasicDeliverEventArgs basicDeliverEventArgs) + protected virtual async Task HandleIncomingMessageAsync(object sender, BasicDeliverEventArgs basicDeliverEventArgs) { try { foreach (var callback in Callbacks) { - await callback(channel, basicDeliverEventArgs); + await callback(Channel, basicDeliverEventArgs); } - channel.BasicAck(basicDeliverEventArgs.DeliveryTag, multiple: false); + Channel.BasicAck(basicDeliverEventArgs.DeliveryTag, multiple: false); } catch (Exception ex) { From 71e3b1ac4f7ca161cb27b4579288dba388a66c4f Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Thu, 7 Jan 2021 11:58:46 +0300 Subject: [PATCH 330/493] Update en.json --- .../AbpIoLocalization/Admin/Localization/Resources/en.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json index f425e66079..c190a91470 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json @@ -197,7 +197,7 @@ "RemoveCache": "Remove Cache", "Language": "Language", "Optional": "Optional", - "CreateArticleLanguageInfo": "The language in which the article is written", + "CreateArticleLanguageInfo": "The language in which the post is written", "Enum:ContentSource:2": "Video Post" } -} \ No newline at end of file +} From ede633eb4ba885971d165675f27765036f52acf6 Mon Sep 17 00:00:00 2001 From: Ahmet Date: Thu, 7 Jan 2021 12:27:58 +0300 Subject: [PATCH 331/493] refactoring --- .../Admin/Pages/IPageAdminAppService.cs | 2 -- .../CmsKit/Admin/Pages/PageAdminAppService.cs | 7 +----- .../CmsKit/Admin/Pages/PageAdminController.cs | 7 ------ .../Volo/CmsKit/CmsKitErrorCodes.cs | 5 ++++ .../CmsKit/Localization/Resources/en.json | 3 ++- .../CmsKit/Localization/Resources/tr.json | 3 ++- .../Pages/PageUrlAlreadyExistException.cs | 24 +++++++++++++++++++ .../Pages/PageAdminAppService_Tests.cs | 22 ++++------------- 8 files changed, 38 insertions(+), 35 deletions(-) create mode 100644 modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/IPageAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/IPageAdminAppService.cs index 395ce263a3..41f5b57a59 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/IPageAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/IPageAdminAppService.cs @@ -7,8 +7,6 @@ namespace Volo.CmsKit.Admin.Pages { public interface IPageAdminAppService : ICrudAppService { - Task ExistsAsync(string url); - Task SetImageAsync(Guid id, RemoteStreamContent content); Task GetImageAsync(Guid id); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs index cbe8310ca5..f46678044f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs @@ -104,11 +104,6 @@ namespace Volo.CmsKit.Admin.Pages return ObjectMapper.Map(page); } - public virtual Task ExistsAsync(string url) - { - return PageRepository.ExistsAsync(url); - } - [Authorize(CmsKitAdminPermissions.Pages.Update)] public virtual async Task SetImageAsync(Guid id, RemoteStreamContent content) { @@ -135,7 +130,7 @@ namespace Volo.CmsKit.Admin.Pages { if (await PageRepository.ExistsAsync(url)) { - throw new UserFriendlyException("Url exist"); + throw new PageUrlAlreadyExistException(url); } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Pages/PageAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Pages/PageAdminController.cs index 60a5d86584..7cc77c74d8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Pages/PageAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Pages/PageAdminController.cs @@ -62,13 +62,6 @@ namespace Volo.CmsKit.Admin.Pages return PageAdminAppService.DeleteAsync(id); } - [HttpGet] - [Route("exists/{url}")] - public virtual Task ExistsAsync(string url) - { - return PageAdminAppService.ExistsAsync(url); - } - [HttpPost] [Authorize(CmsKitAdminPermissions.Pages.Update)] [Route("image/{id}")] diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitErrorCodes.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitErrorCodes.cs index 76ba39c3f2..aad26ab948 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitErrorCodes.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitErrorCodes.cs @@ -3,5 +3,10 @@ public static class CmsKitErrorCodes { public const string TagAlreadyExist = "CmsKit:0001"; + + public static class Pages + { + public const string UrlAlreadyExist = "CmsKit:Page:0001"; + } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json index 9965b901e7..1c2c9a1bfa 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json @@ -28,6 +28,7 @@ "Undo": "Undo", "Update": "Update", "YourComment": "Your comment", - "YourReply": "Your reply" + "YourReply": "Your reply", + "CmsKit:Page:0001": "The given url ({0}) is already exist." } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json index ac8bd98a9f..a9d512e522 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json @@ -24,6 +24,7 @@ "Undo": "Geri al", "Update": "Güncelle", "YourComment": "Yorumunuz", - "YourReply": "Cevabınız" + "YourReply": "Cevabınız", + "CmsKit:Page:0001": "Girilen url ({0}) kullanımdadır." } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs new file mode 100644 index 0000000000..683ae535d6 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; +using JetBrains.Annotations; +using Volo.Abp; +using Volo.CmsKit.Tags; + +namespace Volo.CmsKit.Pages +{ + [Serializable] + public class PageUrlAlreadyExistException : BusinessException + { + public PageUrlAlreadyExistException([NotNull] string url) + { + Code = CmsKitErrorCodes.Pages.UrlAlreadyExist; + WithData(nameof(Page.Url), url); + } + + public PageUrlAlreadyExistException(SerializationInfo serializationInfo, StreamingContext context) + : base(serializationInfo, context) + { + + } + } +} \ No newline at end of file diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs index 64b46ae998..36381ad461 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs @@ -87,7 +87,9 @@ namespace Volo.CmsKit.Pages Content = "test-content" }; - await Should.ThrowAsync(async () => await _pageAdminAppService.CreateAsync(dto)); + var exception = await Should.ThrowAsync(async () => await _pageAdminAppService.CreateAsync(dto)); + + exception.Code.ShouldBe(CmsKitErrorCodes.Pages.UrlAlreadyExist); } [Fact] @@ -119,7 +121,7 @@ namespace Volo.CmsKit.Pages Content = "my-test-content" }; - await Should.ThrowAsync(async () => await _pageAdminAppService.CreateAsync(dto)); + await Should.ThrowAsync(async () => await _pageAdminAppService.CreateAsync(dto)); } [Fact] @@ -161,22 +163,6 @@ namespace Volo.CmsKit.Pages await Should.ThrowAsync(async () => await _pageAdminAppService.UpdateAsync(_data.Page_1_Id, dto)); } - [Fact] - public async Task ShouldBeExistAsync() - { - var doesExist = await _pageAdminAppService.ExistsAsync(_data.Page_1_Url); - - doesExist.ShouldBeTrue(); - } - - [Fact] - public async Task ShouldNotBeExistAsync() - { - var doesExist = await _pageAdminAppService.ExistsAsync(_data.Page_1_Url+ "+"); - - doesExist.ShouldBeFalse(); - } - [Fact] public async Task ShouldDeleteAsync() { From 706585df59bf3dd9f6cc040d45e6d14d5fd5d974 Mon Sep 17 00:00:00 2001 From: Ahmet Date: Thu, 7 Jan 2021 12:33:09 +0300 Subject: [PATCH 332/493] refactor --- .../Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs | 1 - .../Pages/PageAdminAppService_Tests.cs | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs index 683ae535d6..142d03c441 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs @@ -2,7 +2,6 @@ using System.Runtime.Serialization; using JetBrains.Annotations; using Volo.Abp; -using Volo.CmsKit.Tags; namespace Volo.CmsKit.Pages { diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs index 36381ad461..34cf18fec2 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs @@ -121,7 +121,9 @@ namespace Volo.CmsKit.Pages Content = "my-test-content" }; - await Should.ThrowAsync(async () => await _pageAdminAppService.CreateAsync(dto)); + var exception = await Should.ThrowAsync(async () => await _pageAdminAppService.CreateAsync(dto)); + + exception.Code.ShouldBe(CmsKitErrorCodes.Pages.UrlAlreadyExist); } [Fact] From 312e6f220762e06bd1d996cc9f562d90365ad31f Mon Sep 17 00:00:00 2001 From: Berkan Date: Thu, 7 Jan 2021 15:02:10 +0300 Subject: [PATCH 333/493] Added missing localization for Volo.AbpIo.Web.Common. --- .../AbpIoLocalization/Www/Localization/Resources/ar.json | 3 ++- .../AbpIoLocalization/Www/Localization/Resources/de-DE.json | 3 ++- .../AbpIoLocalization/Www/Localization/Resources/en-GB.json | 3 ++- .../AbpIoLocalization/Www/Localization/Resources/en.json | 3 ++- .../AbpIoLocalization/Www/Localization/Resources/es.json | 3 ++- .../AbpIoLocalization/Www/Localization/Resources/pt-BR.json | 3 ++- .../AbpIoLocalization/Www/Localization/Resources/tr.json | 3 ++- .../AbpIoLocalization/Www/Localization/Resources/zh-Hans.json | 3 ++- .../AbpIoLocalization/Www/Localization/Resources/zh-Hant.json | 3 ++- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/ar.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/ar.json index a5d83f9807..3160dd45b4 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/ar.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/ar.json @@ -156,6 +156,7 @@ "UiFramework": "إطار عمل واجهة المستخدم", "EmailAddress": "البريد الإلكترونى", "Mobile": "المحمول", - "ReactNative": "React Native" + "ReactNative": "React Native", + "SelectLanguage": "اختار اللغة" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/de-DE.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/de-DE.json index 6f9f0726cf..523247a7b6 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/de-DE.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/de-DE.json @@ -184,6 +184,7 @@ "ABPCLIExamplesInfo": "Der Befehl new erstellt eine mehrschichtige MVC-Anwendung mit Entity Framework Core als Datenbankanbieter. Es gibt jedoch zusätzliche Optionen. Beispiele:", "SeeCliDocumentForMoreInformation": "Weitere Optionen finden Sie im ABP CLI-Dokument oder wählen Sie oben die Registerkarte \"Direkter Download\".", "Optional": "Optional", - "LocalFrameworkRef": "Behalten Sie die lokale Projektreferenz für die Framework-Pakete bei." + "LocalFrameworkRef": "Behalten Sie die lokale Projektreferenz für die Framework-Pakete bei.", + "SelectLanguage": "Sprache auswählen" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en-GB.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en-GB.json index 2b8978af21..cd0592524d 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en-GB.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en-GB.json @@ -192,6 +192,7 @@ "MultipleUIOptions": "Multiple UI Options", "MultipleDBOptions": "Multiple Database Providers", "MultipleUIOptionsExplanation": "The core framework is designed as UI independent and can work with any type of UI system, while there are multiple pre-built and integrated options are provided out of the box.", - "MultipleDBOptionsExplanation": "The framework can work with any data source, while the following providers are officially developed and supported:" + "MultipleDBOptionsExplanation": "The framework can work with any data source, while the following providers are officially developed and supported:", + "SelectLanguage": "Select language" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json index e1dd405851..bdc7364788 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json @@ -192,6 +192,7 @@ "MultipleUIOptions": "Multiple UI Options", "MultipleDBOptions": "Multiple Database Providers", "MultipleUIOptionsExplanation": "The core framework is designed as UI independent and can work with any type of UI system, while there are multiple pre-built and integrated options are provided out of the box.", - "MultipleDBOptionsExplanation": "The framework can work with any data source, while the following providers are officially developed and supported;" + "MultipleDBOptionsExplanation": "The framework can work with any data source, while the following providers are officially developed and supported;", + "SelectLanguage": "Select language" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/es.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/es.json index 3c36634f56..06d197d82e 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/es.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/es.json @@ -184,6 +184,7 @@ "ABPCLIExamplesInfo": "nuevo comando crea una aplicación MVC por capas con Entity Framework Core como proveedor de base de datos. Sin embargo, tiene distintas opciones. Ejemplos:", "SeeCliDocumentForMoreInformation": "Ver el documento ABP CLI para más opciones o selecciona la \"Direct Download\" pestaña de arriba.", "Optional": "Opcional", - "LocalFrameworkRef": "Mantén la referencia al proyecto local para los paquetes del framework." + "LocalFrameworkRef": "Mantén la referencia al proyecto local para los paquetes del framework.", + "SelectLanguage": "Vali keel" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/pt-BR.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/pt-BR.json index 34debb8ec8..3dfd773204 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/pt-BR.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/pt-BR.json @@ -154,6 +154,7 @@ "SeeTheDocumentForMoreInformation": "Consulte o {0} documento para obter mais informações", "IndexPageHeroSection": "código abertoAplicativo da Web
Framework
para o ASP.NET Core", "UiFramework": "UI Framework", - "EmailAddress": "Endereço de email" + "EmailAddress": "Endereço de email", + "SelectLanguage": "Selecione o idioma" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json index 5f423e940b..ef4ecbdcac 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json @@ -156,6 +156,7 @@ "UiFramework": "UI Framework", "EmailAddress": "E-Posta Adresi", "Mobile": "Mobil", - "ReactNative": "React Native" + "ReactNative": "React Native", + "SelectLanguage": "Dil seçin" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json index 6e9d9bf0da..caf52554d1 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json @@ -191,6 +191,7 @@ "TextTemplatingExplanation": "文本模板是基于模板和模型(数据对象)使用动态渲染内容. 例如你可以使用预构建的模板来创建动态的电子邮件内容.", "MultipleUIOptions": "多个UI选项", "MultipleDBOptions": "多个数据库提供程序", - "MultipleUIOptionsExplanation": "核心框架设计为独立与UI,可以和任何类型的UI系统一起使用. 同时提供了多个开箱即用的预构建集成选项." + "MultipleUIOptionsExplanation": "核心框架设计为独立与UI,可以和任何类型的UI系统一起使用. 同时提供了多个开箱即用的预构建集成选项.", + "SelectLanguage": "選擇語言" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hant.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hant.json index 777c9f6bbd..37f6747ea0 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hant.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hant.json @@ -154,6 +154,7 @@ "SeeTheDocumentForMoreInformation": "查看{0} 文件獲得更多訊息", "IndexPageHeroSection": "asp.net core的開源Web應用程式
框架
", "UiFramework": "UI框架", - "EmailAddress": "電子信箱地址" + "EmailAddress": "電子信箱地址", + "SelectLanguage": "选择语言" } } \ No newline at end of file From a75b26cc30fd4b7da385121e31994efb388bdf76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 7 Jan 2021 15:08:05 +0300 Subject: [PATCH 334/493] Add more claims to the access token. --- .../Abp/IdentityServer/AbpClaimsService.cs | 28 +++++++++++++++---- .../AbpResourceOwnerPasswordValidator.cs | 7 ++++- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpClaimsService.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpClaimsService.cs index c60c241209..3e6a7c76b2 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpClaimsService.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpClaimsService.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; +using IdentityModel; using IdentityServer4.Services; using Microsoft.Extensions.Logging; using Volo.Abp.Security.Claims; @@ -9,6 +10,16 @@ namespace Volo.Abp.IdentityServer { public class AbpClaimsService : DefaultClaimsService { + private static readonly string[] AdditionalOptionalClaimNames = + { + AbpClaimTypes.TenantId, + AbpClaimTypes.Name, + AbpClaimTypes.SurName, + JwtClaimTypes.PreferredUserName, + JwtClaimTypes.GivenName, + JwtClaimTypes.FamilyName, + }; + public AbpClaimsService(IProfileService profile, ILogger logger) : base(profile, logger) { @@ -16,13 +27,20 @@ namespace Volo.Abp.IdentityServer protected override IEnumerable GetOptionalClaims(ClaimsPrincipal subject) { - var tenantClaim = subject.FindFirst(AbpClaimTypes.TenantId); - if (tenantClaim == null) + return base.GetOptionalClaims(subject) + .Union(GetAdditionalOptionalClaims(subject)); + } + + protected virtual IEnumerable GetAdditionalOptionalClaims(ClaimsPrincipal subject) + { + foreach (var claimName in AdditionalOptionalClaimNames) { - return base.GetOptionalClaims(subject); + var claim = subject.FindFirst(claimName); + if (claim != null) + { + yield return claim; + } } - - return base.GetOptionalClaims(subject).Union(new[] { tenantClaim }); } } } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs index eee4c001ed..e024976548 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs @@ -200,7 +200,12 @@ namespace Volo.Abp.IdentityServer.AspNetIdentity { if (user.TenantId.HasValue) { - customClaims.Add(new Claim(AbpClaimTypes.TenantId, user.TenantId?.ToString())); + customClaims.Add( + new Claim( + AbpClaimTypes.TenantId, + user.TenantId?.ToString() + ) + ); } return Task.CompletedTask; From 0f786308893ebb8bccdd5e4875d508f6f7ca476c Mon Sep 17 00:00:00 2001 From: enisn Date: Thu, 7 Jan 2021 15:21:53 +0300 Subject: [PATCH 335/493] Fix syntax error at CmsKitDbContextModelCreatingExtensions --- .../CmsKitDbContextModelCreatingExtensions.cs | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs index d089a8fe9d..8e3b7160db 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs @@ -99,16 +99,19 @@ namespace Volo.CmsKit.EntityFrameworkCore if (GlobalFeatureManager.Instance.IsEnabled()) { - b.ToTable(options.TablePrefix + "Contents", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Contents", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.Property(x => x.EntityType).IsRequired().HasMaxLength(ContentConsts.MaxEntityTypeLength); - b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength); - b.Property(x => x.Value).IsRequired().HasMaxLength(ContentConsts.MaxValueLength); + b.Property(x => x.EntityType).IsRequired().HasMaxLength(ContentConsts.MaxEntityTypeLength); + b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength); + b.Property(x => x.Value).IsRequired().HasMaxLength(ContentConsts.MaxValueLength); - b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); - }); + b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); + }); + } if (GlobalFeatureManager.Instance.IsEnabled()) { @@ -121,7 +124,11 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength); b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength); - b.HasIndex(x => new { x.TenantId, x.Name }); + b.HasIndex(x => new + { + x.TenantId, + x.Name + }); }); builder.Entity(b => @@ -151,7 +158,7 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength); b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength); - b.HasIndex(x => new {x.TenantId, x.Url}); + b.HasIndex(x => new { x.TenantId, x.Url }); }); } } From b079f0b3a9e74134ee204ca3da8eea90aeb4e398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 7 Jan 2021 15:39:35 +0300 Subject: [PATCH 336/493] Map claims. --- .../Volo/Abp/AspNetCore/Security/Claims/AbpClaimsMapOptions.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpClaimsMapOptions.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpClaimsMapOptions.cs index 18f332f757..5dee4b118d 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpClaimsMapOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpClaimsMapOptions.cs @@ -15,6 +15,9 @@ namespace Volo.Abp.AspNetCore.Security.Claims { "sub", () => AbpClaimTypes.UserId }, { "role", () => AbpClaimTypes.Role }, { "email", () => AbpClaimTypes.Email }, + { "name", () => AbpClaimTypes.UserName }, + { "family_name", () => AbpClaimTypes.SurName }, + { "given_name", () => AbpClaimTypes.Name } }; } } From daadc2a5690a1e8b7e3435c4294e50aa6eea01b0 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 7 Jan 2021 16:53:31 +0300 Subject: [PATCH 337/493] CLI public web site option --- .../Volo/Abp/Cli/Commands/NewCommand.cs | 12 ++++ .../Services/SourceCodeDownloadService.cs | 1 + .../Steps/ChangeDbMigratorPublicPortStep.cs | 15 +++++ .../Steps/ChangePublicAuthPortStep.cs | 15 +++++ .../Building/Steps/RemoveCmsKitStep.cs | 24 +++++++ .../RemoveEfCoreDependencyFromPublicStep.cs | 14 ++++ .../Steps/RemoveGlobalFeaturesPackageStep.cs | 14 ++++ .../Building/Steps/RemovePublicRedisStep.cs | 17 +++++ .../Building/Steps/TemplateCodeDeleteStep.cs | 4 +- .../TemplateProjectBuildPipelineBuilder.cs | 7 +- .../Files/FileEntryExtensions.cs | 6 +- .../Cli/ProjectBuilding/ProjectBuildArgs.cs | 4 ++ .../Templates/App/AppTemplateBase.cs | 64 +++++++++++++++++++ .../Templates/RemoveUnnecessaryPortsStep.cs | 34 +++++++++- 14 files changed, 220 insertions(+), 11 deletions(-) create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeDbMigratorPublicPortStep.cs create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangePublicAuthPortStep.cs create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveCmsKitStep.cs create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveEfCoreDependencyFromPublicStep.cs create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveGlobalFeaturesPackageStep.cs create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemovePublicRedisStep.cs diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index c4942d04ab..d9621e5f91 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs @@ -107,6 +107,12 @@ namespace Volo.Abp.Cli.Commands Logger.LogInformation("UI Framework: " + uiFramework); } + var publicWebSite = uiFramework != UiFramework.None && commandLineArgs.Options.ContainsKey(Options.PublicWebSite.Long); + if (publicWebSite) + { + Logger.LogInformation("Public Web Site: yes"); + } + var mobileApp = GetMobilePreference(commandLineArgs); if (mobileApp != MobileApp.None) { @@ -168,6 +174,7 @@ namespace Volo.Abp.Cli.Commands databaseManagementSystem, uiFramework, mobileApp, + publicWebSite, gitHubAbpLocalRepositoryPath, gitHubVoloLocalRepositoryPath, templateSource, @@ -489,6 +496,11 @@ namespace Volo.Abp.Cli.Commands public const string Long = "mobile"; } + public static class PublicWebSite + { + public const string Long = "with-public-website"; + } + public static class TemplateSource { public const string Short = "ts"; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs index 28f41e55d8..6306619e56 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs @@ -40,6 +40,7 @@ namespace Volo.Abp.Cli.Commands.Services DatabaseManagementSystem.NotSpecified, UiFramework.NotSpecified, null, + false, gitHubAbpLocalRepositoryPath, gitHubVoloLocalRepositoryPath, null, diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeDbMigratorPublicPortStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeDbMigratorPublicPortStep.cs new file mode 100644 index 0000000000..72e05b74b0 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeDbMigratorPublicPortStep.cs @@ -0,0 +1,15 @@ +using System.Linq; + +namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps +{ + public class ChangeDbMigratorPublicPortStep: ProjectBuildPipelineStep + { + public override void Execute(ProjectBuildContext context) + { + var dbMigratorAppSettings = context.Files + .FirstOrDefault(f => f.Name.Contains("MyCompanyName.MyProjectName.DbMigrator") && f.Name.EndsWith("appsettings.json")); + + dbMigratorAppSettings?.SetContent(dbMigratorAppSettings.Content.Replace("localhost:44304","localhost:44306")); + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangePublicAuthPortStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangePublicAuthPortStep.cs new file mode 100644 index 0000000000..0d33b16309 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangePublicAuthPortStep.cs @@ -0,0 +1,15 @@ +using System.Linq; + +namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps +{ + public class ChangePublicAuthPortStep: ProjectBuildPipelineStep + { + public override void Execute(ProjectBuildContext context) + { + var publicAppSettings = context.Files + .FirstOrDefault(f => f.Name.Contains("MyCompanyName.MyProjectName.Web.Public") && f.Name.EndsWith("appsettings.json")); + + publicAppSettings?.SetContent(publicAppSettings.Content.Replace("localhost:44303","localhost:44305")); + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveCmsKitStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveCmsKitStep.cs new file mode 100644 index 0000000000..4f63d377ea --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveCmsKitStep.cs @@ -0,0 +1,24 @@ +using System.Linq; +using Volo.Abp.Cli.ProjectBuilding.Files; + +namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps +{ + public class RemoveCmsKitStep : ProjectBuildPipelineStep + { + public override void Execute(ProjectBuildContext context) + { + var commonFiles = context.Files.Where(f => + f.Name.EndsWith(".csproj") || + f.Name.EndsWith("Module.cs") || + f.Name.EndsWith("MyProjectNameMigrationsDbContext.cs") || + f.Name.EndsWith("MyProjectNameGlobalFeatureConfigurator.cs") || + (f.Name.EndsWith(".cshtml") && f.Name.Contains("MyCompanyName.MyProjectName.Web.Public")) + ); + + foreach (var file in commonFiles) + { + file.RemoveTemplateCodeIfNot("CMS-KIT"); + } + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveEfCoreDependencyFromPublicStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveEfCoreDependencyFromPublicStep.cs new file mode 100644 index 0000000000..f9e906c902 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveEfCoreDependencyFromPublicStep.cs @@ -0,0 +1,14 @@ +using System.Linq; +using Volo.Abp.Cli.ProjectBuilding.Files; + +namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps +{ + public class RemoveEfCoreDependencyFromPublicStep : ProjectBuildPipelineStep + { + public override void Execute(ProjectBuildContext context) + { + context.Files.FirstOrDefault(f => f.Name.EndsWith("MyCompanyName.MyProjectName.Web.Public.csproj"))?.RemoveTemplateCodeIfNot("EFCORE"); + context.Files.FirstOrDefault(f => f.Name.EndsWith("MyProjectNameWebPublicModule.cs"))?.RemoveTemplateCodeIfNot("EFCORE"); + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveGlobalFeaturesPackageStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveGlobalFeaturesPackageStep.cs new file mode 100644 index 0000000000..06fd565353 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveGlobalFeaturesPackageStep.cs @@ -0,0 +1,14 @@ +using System.Linq; +using Volo.Abp.Cli.ProjectBuilding.Files; + +namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps +{ + public class RemoveGlobalFeaturesPackageStep : ProjectBuildPipelineStep + { + public override void Execute(ProjectBuildContext context) + { + context.Files.FirstOrDefault(f => f.Name.EndsWith("MyCompanyName.MyProjectName.Domain.Shared.csproj"))?.RemoveTemplateCodeIf("CMS-KIT"); + context.Files.FirstOrDefault(f => f.Name.EndsWith("MyProjectNameDomainSharedModule.cs"))?.RemoveTemplateCodeIf("CMS-KIT"); + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemovePublicRedisStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemovePublicRedisStep.cs new file mode 100644 index 0000000000..94056cbf5a --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemovePublicRedisStep.cs @@ -0,0 +1,17 @@ +using System.Linq; +using Volo.Abp.Cli.ProjectBuilding.Files; + +namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps +{ + public class RemovePublicRedisStep : ProjectBuildPipelineStep + { + public override void Execute(ProjectBuildContext context) + { + context.Files.FirstOrDefault(f => f.Name.EndsWith("MyCompanyName.MyProjectName.Web.csproj"))?.RemoveTemplateCodeIfNot("PUBLIC-REDIS"); + context.Files.FirstOrDefault(f => f.Name.EndsWith("MyProjectNameWebModule.cs"))?.RemoveTemplateCodeIfNot("PUBLIC-REDIS"); + context.Files.FirstOrDefault(f => f.Name.EndsWith("MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj"))?.RemoveTemplateCodeIfNot("PUBLIC-REDIS"); + context.Files.FirstOrDefault(f => f.Name.EndsWith("MyCompanyName.MyProjectName.HttpApi.Host.csproj"))?.RemoveTemplateCodeIfNot("PUBLIC-REDIS"); + context.Files.FirstOrDefault(f => f.Name.EndsWith("MyProjectNameHttpApiHostModule.cs"))?.RemoveTemplateCodeIfNot("PUBLIC-REDIS"); + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/TemplateCodeDeleteStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/TemplateCodeDeleteStep.cs index e673446d9f..8942103873 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/TemplateCodeDeleteStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/TemplateCodeDeleteStep.cs @@ -8,7 +8,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps { foreach (var file in context.Files) { - if (file.Name.EndsWith(".cs")) //TODO: Why only cs! + if (file.Name.EndsWith(".cs") || file.Name.EndsWith(".csproj") || file.Name.EndsWith(".cshtml")) { file.RemoveTemplateCode(); file.RemoveTemplateCodeMarkers(); @@ -16,4 +16,4 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps } } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs index 513c2b4198..31c8f216b4 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs @@ -1,5 +1,4 @@ -using System; -using Volo.Abp.Cli.ProjectBuilding.Building.Steps; +using Volo.Abp.Cli.ProjectBuilding.Building.Steps; using Volo.Abp.Cli.ProjectBuilding.Templates.App; using Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule; @@ -28,13 +27,13 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building if (context.Template.Name == AppProTemplate.TemplateName || context.Template.Name == ModuleProTemplate.TemplateName) { - pipeline.Steps.Add(new LicenseCodeReplaceStep()); + pipeline.Steps.Add(new LicenseCodeReplaceStep()); // todo: move to custom steps? } if (context.Template.Name == AppTemplate.TemplateName || context.Template.Name == AppProTemplate.TemplateName) { - pipeline.Steps.Add(new DatabaseManagementSystemChangeStep()); + pipeline.Steps.Add(new DatabaseManagementSystemChangeStep()); // todo: move to custom steps? } if ((context.BuildArgs.UiFramework == UiFramework.Mvc || context.BuildArgs.UiFramework == UiFramework.Blazor) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs index 900948ce9c..91180206bf 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs @@ -15,7 +15,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Files { RemoveMarkedTemplateCode(file, ""); } - + public static void RemoveTemplateCodeIf(this FileEntry file, string condition) { RemoveByCondition(file, "IF", condition); @@ -68,7 +68,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Files { if (lines[i].Contains(beginMark)) { - while (!lines[i].Contains("") && i < lines.Length) + while (i < lines.Length && !lines[i].Contains("")) { ++i; } @@ -85,4 +85,4 @@ namespace Volo.Abp.Cli.ProjectBuilding.Files file.SetLines(newLines); } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs index 1022f5f10e..71ccf96f7a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs @@ -23,6 +23,8 @@ namespace Volo.Abp.Cli.ProjectBuilding public MobileApp? MobileApp { get; set; } + public bool PublicWebSite { get; set; } + [CanBeNull] public string AbpGitHubLocalRepositoryPath { get; set; } @@ -46,6 +48,7 @@ namespace Volo.Abp.Cli.ProjectBuilding DatabaseManagementSystem databaseManagementSystem = DatabaseManagementSystem.NotSpecified, UiFramework uiFramework = UiFramework.NotSpecified, MobileApp? mobileApp = null, + bool publicWebSite = false, [CanBeNull] string abpGitHubLocalRepositoryPath = null, [CanBeNull] string voloGitHubLocalRepositoryPath = null, [CanBeNull] string templateSource = null, @@ -59,6 +62,7 @@ namespace Volo.Abp.Cli.ProjectBuilding DatabaseManagementSystem = databaseManagementSystem; UiFramework = uiFramework; MobileApp = mobileApp; + PublicWebSite = publicWebSite; AbpGitHubLocalRepositoryPath = abpGitHubLocalRepositoryPath; VoloGitHubLocalRepositoryPath = voloGitHubLocalRepositoryPath; TemplateSource = templateSource; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs index b5976b403f..27cfa0468b 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Volo.Abp.Cli.Commands; using Volo.Abp.Cli.ProjectBuilding.Building; using Volo.Abp.Cli.ProjectBuilding.Building.Steps; @@ -24,11 +25,13 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App SwitchDatabaseProvider(context, steps); DeleteUnrelatedProjects(context, steps); + ConfigurePublicWebSite(context, steps); RemoveUnnecessaryPorts(context, steps); RandomizeSslPorts(context, steps); RandomizeStringEncryption(context, steps); UpdateNuGetConfig(context, steps); CleanupFolderHierarchy(context, steps); + RemoveMigrations(context, steps); return steps; } @@ -92,6 +95,62 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App { steps.Add(new RemoveFolderStep(MobileApp.ReactNative.GetFolderName().EnsureStartsWith('/'))); } + + if (!context.BuildArgs.PublicWebSite) + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Public")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Public.Host")); + } + else + { + if (context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.Tiered.Long) || context.BuildArgs.ExtraProperties.ContainsKey("separate-identity-server")) + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Public")); + } + else + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Public.Host")); + } + } + } + + private void ConfigurePublicWebSite(ProjectBuildContext context, List steps) + { + if (!context.BuildArgs.PublicWebSite) + { + if (!context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.Tiered.Long) && + !context.BuildArgs.ExtraProperties.ContainsKey("separate-identity-server")) + { + steps.Add(new RemovePublicRedisStep()); + } + + steps.Add(new RemoveCmsKitStep()); + return; + } + + if (context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.Tiered.Long) || context.BuildArgs.ExtraProperties.ContainsKey("separate-identity-server")) + { + steps.Add(new AppTemplateProjectRenameStep("MyCompanyName.MyProjectName.Web.Public.Host","MyCompanyName.MyProjectName.Web.Public")); + steps.Add(new ChangeDbMigratorPublicPortStep()); + } + else if (context.BuildArgs.UiFramework != UiFramework.NotSpecified && context.BuildArgs.UiFramework != UiFramework.Mvc) + { + steps.Add(new ChangePublicAuthPortStep()); + } + + if (context.BuildArgs.DatabaseProvider != DatabaseProvider.NotSpecified || context.BuildArgs.DatabaseProvider != DatabaseProvider.EntityFrameworkCore) + { + steps.Add(new RemoveEfCoreDependencyFromPublicStep()); + } + + if (context.BuildArgs.ExtraProperties.ContainsKey("without-cms-kit")) + { + steps.Add(new RemoveCmsKitStep()); + } + else + { + steps.Add(new RemoveGlobalFeaturesPackageStep()); + } } private static void ConfigureWithoutUi(ProjectBuildContext context, List steps) @@ -216,6 +275,11 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App steps.Add(new UpdateNuGetConfigStep("/aspnet-core/NuGet.Config")); } + private static void RemoveMigrations(ProjectBuildContext context, List steps) + { + steps.Add(new RemoveFolderStep("/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations")); + } + private static void CleanupFolderHierarchy(ProjectBuildContext context, List steps) { if (context.BuildArgs.UiFramework == UiFramework.Mvc && context.BuildArgs.MobileApp == MobileApp.None) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/RemoveUnnecessaryPortsStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/RemoveUnnecessaryPortsStep.cs index 4d44cf0b05..620fc5219e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/RemoveUnnecessaryPortsStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/RemoveUnnecessaryPortsStep.cs @@ -4,12 +4,19 @@ using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Volo.Abp.Cli.ProjectBuilding.Building; +using Volo.Abp.Cli.ProjectBuilding.Files; namespace Volo.Abp.Cli.ProjectBuilding.Templates { public class RemoveUnnecessaryPortsStep : ProjectBuildPipelineStep { public override void Execute(ProjectBuildContext context) + { + RemoveUnnecessaryDbMigratorClients(context); + RemoveUnnecessaryHttpApiHostPorts(context); + } + + private static void RemoveUnnecessaryHttpApiHostPorts(ProjectBuildContext context) { var httpApiHostAppSettings = context.Files.FirstOrDefault(f => f.Name.EndsWith(".HttpApi.Host/appsettings.json")); @@ -28,6 +35,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates appJson.Property("ClientUrl")?.Remove(); portsToRemoveFromCors.Add("4200"); } + if (context.BuildArgs.UiFramework != UiFramework.Blazor) { portsToRemoveFromCors.Add("44307"); @@ -36,11 +44,33 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates if (appJson["CorsOrigins"] != null) { appJson["CorsOrigins"] = string.Join(",", - appJson["CorsOrigins"].ToString().Split(",").Where(u=> !portsToRemoveFromCors.Any(u.EndsWith)) - ); + appJson["CorsOrigins"].ToString().Split(",").Where(u => !portsToRemoveFromCors.Any(u.EndsWith)) + ); } httpApiHostAppSettings.SetContent(JsonConvert.SerializeObject(appSettingsJson, Formatting.Indented)); } + + private static void RemoveUnnecessaryDbMigratorClients(ProjectBuildContext context) + { + var dbMigratorAppSettings = context.Files + .FirstOrDefault(f => + f.Name.Contains("MyCompanyName.MyProjectName.DbMigrator") && f.Name.EndsWith("appsettings.json")); + + var appSettingsJsonObject = JObject.Parse(dbMigratorAppSettings.Content); + var identityServerJsonObject = (JObject) appSettingsJsonObject["IdentityServer"]; + var clientsJsonObject = (JObject) identityServerJsonObject["Clients"]; + + if (context.BuildArgs.UiFramework != UiFramework.Blazor) + { + clientsJsonObject.Remove("MyProjectName_Blazor"); + } + if (!context.BuildArgs.PublicWebSite) + { + clientsJsonObject.Remove("MyProjectName_Web_Public"); + } + + dbMigratorAppSettings.SetContent(appSettingsJsonObject.ToString(Formatting.Indented)); + } } } From 89069d954052249f1b6b1dc19f20bedc06ccf8a0 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 7 Jan 2021 18:42:00 +0300 Subject: [PATCH 338/493] explain how Angular UI unit tests work --- docs/en/UI/Angular/Testing.md | 375 +++++++++++++++++++++++++++++++++- 1 file changed, 373 insertions(+), 2 deletions(-) diff --git a/docs/en/UI/Angular/Testing.md b/docs/en/UI/Angular/Testing.md index f24ae62982..e26e1b4a51 100644 --- a/docs/en/UI/Angular/Testing.md +++ b/docs/en/UI/Angular/Testing.md @@ -1,3 +1,374 @@ -# Angular UI: Testing +# Unit Testing Angular UI -TODO \ No newline at end of file +ABP Angular UI is tested like any other Angular application. So, [the guide here](https://angular.io/guide/testing) applies to ABP too. That said, we would like to point out some **unit testing topics specific to ABP Angular applications**. + +## Setup + +In Angular, unit tests use [Karma](https://karma-runner.github.io/) and [Jasmine](https://jasmine.github.io) by default. Although we like Jest more, we chose not to deviate from these defaults, so **the application template you download will have Karma and Jasmine preconfigured**. You can find the Karma configuration inside the _karma.conf.js_ file in the root folder. You don't have to do anything. Adding a spec file and running `npm test` will work. + +You would need a different configuration for your CI environment. To set up a new configuration for your unit tests, find the test project in _angular.json_ file and add one as seen below: + +```json +// angular.json + +"test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { /* several options here */ }, + "configurations": { + "production": { + "karmaConfig": "karma.conf.prod.js" + } + } +} +``` + +Now you can copy the _karma.conf.js_ as _karma.conf.prod.js_ and use any configuration you like in it. Please check [Karma configuration file document](http://karma-runner.github.io/5.2/config/configuration-file.html) for config options. + +Finally, don't forget to run your CI tests with the following command: + +```sh +npm test -- --prod +``` + +## Basics + +An over-simplified spec file looks like this: + +```ts +import { CoreTestingModule } from "@abp/ng.core/testing"; +import { ThemeBasicTestingModule } from "@abp/ng.theme.basic/testing"; +import { ThemeSharedTestingModule } from "@abp/ng.theme.shared/testing"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { NgxValidateCoreModule } from "@ngx-validate/core"; +import { MyComponent } from "./my.component"; + +describe("MyComponent", () => { + let fixture: ComponentFixture; + + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [MyComponent], + imports: [ + CoreTestingModule.withConfig(), + ThemeSharedTestingModule.withConfig(), + ThemeBasicTestingModule.withConfig(), + NgxValidateCoreModule, + ], + providers: [ + /* mock providers here */ + ], + }).compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(MyComponent); + fixture.detectChanges(); + }); + + it("should be initiated", () => { + expect(fixture.componentInstance).toBeTruthy(); + }); +}); +``` + +If you take a look at the imports, you will notice that we have prepared some testing modules to replace built-in ABP modules. This is necessary for providing mocks for some features which otherwise would break your tests. Please remember to **use testing modules** and **call their `withConfig` static method**. + +## Tips + +### Angular Testing Library + +Although you can test your code with Angular TestBed, you may find [Angular Testing Library](https://testing-library.com/docs/angular-testing-library/intro) a good alternative. + +The simple example above can be written with Angular Testing Library as follows: + +```ts +import { CoreTestingModule } from "@abp/ng.core/testing"; +import { ThemeBasicTestingModule } from "@abp/ng.theme.basic/testing"; +import { ThemeSharedTestingModule } from "@abp/ng.theme.shared/testing"; +import { ComponentFixture } from "@angular/core/testing"; +import { NgxValidateCoreModule } from "@ngx-validate/core"; +import { render } from "@testing-library/angular"; +import { MyComponent } from "./my.component"; + +describe("MyComponent", () => { + let fixture: ComponentFixture; + + beforeEach(async () => { + const result = await render(MyComponent, { + imports: [ + CoreTestingModule.withConfig(), + ThemeSharedTestingModule.withConfig(), + ThemeBasicTestingModule.withConfig(), + NgxValidateCoreModule, + ], + providers: [ + /* mock providers here */ + ], + }); + + fixture = result.fixture; + }); + + it("should be initiated", () => { + expect(fixture.componentInstance).toBeTruthy(); + }); +}); +``` + +Very similar, as you can see. The real difference kicks in when we use queries and fire events. + +```ts +// other imports +import { getByLabelText, screen } from "@testing-library/angular"; +import userEvent from "@testing-library/user-event"; + +describe("MyComponent", () => { + beforeEach(/* removed for sake of brevity */); + + it("should display advanced filters", () => { + const filters = screen.getByTestId("author-filters"); + const nameInput = getByLabelText(filters, /name/i) as HTMLInputElement; + expect(nameInput.offsetWidth).toBe(0); + + const advancedFiltersBtn = screen.getByRole("link", { name: /advanced/i }); + userEvent.click(advancedFiltersBtn); + + expect(nameInput.offsetWidth).toBeGreaterThan(0); + + userEvent.type(nameInput, "fooo{backspace}"); + expect(nameInput.value).toBe("foo"); + }); +}); +``` + +The **queries in Angular Testing Library follow practices for maintainable tests**, the user event package provides a **human-like interaction** with the DOM, and the library in general has **a clear API** that simplifies component testing. Please find some useful links below: + +- [Queries](https://testing-library.com/docs/dom-testing-library/api-queries) +- [User Event](https://testing-library.com/docs/ecosystem-user-event) +- [Examples](https://github.com/testing-library/angular-testing-library/tree/master/apps/example-app/app/examples) + +### Clearing DOM After Each Spec + +One thing to remember is that Karma runs tests in real browser instances. That means, you will be able to see the result of your test code, but also have problems with components attached to the document body which may not get cleared after each test, even when you configure Karma to do so. + +We have prepared a simple function with which you can clear any leftover DOM elements after each test. + +```ts +// other imports +import { clearPage } from "@abp/ng.core/testing"; + +describe("MyComponent", () => { + let fixture: ComponentFixture; + + afterEach(() => clearPage(fixture)); + + beforeEach(async () => { + const result = await render(MyComponent, { + /* removed for sake of brevity */ + }); + fixture = result.fixture; + }); + + // specs here +}); +``` + +Please make sure you use it because Karma will fail to remove dialogs otherwise and you will have multiple copies of modals, confirmation boxes, and alike. + +### Waiting + +Some components, modals, in particular, work off-detection-cycle. In other words, you cannot reach DOM elements inserted by these components immediately after opening them. Similarly, inserted elements are not immediately destroyed upon closing them. + +For this purpose, we have prepared a `wait` function. + +```ts +// other imports +import { wait } from "@abp/ng.core/testing"; + +describe("MyComponent", () => { + beforeEach(/* removed for sake of brevity */); + + it("should open a modal", async () => { + const openModalBtn = screen.getByRole("button", { name: "Open Modal" }); + userEvent.click(openModalBtn); + + await wait(fixture); + + const modal = screen.getByRole("dialog"); + + expect(modal).toBeTruthy(); + + /* wait again after closing the modal */ + }); +}); +``` + +The `wait` function takes a second parameter, i.e. timeout (default: `0`). Try not to use it though. Using a timeout bigger than `0` is usually a signal that something is not quite right. + +## Testing Example + +Here is an example test suite. It doesn't cover all, but gives quite a good idea about what the testing experience will be like. + +```ts +import { clearPage, CoreTestingModule, wait } from "@abp/ng.core/testing"; +import { ThemeBasicTestingModule } from "@abp/ng.theme.basic/testing"; +import { ThemeSharedTestingModule } from "@abp/ng.theme.shared/testing"; +import { ComponentFixture } from "@angular/core/testing"; +import { + NgbCollapseModule, + NgbDatepickerModule, + NgbDropdownModule, +} from "@ng-bootstrap/ng-bootstrap"; +import { NgxValidateCoreModule } from "@ngx-validate/core"; +import { CountryService } from "@proxy/countries"; +import { + findByText, + getByLabelText, + getByRole, + getByText, + queryByRole, + render, + screen, +} from "@testing-library/angular"; +import userEvent from "@testing-library/user-event"; +import { BehaviorSubject, of } from "rxjs"; +import { CountryComponent } from "./country.component"; + +const list$ = new BehaviorSubject({ + items: [{ id: "ID_US", name: "United States of America" }], + totalCount: 1, +}); + +describe("Country", () => { + let fixture: ComponentFixture; + + afterEach(() => clearPage(fixture)); + + beforeEach(async () => { + const result = await render(CountryComponent, { + imports: [ + CoreTestingModule.withConfig(), + ThemeSharedTestingModule.withConfig(), + ThemeBasicTestingModule.withConfig(), + NgxValidateCoreModule, + NgbCollapseModule, + NgbDatepickerModule, + NgbDropdownModule, + ], + providers: [ + { + provide: CountryService, + useValue: { + getList: () => list$, + }, + }, + ], + }); + + fixture = result.fixture; + }); + + it("should display advanced filters", () => { + const filters = screen.getByTestId("country-filters"); + const nameInput = getByLabelText(filters, /name/i) as HTMLInputElement; + expect(nameInput.offsetWidth).toBe(0); + + const advancedFiltersBtn = screen.getByRole("link", { name: /advanced/i }); + userEvent.click(advancedFiltersBtn); + + expect(nameInput.offsetWidth).toBeGreaterThan(0); + + userEvent.type(nameInput, "fooo{backspace}"); + expect(nameInput.value).toBe("foo"); + + userEvent.click(advancedFiltersBtn); + expect(nameInput.offsetWidth).toBe(0); + }); + + it("should have a heading", () => { + const heading = screen.getByRole("heading", { name: "Countries" }); + expect(heading).toBeTruthy(); + }); + + it("should render list in table", async () => { + const table = await screen.findByTestId("country-table"); + + const name = getByText(table, "United States of America"); + expect(name).toBeTruthy(); + }); + + it("should display edit modal", async () => { + const actionsBtn = screen.queryByRole("button", { name: /actions/i }); + userEvent.click(actionsBtn); + + const editBtn = screen.getByRole("button", { name: /edit/i }); + userEvent.click(editBtn); + + await wait(fixture); + + const modal = screen.getByRole("dialog"); + const modalHeading = queryByRole(modal, "heading", { name: /edit/i }); + expect(modalHeading).toBeTruthy(); + + const closeBtn = getByText(modal, "×"); + userEvent.click(closeBtn); + + await wait(fixture); + + expect(screen.queryByRole("dialog")).toBeFalsy(); + }); + + it("should display create modal", async () => { + const newBtn = screen.getByRole("button", { name: /new/i }); + userEvent.click(newBtn); + + await wait(fixture); + + const modal = screen.getByRole("dialog"); + const modalHeading = queryByRole(modal, "heading", { name: /new/i }); + + expect(modalHeading).toBeTruthy(); + }); + + it("should validate required name field", async () => { + const newBtn = screen.getByRole("button", { name: /new/i }); + userEvent.click(newBtn); + + await wait(fixture); + + const modal = screen.getByRole("dialog"); + const nameInput = getByRole(modal, "textbox", { + name: /^name/i, + }) as HTMLInputElement; + + userEvent.type(nameInput, "x"); + userEvent.type(nameInput, "{backspace}"); + + const nameError = await findByText(modal, /required/i); + expect(nameError).toBeTruthy(); + }); + + it("should delete a country", () => { + const getSpy = spyOn(fixture.componentInstance.list, "get"); + const deleteSpy = jasmine.createSpy().and.returnValue(of(null)); + fixture.componentInstance.service.delete = deleteSpy; + + const actionsBtn = screen.queryByRole("button", { name: /actions/i }); + userEvent.click(actionsBtn); + + const deleteBtn = screen.getByRole("button", { name: /delete/i }); + userEvent.click(deleteBtn); + + const confirmText = screen.getByText("AreYouSure"); + expect(confirmText).toBeTruthy(); + + const confirmBtn = screen.getByRole("button", { name: "Yes" }); + userEvent.click(confirmBtn); + + expect(deleteSpy).toHaveBeenCalledWith(list$.value.items[0].id); + expect(getSpy).toHaveBeenCalledTimes(1); + }); +}); +``` From 8134299ae9dd66a1ba5bcf0a7788001e6e17290b Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 7 Jan 2021 18:56:52 +0300 Subject: [PATCH 339/493] rename file --- docs/en/UI/Angular/{Testing.md => Unit-Testing.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/en/UI/Angular/{Testing.md => Unit-Testing.md} (100%) diff --git a/docs/en/UI/Angular/Testing.md b/docs/en/UI/Angular/Unit-Testing.md similarity index 100% rename from docs/en/UI/Angular/Testing.md rename to docs/en/UI/Angular/Unit-Testing.md From ae03f8fc7f2da95c7d314845c1d72105403bc617 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 7 Jan 2021 18:47:27 +0300 Subject: [PATCH 340/493] add unit testing to navigation --- docs/en/docs-nav.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index c7a7554fdc..d9c7d2acf8 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -740,6 +740,10 @@ { "text": "PWA Configuration", "path": "UI/Angular/PWA-Configuration.md" + }, + { + "text": "Unit Testing", + "path": "UI/Angular/Unit-Testing.md" } ] }, From 931dd858a5f2e8a734a40c4f15ec5e6051ce79cf Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 7 Jan 2021 19:16:27 +0300 Subject: [PATCH 341/493] rename Unit-Testing.md as Testing.md --- docs/en/UI/Angular/{Unit-Testing.md => Testing.md} | 0 docs/en/docs-nav.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename docs/en/UI/Angular/{Unit-Testing.md => Testing.md} (100%) diff --git a/docs/en/UI/Angular/Unit-Testing.md b/docs/en/UI/Angular/Testing.md similarity index 100% rename from docs/en/UI/Angular/Unit-Testing.md rename to docs/en/UI/Angular/Testing.md diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index d9c7d2acf8..250fed91f0 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -743,7 +743,7 @@ }, { "text": "Unit Testing", - "path": "UI/Angular/Unit-Testing.md" + "path": "UI/Angular/Testing.md" } ] }, From 3c8d1c4cdc90fee729dd7ae7c10b68300c2f3b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 7 Jan 2021 22:08:18 +0300 Subject: [PATCH 342/493] Remove debug log message --- .../Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs index 143a5659cc..006ad1f954 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs @@ -142,8 +142,6 @@ namespace Volo.Abp.Uow.EntityFrameworkCore private async Task CreateDbContextAsync(IUnitOfWork unitOfWork) { - Logger.LogDebug($"Creating a new DbContext of type {typeof(TDbContext).FullName}"); - return unitOfWork.Options.IsTransactional ? await CreateDbContextWithTransactionAsync(unitOfWork) : unitOfWork.ServiceProvider.GetRequiredService(); From 23b63272ceace8678b19221c7db74ab2245d7575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 7 Jan 2021 22:19:18 +0300 Subject: [PATCH 343/493] Add scopes. --- templates/app/angular/src/environments/environment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/app/angular/src/environments/environment.ts b/templates/app/angular/src/environments/environment.ts index 8ec05407c6..abbb289b19 100644 --- a/templates/app/angular/src/environments/environment.ts +++ b/templates/app/angular/src/environments/environment.ts @@ -14,7 +14,7 @@ export const environment = { redirectUri: baseUrl, clientId: 'MyProjectName_App', responseType: 'code', - scope: 'offline_access MyProjectName', + scope: 'offline_access openid profile role email phone MyProjectName', }, apis: { default: { From 913a2a33b69a7b9f3f41bd45bbb8911e56f21a43 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 8 Jan 2021 20:14:16 +0800 Subject: [PATCH 344/493] Move _ViewImports to Pages folder. --- .../Pages/{MyProjectName => }/_ViewImports.cshtml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/{MyProjectName => }/_ViewImports.cshtml (100%) diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/MyProjectName/_ViewImports.cshtml b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/_ViewImports.cshtml similarity index 100% rename from templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/MyProjectName/_ViewImports.cshtml rename to templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/_ViewImports.cshtml From 6992d5c60fe0549cb966be395f78cd2a4aa7df0e Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 8 Jan 2021 15:48:22 +0300 Subject: [PATCH 345/493] move CI testing configuration to bottom --- docs/en/UI/Angular/Testing.md | 50 ++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/docs/en/UI/Angular/Testing.md b/docs/en/UI/Angular/Testing.md index e26e1b4a51..7b93d48585 100644 --- a/docs/en/UI/Angular/Testing.md +++ b/docs/en/UI/Angular/Testing.md @@ -6,30 +6,6 @@ ABP Angular UI is tested like any other Angular application. So, [the guide here In Angular, unit tests use [Karma](https://karma-runner.github.io/) and [Jasmine](https://jasmine.github.io) by default. Although we like Jest more, we chose not to deviate from these defaults, so **the application template you download will have Karma and Jasmine preconfigured**. You can find the Karma configuration inside the _karma.conf.js_ file in the root folder. You don't have to do anything. Adding a spec file and running `npm test` will work. -You would need a different configuration for your CI environment. To set up a new configuration for your unit tests, find the test project in _angular.json_ file and add one as seen below: - -```json -// angular.json - -"test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { /* several options here */ }, - "configurations": { - "production": { - "karmaConfig": "karma.conf.prod.js" - } - } -} -``` - -Now you can copy the _karma.conf.js_ as _karma.conf.prod.js_ and use any configuration you like in it. Please check [Karma configuration file document](http://karma-runner.github.io/5.2/config/configuration-file.html) for config options. - -Finally, don't forget to run your CI tests with the following command: - -```sh -npm test -- --prod -``` - ## Basics An over-simplified spec file looks like this: @@ -372,3 +348,29 @@ describe("Country", () => { }); }); ``` + +## CI Configuration + +You would need a different configuration for your CI environment. To set up a new configuration for your unit tests, find the test project in _angular.json_ file and add one as seen below: + +```json +// angular.json + +"test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { /* several options here */ }, + "configurations": { + "production": { + "karmaConfig": "karma.conf.prod.js" + } + } +} +``` + +Now you can copy the _karma.conf.js_ as _karma.conf.prod.js_ and use any configuration you like in it. Please check [Karma configuration file document](http://karma-runner.github.io/5.2/config/configuration-file.html) for config options. + +Finally, don't forget to run your CI tests with the following command: + +```sh +npm test -- --prod +``` From 0df01129f0a7ec0d4dd960d91049bbdaca81c279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 8 Jan 2021 18:10:08 +0300 Subject: [PATCH 346/493] Fixed #7104: Setting RabbitMQ connection in appsettings.json causes consumers to not consume messages --- .../Volo/Abp/RabbitMQ/AbpRabbitMqModule.cs | 7 +++++++ .../Volo/Abp/RabbitMQ/RabbitMqConnections.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/AbpRabbitMqModule.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/AbpRabbitMqModule.cs index a96309a1a8..feeb3a0431 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/AbpRabbitMqModule.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/AbpRabbitMqModule.cs @@ -15,6 +15,13 @@ namespace Volo.Abp.RabbitMQ { var configuration = context.Services.GetConfiguration(); Configure(configuration.GetSection("RabbitMQ")); + Configure(options => + { + foreach (var connectionFactory in options.Connections.Values) + { + connectionFactory.DispatchConsumersAsync = true; + } + }); } public override void OnApplicationShutdown(ApplicationShutdownContext context) diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConnections.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConnections.cs index f2b5168d82..a725291df8 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConnections.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConnections.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.RabbitMQ public RabbitMqConnections() { - Default = new ConnectionFactory() { DispatchConsumersAsync = true }; + Default = new ConnectionFactory(); } public ConnectionFactory GetOrDefault(string connectionName) From f5bd8f768131fd197a3166190120fb850f1c0994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 16:03:10 +0300 Subject: [PATCH 347/493] Added DisableObsoleteDbContextCreationWarning to disable warning. --- .../UnitOfWorkDbContextProvider.cs | 15 +++++++++------ .../UnitOfWorkMongoDbContextProvider.cs | 15 +++++++++------ .../AsyncLocalSimpleScopeExtensions.cs | 18 ++++++++++++++++++ .../Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs | 3 +++ 4 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 framework/src/Volo.Abp.Threading/Volo/Abp/Threading/AsyncLocalSimpleScopeExtensions.cs diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs index 006ad1f954..364a29fb07 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs @@ -39,12 +39,15 @@ namespace Volo.Abp.Uow.EntityFrameworkCore [Obsolete("Use GetDbContextAsync method.")] public TDbContext GetDbContext() { - Logger.LogWarning( - "UnitOfWorkDbContextProvider.GetDbContext is deprecated. Use GetDbContextAsync instead! " + - "You are probably using LINQ (LINQ extensions) directly on a repository. In this case, use repository.GetQueryableAsync() method " + - "to obtain an IQueryable instance and use LINQ (LINQ extensions) on this object. " - ); - Logger.LogWarning(Environment.StackTrace.Truncate(2048)); + if (!UnitOfWork.DisableObsoleteDbContextCreationWarning.Value) + { + Logger.LogWarning( + "UnitOfWorkDbContextProvider.GetDbContext is deprecated. Use GetDbContextAsync instead! " + + "You are probably using LINQ (LINQ extensions) directly on a repository. In this case, use repository.GetQueryableAsync() method " + + "to obtain an IQueryable instance and use LINQ (LINQ extensions) on this object. " + ); + Logger.LogWarning(Environment.StackTrace.Truncate(2048)); + } var unitOfWork = _unitOfWorkManager.Current; if (unitOfWork == null) diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs index 724e7673fc..6db6aec6b5 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs @@ -36,12 +36,15 @@ namespace Volo.Abp.Uow.MongoDB [Obsolete("Use CreateDbContextAsync")] public TMongoDbContext GetDbContext() { - Logger.LogWarning( - "UnitOfWorkDbContextProvider.GetDbContext is deprecated. Use GetDbContextAsync instead! " + - "You are probably using LINQ (LINQ extensions) directly on a repository. In this case, use repository.GetQueryableAsync() method " + - "to obtain an IQueryable instance and use LINQ (LINQ extensions) on this object. " - ); - Logger.LogWarning(Environment.StackTrace.Truncate(2048)); + if (!UnitOfWork.DisableObsoleteDbContextCreationWarning.Value) + { + Logger.LogWarning( + "UnitOfWorkDbContextProvider.GetDbContext is deprecated. Use GetDbContextAsync instead! " + + "You are probably using LINQ (LINQ extensions) directly on a repository. In this case, use repository.GetQueryableAsync() method " + + "to obtain an IQueryable instance and use LINQ (LINQ extensions) on this object. " + ); + Logger.LogWarning(Environment.StackTrace.Truncate(2048)); + } var unitOfWork = _unitOfWorkManager.Current; if (unitOfWork == null) diff --git a/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/AsyncLocalSimpleScopeExtensions.cs b/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/AsyncLocalSimpleScopeExtensions.cs new file mode 100644 index 0000000000..cb58ea26f9 --- /dev/null +++ b/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/AsyncLocalSimpleScopeExtensions.cs @@ -0,0 +1,18 @@ +using System; +using System.Threading; + +namespace Volo.Abp.Threading +{ + public static class AsyncLocalSimpleScopeExtensions + { + public static IDisposable SetScoped(this AsyncLocal asyncLocal, T value) + { + var previousValue = asyncLocal.Value; + asyncLocal.Value = value; + return new DisposeAction(() => + { + asyncLocal.Value = previousValue; + }); + } + } +} diff --git a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs index d53acc8f66..2e4b40877f 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs @@ -11,6 +11,9 @@ namespace Volo.Abp.Uow { public class UnitOfWork : IUnitOfWork, ITransientDependency { + [Obsolete("This will be removed in next versions.")] + public static AsyncLocal DisableObsoleteDbContextCreationWarning { get; } = new AsyncLocal(); + public const string UnitOfWorkReservationName = "_AbpActionUnitOfWork"; public Guid Id { get; } = Guid.NewGuid(); From 24e889c842cc00b29776389180fa24ade826c445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 16:40:27 +0300 Subject: [PATCH 348/493] Volo.Abp.AspNetCore.Mvc.Contracts should not depend on Volo.Abp.Ddd.Application --- .../Volo.Abp.AspNetCore.Mvc.Client.Common.csproj | 2 ++ .../Mvc/Client/AbpAspNetCoreMvcClientCommonModule.cs | 6 +++++- .../Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs | 2 +- .../Volo.Abp.AspNetCore.Mvc.Contracts.csproj | 2 +- .../Abp/AspNetCore/Mvc/AbpAspNetCoreMvcContractsModule.cs | 2 +- .../Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj | 1 + .../Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs | 4 +++- 7 files changed, 14 insertions(+), 5 deletions(-) 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 dc672d842f..b509a5df59 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 @@ -16,7 +16,9 @@ + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientCommonModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientCommonModule.cs index de5e80ff64..b37c9d57fd 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientCommonModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientCommonModule.cs @@ -1,5 +1,7 @@ using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Authorization; using Volo.Abp.Caching; +using Volo.Abp.Features; using Volo.Abp.Http.Client; using Volo.Abp.Localization; using Volo.Abp.Modularity; @@ -10,7 +12,9 @@ namespace Volo.Abp.AspNetCore.Mvc.Client typeof(AbpHttpClientModule), typeof(AbpAspNetCoreMvcContractsModule), typeof(AbpCachingModule), - typeof(AbpLocalizationModule) + typeof(AbpLocalizationModule), + typeof(AbpAuthorizationModule), + typeof(AbpFeaturesModule) )] public class AbpAspNetCoreMvcClientCommonModule : AbpModule { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs index 4cba01bea2..f769f512a5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs @@ -13,7 +13,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client ConfigurationClient = configurationClient; } - public async override Task GetOrNullAsync(string name) + public override async Task GetOrNullAsync(string name) { var configuration = await ConfigurationClient.GetAsync(); return configuration.Features.Values.GetOrDefault(name); 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 04b2e7ec59..7a5da3dca7 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 @@ -15,7 +15,7 @@
- +
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcContractsModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcContractsModule.cs index 54a7589dd4..3bf299437c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcContractsModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcContractsModule.cs @@ -4,7 +4,7 @@ using Volo.Abp.Modularity; namespace Volo.Abp.AspNetCore.Mvc { [DependsOn( - typeof(AbpDddApplicationModule) + typeof(AbpDddApplicationContractsModule) )] public class AbpAspNetCoreMvcContractsModule : AbpModule { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj index d0806d929d..81c4a3e7e6 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj @@ -21,6 +21,7 @@ + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs index e5edd9662d..0c2e9345e6 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs @@ -22,6 +22,7 @@ using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Localization; using Volo.Abp.ApiVersioning; +using Volo.Abp.Application; using Volo.Abp.AspNetCore.Mvc.AntiForgery; using Volo.Abp.AspNetCore.Mvc.ApiExploring; using Volo.Abp.AspNetCore.Mvc.Conventions; @@ -49,7 +50,8 @@ namespace Volo.Abp.AspNetCore.Mvc typeof(AbpApiVersioningAbstractionsModule), typeof(AbpAspNetCoreMvcContractsModule), typeof(AbpUiNavigationModule), - typeof(AbpGlobalFeaturesModule) + typeof(AbpGlobalFeaturesModule), + typeof(AbpDddApplicationModule) )] public class AbpAspNetCoreMvcModule : AbpModule { From 6c0760680d3d200b84fcdb274089adabd3e51d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 18:47:38 +0300 Subject: [PATCH 349/493] Fix AbpTimingModule dependencies. --- framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj | 1 - .../src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj b/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj index c0a9f0b271..20a4521445 100644 --- a/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj +++ b/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj @@ -20,7 +20,6 @@
- diff --git a/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs b/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs index 3db42c2e55..670eef0fe6 100644 --- a/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs +++ b/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs @@ -8,7 +8,7 @@ using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.Timing { [DependsOn( - typeof(AbpVirtualFileSystemModule), + typeof(AbpLocalizationModule), typeof(AbpSettingsModule) )] public class AbpTimingModule : AbpModule From ea0bf50d131169d784a4fbf0a2368c8f1c611488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 18:48:12 +0300 Subject: [PATCH 350/493] Introduce a way to reset MVC client cache. --- .../Volo.Abp.AspNetCore.Mvc.Client.csproj | 1 + .../Client/AbpAspNetCoreMvcClientModule.cs | 6 ++-- ...MvcCachedApplicationConfigurationClient.cs | 4 +-- ...hedApplicationConfigurationClientHelper.cs | 13 +++++++ ...tionConfigurationCacheResetEventHandler.cs | 34 +++++++++++++++++++ ...icationConfigurationCacheResetEventData.cs | 10 ++++++ 6 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCurrentApplicationConfigurationCacheResetEventHandler.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentApplicationConfigurationCacheResetEventData.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo.Abp.AspNetCore.Mvc.Client.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo.Abp.AspNetCore.Mvc.Client.csproj index 3657e27fef..aae260d7e8 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo.Abp.AspNetCore.Mvc.Client.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo.Abp.AspNetCore.Mvc.Client.csproj @@ -18,6 +18,7 @@ + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs index 1186b48ae7..48e2461167 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs @@ -1,9 +1,11 @@ -using Volo.Abp.Modularity; +using Volo.Abp.EventBus; +using Volo.Abp.Modularity; namespace Volo.Abp.AspNetCore.Mvc.Client { [DependsOn( - typeof(AbpAspNetCoreMvcClientCommonModule) + typeof(AbpAspNetCoreMvcClientCommonModule), + typeof(AbpEventBusModule) )] public class AbpAspNetCoreMvcClientModule : AbpModule { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs index a6a4d33668..4f5b7c84b0 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs @@ -56,7 +56,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client async () => await Proxy.Service.GetAsync(), () => new DistributedCacheEntryOptions { - AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(120) //TODO: Should be configurable. Default value should be higher (5 mins would be good). + AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(300) //TODO: Should be configurable. } ); @@ -83,7 +83,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client protected virtual string CreateCacheKey() { - return $"ApplicationConfiguration_{CurrentUser.Id?.ToString("N") ?? "Anonymous"}_{CultureInfo.CurrentUICulture.Name}"; + return MvcCachedApplicationConfigurationClientHelper.CreateCacheKey(CurrentUser); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs new file mode 100644 index 0000000000..4b4a0e6301 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs @@ -0,0 +1,13 @@ +using System.Globalization; +using Volo.Abp.Users; + +namespace Volo.Abp.AspNetCore.Mvc.Client +{ + internal static class MvcCachedApplicationConfigurationClientHelper + { + public static string CreateCacheKey(ICurrentUser currentUser) + { + return $"ApplicationConfiguration_{currentUser.Id?.ToString("N") ?? "Anonymous"}_{CultureInfo.CurrentUICulture.Name}"; + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCurrentApplicationConfigurationCacheResetEventHandler.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCurrentApplicationConfigurationCacheResetEventHandler.cs new file mode 100644 index 0000000000..e8f5b201da --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCurrentApplicationConfigurationCacheResetEventHandler.cs @@ -0,0 +1,34 @@ +using System.Threading.Tasks; +using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus; +using Volo.Abp.Users; + +namespace Volo.Abp.AspNetCore.Mvc.Client +{ + public class MvcCurrentApplicationConfigurationCacheResetEventHandler : + ILocalEventHandler, + ITransientDependency + { + protected ICurrentUser CurrentUser { get; } + protected IDistributedCache Cache { get; } + + public MvcCurrentApplicationConfigurationCacheResetEventHandler(ICurrentUser currentUser, + IDistributedCache cache) + { + CurrentUser = currentUser; + Cache = cache; + } + + public virtual async Task HandleEventAsync(CurrentApplicationConfigurationCacheResetEventData eventData) + { + await Cache.RemoveAsync(CreateCacheKey()); + } + + protected virtual string CreateCacheKey() + { + return MvcCachedApplicationConfigurationClientHelper.CreateCacheKey(CurrentUser); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentApplicationConfigurationCacheResetEventData.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentApplicationConfigurationCacheResetEventData.cs new file mode 100644 index 0000000000..e84e96d9dd --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentApplicationConfigurationCacheResetEventData.cs @@ -0,0 +1,10 @@ +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations +{ + /// + /// This event is used to invalidate current user's cached configuration. + /// + public class CurrentApplicationConfigurationCacheResetEventData + { + + } +} From 515a26c1574c7e485353a3df68ca337d7595eabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 18:48:33 +0300 Subject: [PATCH 351/493] Reset MVC client cache on permission changes. --- .../PermissionManagementModal.cshtml.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs index 041121b8cb..a990437464 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs @@ -3,7 +3,9 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; +using Volo.Abp.EventBus.Local; using Volo.Abp.PermissionManagement.Web.Utils; namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement @@ -31,11 +33,16 @@ namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement protected IPermissionAppService PermissionAppService { get; } - public PermissionManagementModal(IPermissionAppService permissionAppService) + protected ILocalEventBus LocalEventBus { get; } + + public PermissionManagementModal( + IPermissionAppService permissionAppService, + ILocalEventBus localEventBus) { ObjectMapperContext = typeof(AbpPermissionManagementWebModule); PermissionAppService = permissionAppService; + LocalEventBus = localEventBus; } public virtual async Task OnGetAsync() @@ -88,6 +95,10 @@ namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement } ); + await LocalEventBus.PublishAsync( + new CurrentApplicationConfigurationCacheResetEventData() + ); + return NoContent(); } @@ -155,4 +166,4 @@ namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement public string ProviderKey { get; set; } } } -} \ No newline at end of file +} From 590ae4d30069adf9432d72b132b15e66c068629a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 18:57:44 +0300 Subject: [PATCH 352/493] Invalidate current user client cache on feature changes. --- .../FeatureManagement/FeatureManagementModal.cshtml.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs index 367268019c..3572e65d3b 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs @@ -3,7 +3,9 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; +using Volo.Abp.EventBus.Local; using Volo.Abp.Features; using Volo.Abp.Validation.StringValues; @@ -27,6 +29,8 @@ namespace Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement protected IFeatureAppService FeatureAppService { get; } + protected ILocalEventBus LocalEventBus { get; } + public FeatureManagementModal(IFeatureAppService featureAppService) { ObjectMapperContext = typeof(AbpFeatureManagementWebModule); @@ -56,6 +60,10 @@ namespace Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement await FeatureAppService.UpdateAsync(ProviderName, ProviderKey, features); + await LocalEventBus.PublishAsync( + new CurrentApplicationConfigurationCacheResetEventData() + ); + return NoContent(); } From 9da2acc087819bdb83e0c3533e6be2ed73a8469a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 19:33:46 +0300 Subject: [PATCH 353/493] Refresh configuration on setting changes. --- .../Pages/SettingManagement/Index.cshtml.cs | 21 ++++++++++++++++--- .../Pages/SettingManagement/Index.js | 4 ++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml.cs index 7f9c332e13..87eb2e5bf4 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml.cs @@ -2,7 +2,9 @@ using System; using System.Threading.Tasks; using Microsoft.Extensions.Options; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; +using Volo.Abp.EventBus.Local; namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement { @@ -10,10 +12,14 @@ namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement { public SettingPageCreationContext SettingPageCreationContext { get; private set; } + protected ILocalEventBus LocalEventBus { get; } protected SettingManagementPageOptions Options { get; } - public IndexModel(IOptions options) + public IndexModel( + IOptions options, + ILocalEventBus localEventBus) { + LocalEventBus = localEventBus; Options = options.Value; } @@ -25,7 +31,7 @@ namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement { await contributor.ConfigureAsync(SettingPageCreationContext); } - + return Page(); } @@ -33,5 +39,14 @@ namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement { return Task.FromResult(Page()); } + + public virtual async Task OnPostRefreshConfigurationAsync() + { + await LocalEventBus.PublishAsync( + new CurrentApplicationConfigurationCacheResetEventData() + ); + + return NoContent(); + } } -} \ No newline at end of file +} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js index 32ea1a27cc..fdd63bd4fd 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js @@ -3,5 +3,9 @@ $(document).on('AbpSettingSaved', function () { abp.notify.success(l('SuccessfullySaved')); + + abp.ajax({ + url: abp.appPath + 'SettingManagement?handler=RefreshConfiguration' + }); }); })(jQuery); From 1684e910dc16cb649eb7f83fb8d003275e777f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 19:42:35 +0300 Subject: [PATCH 354/493] Fix FeatureManagementModal --- .../Pages/FeatureManagement/FeatureManagementModal.cshtml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs index 3572e65d3b..d2ccc5a44d 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs @@ -31,11 +31,14 @@ namespace Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement protected ILocalEventBus LocalEventBus { get; } - public FeatureManagementModal(IFeatureAppService featureAppService) + public FeatureManagementModal( + IFeatureAppService featureAppService, + ILocalEventBus localEventBus) { ObjectMapperContext = typeof(AbpFeatureManagementWebModule); FeatureAppService = featureAppService; + LocalEventBus = localEventBus; } public virtual async Task OnGetAsync() From 7d049361d716c3e720ea1e801e3cce1113fb0b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 20:43:11 +0300 Subject: [PATCH 355/493] MethodInvocationAuthorizationService should constructor-inject instead of resolving. --- .../MethodInvocationAuthorizationService.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs index 7a34598a66..eec672e718 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs @@ -11,11 +11,15 @@ namespace Volo.Abp.Authorization { public class MethodInvocationAuthorizationService : IMethodInvocationAuthorizationService, ITransientDependency { - private readonly IServiceProvider _serviceProvider; + private readonly IAbpAuthorizationPolicyProvider _abpAuthorizationPolicyProvider; + private readonly IAbpAuthorizationService _abpAuthorizationService; - public MethodInvocationAuthorizationService(IServiceProvider serviceProvider) + public MethodInvocationAuthorizationService( + IAbpAuthorizationPolicyProvider abpAuthorizationPolicyProvider, + IAbpAuthorizationService abpAuthorizationService) { - _serviceProvider = serviceProvider; + _abpAuthorizationPolicyProvider = abpAuthorizationPolicyProvider; + _abpAuthorizationService = abpAuthorizationService; } public async Task CheckAsync(MethodInvocationAuthorizationContext context) @@ -26,7 +30,7 @@ namespace Volo.Abp.Authorization } var authorizationPolicy = await AuthorizationPolicy.CombineAsync( - _serviceProvider.GetRequiredService(), + _abpAuthorizationPolicyProvider, GetAuthorizationDataAttributes(context.Method) ); @@ -35,7 +39,7 @@ namespace Volo.Abp.Authorization return; } - await _serviceProvider.GetRequiredService().CheckAsync(authorizationPolicy); + await _abpAuthorizationService.CheckAsync(authorizationPolicy); } protected virtual bool AllowAnonymous(MethodInvocationAuthorizationContext context) From f791763c4438c388b8f291f7b01ba80d0bd3fb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 21:02:04 +0300 Subject: [PATCH 356/493] Grammar improvements --- docs/en/Modules/Index.md | 2 +- docs/en/Modules/Setting-Management.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/Modules/Index.md b/docs/en/Modules/Index.md index 9d0199f4c3..8851f8b554 100644 --- a/docs/en/Modules/Index.md +++ b/docs/en/Modules/Index.md @@ -2,7 +2,7 @@ ABP is a **modular application framework** which consists of dozens of **NuGet & NPM packages**. It also provides a complete infrastructure to build your own application modules which may have entities, services, database integration, APIs, UI components and so on. -There are **two types of modules.** They don't have any structural difference but categorized by functionality and purpose: +There are **two types of modules.** They don't have any structural difference but are categorized by functionality and purpose: * [**Framework modules**](https://github.com/abpframework/abp/tree/master/framework/src): These are **core modules of the framework** like caching, emailing, theming, security, serialization, validation, EF Core integration, MongoDB integration... etc. They do not have application/business functionalities but makes your daily development easier by providing common infrastructure, integration and abstractions. * [**Application modules**](https://github.com/abpframework/abp/tree/master/modules): These modules implement specific application/business functionalities like blogging, document management, identity management, tenant management... etc. They generally have their own entities, services, APIs and UI components. diff --git a/docs/en/Modules/Setting-Management.md b/docs/en/Modules/Setting-Management.md index 134e24aed2..dff8da3f8e 100644 --- a/docs/en/Modules/Setting-Management.md +++ b/docs/en/Modules/Setting-Management.md @@ -75,7 +75,7 @@ Setting values are cached using the [distributed cache](../Caching.md) system. A ## Setting Management Providers -Setting Management module is extensible, just like the [setting system](../Settings.md). You can extend it by defining setting management providers. There are 5 pre-built setting management providers registered by the order below: +Setting Management module is extensible, just like the [setting system](../Settings.md). You can extend it by defining setting management providers. There are 5 pre-built setting management providers registered it the following order: * `DefaultValueSettingManagementProvider`: Gets the value from the default value of the setting definition. It can not set the default value since default values are hard-coded on the setting definition. * `ConfigurationSettingManagementProvider`: Gets the value from the [IConfiguration service](../Configuration.md). It can not set the configuration value because it is not possible to change the configuration values on runtime. From 6c1abd6146ea613ac6862abecb353ce8360f3da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 Jan 2021 21:02:29 +0300 Subject: [PATCH 357/493] Remove unused namespaces. --- .../Abp/Authorization/MethodInvocationAuthorizationService.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs index eec672e718..c00c652500 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs @@ -1,10 +1,8 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using Microsoft.Extensions.DependencyInjection; using Volo.Abp.DependencyInjection; namespace Volo.Abp.Authorization From 68602fd65f45a2b7feb53bee5533445d43c975c3 Mon Sep 17 00:00:00 2001 From: Kamal Alseisy Date: Sun, 10 Jan 2021 10:59:20 +0200 Subject: [PATCH 358/493] fix totalCount in IdentityRole GetList in case of using filter --- .../Volo/Abp/Identity/IdentityRoleAppService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs index 9eecb1058e..070f55901e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs @@ -40,7 +40,7 @@ namespace Volo.Abp.Identity public virtual async Task> GetListAsync(GetIdentityRolesInput input) { var list = await RoleRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter); - var totalCount = await RoleRepository.GetCountAsync(); + var totalCount = await RoleRepository.GetCountAsync(input.Filter); return new PagedResultDto( totalCount, From 1cb9a6e9d01eb27500c522f2b1ab9eba37c43941 Mon Sep 17 00:00:00 2001 From: Oliver Cooper Date: Sun, 10 Jan 2021 12:12:26 +0000 Subject: [PATCH 359/493] Make AccountEmailer.NormalizeReturnUrl method protected --- .../Volo/Abp/Account/Emailing/AccountEmailer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/Emailing/AccountEmailer.cs b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/Emailing/AccountEmailer.cs index baa762c840..6852b85b30 100644 --- a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/Emailing/AccountEmailer.cs +++ b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/Emailing/AccountEmailer.cs @@ -72,7 +72,7 @@ namespace Volo.Abp.Account.Emailing ); } - private string NormalizeReturnUrl(string returnUrl) + protected string NormalizeReturnUrl(string returnUrl) { if (returnUrl.IsNullOrEmpty()) { From 1647b729e57d0fc42c8983b44fa4396d2ee188b3 Mon Sep 17 00:00:00 2001 From: Oliver Cooper Date: Sun, 10 Jan 2021 20:21:37 +0000 Subject: [PATCH 360/493] Make AccountEmailer.NormalizeReturnUrl method protected virtual --- .../Volo/Abp/Account/Emailing/AccountEmailer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/Emailing/AccountEmailer.cs b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/Emailing/AccountEmailer.cs index 6852b85b30..1d7379bd04 100644 --- a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/Emailing/AccountEmailer.cs +++ b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/Emailing/AccountEmailer.cs @@ -72,7 +72,7 @@ namespace Volo.Abp.Account.Emailing ); } - protected string NormalizeReturnUrl(string returnUrl) + protected virtual string NormalizeReturnUrl(string returnUrl) { if (returnUrl.IsNullOrEmpty()) { From 5318451927f95a0a312f0189bc4e09fccebc64cf Mon Sep 17 00:00:00 2001 From: Ahmet Date: Mon, 11 Jan 2021 00:17:00 +0300 Subject: [PATCH 361/493] Sorting all modifiers --- .../Themes/Basic/LanguageSwitch.razor | 2 +- .../Themes/Basic/LoginDisplay.razor.cs | 2 +- .../Themes/Basic/NavMenu.razor.cs | 2 +- .../Themes/Basic/NavToolbar.razor.cs | 2 +- .../MultiTenancy/FormTenantResolveContributor.cs | 2 +- .../MultiTenancy/HttpTenantResolveContributerBase.cs | 2 +- .../Breadcrumb/AbpBreadcrumbTagHelperService.cs | 2 +- .../TagHelpers/Carousel/AbpCarouselTagHelperService.cs | 2 +- .../Collapse/AbpAccordionItemTagHelperService.cs | 2 +- .../TagHelpers/Collapse/AbpAccordionTagHelperService.cs | 2 +- .../Collapse/AbpCollapseBodyTagHelperService.cs | 2 +- .../Dropdown/AbpDropdownButtonTagHelperService.cs | 2 +- .../TagHelpers/Form/AbpDynamicformTagHelperService.cs | 2 +- .../TagHelpers/Form/AbpInputTagHelperService.cs | 2 +- .../TagHelpers/Form/AbpSelectTagHelperService.cs | 2 +- .../TagHelpers/Modal/AbpModalTagHelperService.cs | 2 +- .../Pagination/AbpPaginationTagHelperService.cs | 2 +- .../TagHelpers/Tab/AbpTabDropdownTagHelperService.cs | 2 +- .../TagHelpers/Tab/AbpTabTagHelperService.cs | 2 +- .../TagHelpers/Tab/AbpTabsTagHelperService.cs | 2 +- .../Bundling/TagHelpers/AbpBundleItemTagHelperService.cs | 2 +- .../UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs | 2 +- .../UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs | 2 +- .../UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs | 2 +- .../Shared/TagHelpers/AbpComponentDemoSectionTagHelper.cs | 2 +- .../Mvc/Content/RemoteStreamContentOutputFormatter.cs | 2 +- .../SecurityLog/AspNetCoreSecurityLogManager.cs | 2 +- .../Abp/Authorization/AbpAuthorizationPolicyProvider.cs | 2 +- .../Abp/Authorization/PermissionRequirementHandler.cs | 2 +- .../Permissions/ClientPermissionValueProvider.cs | 4 ++-- .../Permissions/RolePermissionValueProvider.cs | 4 ++-- .../Permissions/UserPermissionValueProvider.cs | 4 ++-- .../Volo/Abp/BackgroundJobs/BackgroundJobWorker.cs | 2 +- .../AsyncPeriodicBackgroundWorkerBase.cs | 4 ++-- .../Abp/BackgroundWorkers/PeriodicBackgroundWorkerBase.cs | 4 ++-- .../Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs | 2 +- .../Volo/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs | 2 +- .../Volo/Abp/BlobStoring/Aws/AwsBlobProvider.cs | 8 ++++---- .../Volo/Abp/BlobStoring/Azure/AzureBlobProvider.cs | 8 ++++---- .../Abp/BlobStoring/FileSystem/FileSystemBlobProvider.cs | 4 ++-- .../Volo/Abp/BlobStoring/Minio/MinioBlobProvider.cs | 8 ++++---- .../DynamicProxy/CastleAbpMethodInvocationAdapter.cs | 2 +- .../CastleAbpMethodInvocationAdapterWithReturnValue.cs | 2 +- .../DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs | 4 ++-- .../Volo/Abp/Emailing/BackgroundEmailSendingJob.cs | 2 +- .../Volo/Abp/Emailing/Smtp/SmtpEmailSender.cs | 2 +- .../Volo/Abp/EntityFrameworkCore/AbpDbContext.cs | 2 +- .../Volo/Abp/EventBus/Kafka/KafkaDistributedEventBus.cs | 2 +- .../Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs | 2 +- .../Volo/Abp/EventBus/Local/LocalEventBus.cs | 2 +- .../Volo/Abp/Features/EditionFeatureValueProvider.cs | 2 +- .../Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs | 2 +- .../Volo/Abp/Features/TenantFeatureValueProvider.cs | 2 +- ...xtIdentityModelRemoteServiceHttpClientAuthenticator.cs | 2 +- ...erIdentityModelRemoteServiceHttpClientAuthenticator.cs | 2 +- .../Client/DynamicProxying/DynamicHttpProxyInterceptor.cs | 2 +- .../Volo/Abp/MailKit/MailKitSmtpEmailSender.cs | 2 +- .../Volo/Abp/Settings/TenantSettingValueProvider.cs | 4 ++-- .../Volo/Abp/Settings/UserSettingValueProvider.cs | 4 ++-- .../BlobStoring/Minio/AbpBlobStoringMinioTestModule.cs | 2 +- .../Volo/Abp/DynamicProxy/SimpleAsyncInterceptor.cs | 2 +- .../Abp/DynamicProxy/SimpleResultCacheTestInterceptor.cs | 2 +- .../Abp/MongoDB/Repositories/Repository_Basic_Tests.cs | 2 +- .../Volo/Abp/TestApp/Application/DistrictAppService.cs | 4 ++-- 64 files changed, 83 insertions(+), 83 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LanguageSwitch.razor b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LanguageSwitch.razor index 6b93618f44..bfc970c436 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LanguageSwitch.razor +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LanguageSwitch.razor @@ -21,7 +21,7 @@ private IReadOnlyList _otherLanguages; private LanguageInfo _currentLanguage; - protected async override Task OnInitializedAsync() + protected override async Task OnInitializedAsync() { var selectedLanguageName = await JsRuntime.InvokeAsync( "localStorage.getItem", diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs index 494eca34ab..3238483cfb 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs @@ -13,7 +13,7 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic protected ApplicationMenu Menu { get; set; } - protected async override Task OnInitializedAsync() + protected override async Task OnInitializedAsync() { Menu = await MenuManager.GetAsync(StandardMenus.User); diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/NavMenu.razor.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/NavMenu.razor.cs index 1779d73d28..416efeffad 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/NavMenu.razor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/NavMenu.razor.cs @@ -11,7 +11,7 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic protected ApplicationMenu Menu { get; set; } - protected async override Task OnInitializedAsync() + protected override async Task OnInitializedAsync() { Menu = await MenuManager.GetAsync(StandardMenus.Main); } diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/NavToolbar.razor.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/NavToolbar.razor.cs index 33044282f9..6fddf263b3 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/NavToolbar.razor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/NavToolbar.razor.cs @@ -12,7 +12,7 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic private List ToolbarItemRenders { get; set; } = new List(); - protected async override Task OnInitializedAsync() + protected override async Task OnInitializedAsync() { var toolbar = await ToolbarManager.GetAsync(StandardToolbars.Main); diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs index 868ef78519..77c12bef7b 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs @@ -11,7 +11,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy public override string Name => ContributorName; - protected async override Task GetTenantIdOrNameFromHttpContextOrNullAsync(ITenantResolveContext context, HttpContext httpContext) + protected override async Task GetTenantIdOrNameFromHttpContextOrNullAsync(ITenantResolveContext context, HttpContext httpContext) { if (!httpContext.Request.HasFormContentType) { diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/HttpTenantResolveContributerBase.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/HttpTenantResolveContributerBase.cs index 18f76ee711..3b454b5ef9 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/HttpTenantResolveContributerBase.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/HttpTenantResolveContributerBase.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy { public abstract class HttpTenantResolveContributorBase : TenantResolveContributorBase { - public async override Task ResolveAsync(ITenantResolveContext context) + public override async Task ResolveAsync(ITenantResolveContext context) { var httpContext = context.GetHttpContext(); if (httpContext == null) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Breadcrumb/AbpBreadcrumbTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Breadcrumb/AbpBreadcrumbTagHelperService.cs index e1b4469f8c..4b433ac495 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Breadcrumb/AbpBreadcrumbTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Breadcrumb/AbpBreadcrumbTagHelperService.cs @@ -8,7 +8,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Breadcrumb { public class AbpBreadcrumbTagHelperService : AbpTagHelperService { - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { output.TagName = "nav"; output.Attributes.Add("aria-label", "breadcrumb"); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Carousel/AbpCarouselTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Carousel/AbpCarouselTagHelperService.cs index e4a277ba66..c3672db7f5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Carousel/AbpCarouselTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Carousel/AbpCarouselTagHelperService.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Carousel L = localizer; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { output.TagName = "div"; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs index f9e019391f..6afb918704 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Collapse { public class AbpAccordionItemTagHelperService : AbpTagHelperService { - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { SetRandomIdIfNotProvided(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionTagHelperService.cs index 7651309e1a..d55bb04d21 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionTagHelperService.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Collapse HtmlGenerator = htmlGenerator; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { SetRandomIdIfNotProvided(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs index 198c5b91e6..3c429b32ef 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs @@ -6,7 +6,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Collapse { public class AbpCollapseBodyTagHelperService : AbpTagHelperService { - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { output.TagName = "div"; output.Attributes.AddClass("collapse"); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs index 52ea6ace85..c6a0307d2d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs @@ -24,7 +24,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown _serviceProvider = serviceProvider; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { var content = await output.GetChildContentAsync(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs index da622b968b..7d2f0804b7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs @@ -36,7 +36,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form _localizer = localizer; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { var list = InitilizeFormGroupContentsContext(context, output); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs index 246c611533..48abbd93e9 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs @@ -26,7 +26,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form _tagHelperLocalizer = tagHelperLocalizer; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { var (innerHtml, isCheckBox) = await GetFormInputGroupAsHtmlAsync(context, output); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs index dde58ed3e4..6050fb91d6 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs @@ -36,7 +36,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form _stringLocalizerFactory = stringLocalizerFactory; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { var innerHtml = await GetFormInputGroupAsHtmlAsync(context, output); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalTagHelperService.cs index aa83265e94..5bc2330bf1 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalTagHelperService.cs @@ -8,7 +8,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal { public class AbpModalTagHelperService : AbpTagHelperService { - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { output.TagName = null; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs index 148f196aad..cb1e395f40 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs @@ -32,7 +32,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination _stringLocalizerFactory = stringLocalizerFactory; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { if (TagHelper.Model.ShownItemsCount <= 0) { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabDropdownTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabDropdownTagHelperService.cs index 02810e9666..726a947be2 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabDropdownTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabDropdownTagHelperService.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab { public class AbpTabDropdownTagHelperService : AbpTagHelperService { - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { if (string.IsNullOrWhiteSpace(TagHelper.Name)) { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs index db05c5c686..a9a134ceba 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab { public class AbpTabTagHelperService : AbpTagHelperService { - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { SetPlaceholderForNameIfNotProvided(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs index 8046af8ccd..92e50990a4 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs @@ -20,7 +20,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab HtmlGenerator = htmlGenerator; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { SetRandomNameIfNotProvided(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleItemTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleItemTagHelperService.cs index 0ffb5b9049..eca80c5fcf 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleItemTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleItemTagHelperService.cs @@ -16,7 +16,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers ResourceService = resourceService; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { var tagHelperItems = context.Items.GetOrDefault(AbpTagHelperConsts.ContextBundleItemListKey) as List; if (tagHelperItems != null) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs index 9158f33b90..f0c76d5cc4 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs @@ -16,7 +16,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers ResourceService = resourceService; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { await ResourceService.ProcessAsync( TagHelper.ViewContext, diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs index 9e4e77a6dd..6efbb793e7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs @@ -38,7 +38,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers ); } - protected async override Task> GetBundleFilesAsync(string bundleName) + protected override async Task> GetBundleFilesAsync(string bundleName) { return await BundleManager.GetScriptBundleFilesAsync(bundleName); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs index a9d9b54fca..8612e4f8b4 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs @@ -38,7 +38,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers ); } - protected async override Task> GetBundleFilesAsync(string bundleName) + protected override async Task> GetBundleFilesAsync(string bundleName) { return await BundleManager.GetStyleBundleFilesAsync(bundleName); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/TagHelpers/AbpComponentDemoSectionTagHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/TagHelpers/AbpComponentDemoSectionTagHelper.cs index 9a16b4b43a..328024cc2b 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/TagHelpers/AbpComponentDemoSectionTagHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/TagHelpers/AbpComponentDemoSectionTagHelper.cs @@ -28,7 +28,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.S _guidGenerator = guidGenerator; } - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { output.TagName = null; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/RemoteStreamContentOutputFormatter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/RemoteStreamContentOutputFormatter.cs index d3ecfaff27..706e514254 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/RemoteStreamContentOutputFormatter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Content/RemoteStreamContentOutputFormatter.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Content return typeof(IRemoteStreamContent).IsAssignableFrom(type); } - public async override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) + public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context) { var remoteStream = (IRemoteStreamContent)context.Object; using (var stream = remoteStream.GetStream()) diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/SecurityLog/AspNetCoreSecurityLogManager.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/SecurityLog/AspNetCoreSecurityLogManager.cs index b518c5abbb..f0fc0aa347 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/SecurityLog/AspNetCoreSecurityLogManager.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/SecurityLog/AspNetCoreSecurityLogManager.cs @@ -48,7 +48,7 @@ namespace Volo.Abp.AspNetCore.SecurityLog WebClientInfoProvider = webClientInfoProvider; } - protected async override Task CreateAsync() + protected override async Task CreateAsync() { var securityLogInfo = await base.CreateAsync(); diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs index f889251c69..f636877fc1 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs @@ -23,7 +23,7 @@ namespace Volo.Abp.Authorization _options = options.Value; } - public async override Task GetPolicyAsync(string policyName) + public override async Task GetPolicyAsync(string policyName) { var policy = await base.GetPolicyAsync(policyName); if (policy != null) diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/PermissionRequirementHandler.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/PermissionRequirementHandler.cs index b0446f5602..d4ec7c1d3c 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/PermissionRequirementHandler.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/PermissionRequirementHandler.cs @@ -13,7 +13,7 @@ namespace Volo.Abp.Authorization _permissionChecker = permissionChecker; } - protected async override Task HandleRequirementAsync( + protected override async Task HandleRequirementAsync( AuthorizationHandlerContext context, PermissionRequirement requirement) { diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs index ac76733524..6e14b304e3 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.Authorization.Permissions CurrentTenant = currentTenant; } - public async override Task CheckAsync(PermissionValueCheckContext context) + public override async Task CheckAsync(PermissionValueCheckContext context) { var clientId = context.Principal?.FindFirst(AbpClaimTypes.ClientId)?.Value; @@ -36,7 +36,7 @@ namespace Volo.Abp.Authorization.Permissions } } - public async override Task CheckAsync(PermissionValuesCheckContext context) + public override async Task CheckAsync(PermissionValuesCheckContext context) { var permissionNames = context.Permissions.Select(x => x.Name).ToArray(); diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs index e3ab7629a2..eec94b3b98 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.Authorization.Permissions } - public async override Task CheckAsync(PermissionValueCheckContext context) + public override async Task CheckAsync(PermissionValueCheckContext context) { var roles = context.Principal?.FindAll(AbpClaimTypes.Role).Select(c => c.Value).ToArray(); @@ -37,7 +37,7 @@ namespace Volo.Abp.Authorization.Permissions return PermissionGrantResult.Undefined; } - public async override Task CheckAsync(PermissionValuesCheckContext context) + public override async Task CheckAsync(PermissionValuesCheckContext context) { var permissionNames = context.Permissions.Select(x => x.Name).ToList(); var result = new MultiplePermissionGrantResult(permissionNames.ToArray()); diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs index fcdc25d1e1..c90344371e 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs @@ -16,7 +16,7 @@ namespace Volo.Abp.Authorization.Permissions } - public async override Task CheckAsync(PermissionValueCheckContext context) + public override async Task CheckAsync(PermissionValueCheckContext context) { var userId = context.Principal?.FindFirst(AbpClaimTypes.UserId)?.Value; @@ -30,7 +30,7 @@ namespace Volo.Abp.Authorization.Permissions : PermissionGrantResult.Undefined; } - public async override Task CheckAsync(PermissionValuesCheckContext context) + public override async Task CheckAsync(PermissionValuesCheckContext context) { var permissionNames = context.Permissions.Select(x => x.Name).ToArray(); diff --git a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobWorker.cs b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobWorker.cs index 2635294323..8eec35d816 100644 --- a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobWorker.cs +++ b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobWorker.cs @@ -30,7 +30,7 @@ namespace Volo.Abp.BackgroundJobs Timer.Period = WorkerOptions.JobPollPeriod; } - protected async override Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) { var store = workerContext.ServiceProvider.GetRequiredService(); diff --git a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AsyncPeriodicBackgroundWorkerBase.cs b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AsyncPeriodicBackgroundWorkerBase.cs index 094c6eb7eb..ce4f9b42d7 100644 --- a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AsyncPeriodicBackgroundWorkerBase.cs +++ b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AsyncPeriodicBackgroundWorkerBase.cs @@ -22,13 +22,13 @@ namespace Volo.Abp.BackgroundWorkers Timer.Elapsed = Timer_Elapsed; } - public async override Task StartAsync(CancellationToken cancellationToken = default) + public override async Task StartAsync(CancellationToken cancellationToken = default) { await base.StartAsync(cancellationToken); Timer.Start(cancellationToken); } - public async override Task StopAsync(CancellationToken cancellationToken = default) + public override async Task StopAsync(CancellationToken cancellationToken = default) { Timer.Stop(cancellationToken); await base.StopAsync(cancellationToken); diff --git a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/PeriodicBackgroundWorkerBase.cs b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/PeriodicBackgroundWorkerBase.cs index 6ac757fef5..e89204e81f 100644 --- a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/PeriodicBackgroundWorkerBase.cs +++ b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/PeriodicBackgroundWorkerBase.cs @@ -25,13 +25,13 @@ namespace Volo.Abp.BackgroundWorkers Timer.Elapsed += Timer_Elapsed; } - public async override Task StartAsync(CancellationToken cancellationToken = default) + public override async Task StartAsync(CancellationToken cancellationToken = default) { await base.StartAsync(cancellationToken); Timer.Start(cancellationToken); } - public async override Task StopAsync(CancellationToken cancellationToken = default) + public override async Task StopAsync(CancellationToken cancellationToken = default) { Timer.Stop(cancellationToken); await base.StopAsync(cancellationToken); diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs index e3e7112afa..7f0edf3b4a 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs @@ -41,7 +41,7 @@ namespace Volo.Abp.BlazoriseUI.Components [Inject] protected IUiMessageService UiMessageService { get; set; } - protected async override Task OnInitializedAsync() + protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); await SetDefaultValuesAsync(); diff --git a/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs b/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs index d6c9303afd..39e8aff996 100644 --- a/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs +++ b/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs @@ -73,7 +73,7 @@ namespace Volo.Abp.BlobStoring.Aliyun return Task.FromResult(BlobExists(ossClient, containerName, blobName)); } - public async override Task GetOrNullAsync(BlobProviderGetArgs args) + public override async Task GetOrNullAsync(BlobProviderGetArgs args) { var containerName = GetContainerName(args); var blobName = AliyunBlobNameCalculator.Calculate(args); diff --git a/framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProvider.cs b/framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProvider.cs index 191f9a0ac7..dd9c205d8b 100644 --- a/framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProvider.cs +++ b/framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProvider.cs @@ -20,7 +20,7 @@ namespace Volo.Abp.BlobStoring.Aws AmazonS3ClientFactory = amazonS3ClientFactory; } - public async override Task SaveAsync(BlobProviderSaveArgs args) + public override async Task SaveAsync(BlobProviderSaveArgs args) { var blobName = AwsBlobNameCalculator.Calculate(args); var configuration = args.Configuration.GetAwsConfiguration(); @@ -48,7 +48,7 @@ namespace Volo.Abp.BlobStoring.Aws } } - public async override Task DeleteAsync(BlobProviderDeleteArgs args) + public override async Task DeleteAsync(BlobProviderDeleteArgs args) { var blobName = AwsBlobNameCalculator.Calculate(args); var containerName = GetContainerName(args); @@ -70,7 +70,7 @@ namespace Volo.Abp.BlobStoring.Aws } } - public async override Task ExistsAsync(BlobProviderExistsArgs args) + public override async Task ExistsAsync(BlobProviderExistsArgs args) { var blobName = AwsBlobNameCalculator.Calculate(args); var containerName = GetContainerName(args); @@ -81,7 +81,7 @@ namespace Volo.Abp.BlobStoring.Aws } } - public async override Task GetOrNullAsync(BlobProviderGetArgs args) + public override async Task GetOrNullAsync(BlobProviderGetArgs args) { var blobName = AwsBlobNameCalculator.Calculate(args); var containerName = GetContainerName(args); diff --git a/framework/src/Volo.Abp.BlobStoring.Azure/Volo/Abp/BlobStoring/Azure/AzureBlobProvider.cs b/framework/src/Volo.Abp.BlobStoring.Azure/Volo/Abp/BlobStoring/Azure/AzureBlobProvider.cs index 3a9a062e76..1afc3b6a53 100644 --- a/framework/src/Volo.Abp.BlobStoring.Azure/Volo/Abp/BlobStoring/Azure/AzureBlobProvider.cs +++ b/framework/src/Volo.Abp.BlobStoring.Azure/Volo/Abp/BlobStoring/Azure/AzureBlobProvider.cs @@ -15,7 +15,7 @@ namespace Volo.Abp.BlobStoring.Azure AzureBlobNameCalculator = azureBlobNameCalculator; } - public async override Task SaveAsync(BlobProviderSaveArgs args) + public override async Task SaveAsync(BlobProviderSaveArgs args) { var blobName = AzureBlobNameCalculator.Calculate(args); var configuration = args.Configuration.GetAzureConfiguration(); @@ -33,7 +33,7 @@ namespace Volo.Abp.BlobStoring.Azure await GetBlobClient(args, blobName).UploadAsync(args.BlobStream, true); } - public async override Task DeleteAsync(BlobProviderDeleteArgs args) + public override async Task DeleteAsync(BlobProviderDeleteArgs args) { var blobName = AzureBlobNameCalculator.Calculate(args); @@ -45,14 +45,14 @@ namespace Volo.Abp.BlobStoring.Azure return false; } - public async override Task ExistsAsync(BlobProviderExistsArgs args) + public override async Task ExistsAsync(BlobProviderExistsArgs args) { var blobName = AzureBlobNameCalculator.Calculate(args); return await BlobExistsAsync(args, blobName); } - public async override Task GetOrNullAsync(BlobProviderGetArgs args) + public override async Task GetOrNullAsync(BlobProviderGetArgs args) { var blobName = AzureBlobNameCalculator.Calculate(args); diff --git a/framework/src/Volo.Abp.BlobStoring.FileSystem/Volo/Abp/BlobStoring/FileSystem/FileSystemBlobProvider.cs b/framework/src/Volo.Abp.BlobStoring.FileSystem/Volo/Abp/BlobStoring/FileSystem/FileSystemBlobProvider.cs index 3a512a0ba3..cbfe4bcaf7 100644 --- a/framework/src/Volo.Abp.BlobStoring.FileSystem/Volo/Abp/BlobStoring/FileSystem/FileSystemBlobProvider.cs +++ b/framework/src/Volo.Abp.BlobStoring.FileSystem/Volo/Abp/BlobStoring/FileSystem/FileSystemBlobProvider.cs @@ -16,7 +16,7 @@ namespace Volo.Abp.BlobStoring.FileSystem FilePathCalculator = filePathCalculator; } - public async override Task SaveAsync(BlobProviderSaveArgs args) + public override async Task SaveAsync(BlobProviderSaveArgs args) { var filePath = FilePathCalculator.Calculate(args); @@ -59,7 +59,7 @@ namespace Volo.Abp.BlobStoring.FileSystem return ExistsAsync(filePath); } - public async override Task GetOrNullAsync(BlobProviderGetArgs args) + public override async Task GetOrNullAsync(BlobProviderGetArgs args) { var filePath = FilePathCalculator.Calculate(args); diff --git a/framework/src/Volo.Abp.BlobStoring.Minio/Volo/Abp/BlobStoring/Minio/MinioBlobProvider.cs b/framework/src/Volo.Abp.BlobStoring.Minio/Volo/Abp/BlobStoring/Minio/MinioBlobProvider.cs index fca23324dc..8e18f9dedb 100644 --- a/framework/src/Volo.Abp.BlobStoring.Minio/Volo/Abp/BlobStoring/Minio/MinioBlobProvider.cs +++ b/framework/src/Volo.Abp.BlobStoring.Minio/Volo/Abp/BlobStoring/Minio/MinioBlobProvider.cs @@ -16,7 +16,7 @@ namespace Volo.Abp.BlobStoring.Minio MinioBlobNameCalculator = minioBlobNameCalculator; } - public async override Task SaveAsync(BlobProviderSaveArgs args) + public override async Task SaveAsync(BlobProviderSaveArgs args) { var blobName = MinioBlobNameCalculator.Calculate(args); var configuration = args.Configuration.GetMinioConfiguration(); @@ -36,7 +36,7 @@ namespace Volo.Abp.BlobStoring.Minio await client.PutObjectAsync(containerName, blobName, args.BlobStream, args.BlobStream.Length); } - public async override Task DeleteAsync(BlobProviderDeleteArgs args) + public override async Task DeleteAsync(BlobProviderDeleteArgs args) { var blobName = MinioBlobNameCalculator.Calculate(args); var client = GetMinioClient(args); @@ -51,7 +51,7 @@ namespace Volo.Abp.BlobStoring.Minio return false; } - public async override Task ExistsAsync(BlobProviderExistsArgs args) + public override async Task ExistsAsync(BlobProviderExistsArgs args) { var blobName = MinioBlobNameCalculator.Calculate(args); var client = GetMinioClient(args); @@ -60,7 +60,7 @@ namespace Volo.Abp.BlobStoring.Minio return await BlobExistsAsync(client, containerName, blobName); } - public async override Task GetOrNullAsync(BlobProviderGetArgs args) + public override async Task GetOrNullAsync(BlobProviderGetArgs args) { var blobName = MinioBlobNameCalculator.Calculate(args); var client = GetMinioClient(args); diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapter.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapter.cs index 7a99859d3a..433fde192f 100644 --- a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapter.cs +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapter.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.Castle.DynamicProxy Proceed = proceed; } - public async override Task ProceedAsync() + public override async Task ProceedAsync() { await Proceed(Invocation, ProceedInfo); } diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapterWithReturnValue.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapterWithReturnValue.cs index a0babad231..ef1c0ae54d 100644 --- a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapterWithReturnValue.cs +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapterWithReturnValue.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.Castle.DynamicProxy Proceed = proceed; } - public async override Task ProceedAsync() + public override async Task ProceedAsync() { ReturnValue = await Proceed(Invocation, ProceedInfo); } diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs index 6d08e8f6a6..8a0c4fdd45 100644 --- a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs @@ -15,14 +15,14 @@ namespace Volo.Abp.Castle.DynamicProxy _abpInterceptor = abpInterceptor; } - protected async override Task InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func proceed) + protected override async Task InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func proceed) { await _abpInterceptor.InterceptAsync( new CastleAbpMethodInvocationAdapter(invocation, proceedInfo, proceed) ); } - protected async override Task InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func> proceed) + protected override async Task InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func> proceed) { var adapter = new CastleAbpMethodInvocationAdapterWithReturnValue(invocation, proceedInfo, proceed); diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/BackgroundEmailSendingJob.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/BackgroundEmailSendingJob.cs index 5c704f74f0..a81bfb8c7f 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/BackgroundEmailSendingJob.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/BackgroundEmailSendingJob.cs @@ -14,7 +14,7 @@ namespace Volo.Abp.Emailing EmailSender = emailSender; } - public async override Task ExecuteAsync(BackgroundEmailSendingJobArgs args) + public override async Task ExecuteAsync(BackgroundEmailSendingJobArgs args) { if (args.From.IsNullOrWhiteSpace()) { diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/SmtpEmailSender.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/SmtpEmailSender.cs index 710febff9d..24ca7d6a34 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/SmtpEmailSender.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/SmtpEmailSender.cs @@ -67,7 +67,7 @@ namespace Volo.Abp.Emailing.Smtp } } - protected async override Task SendEmailAsync(MailMessage mail) + protected override async Task SendEmailAsync(MailMessage mail) { using (var smtpClient = await BuildClientAsync()) { 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 43a17ddf33..42423cbf3b 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs @@ -146,7 +146,7 @@ namespace Volo.Abp.EntityFrameworkCore } } - public async override Task SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default) + public override async Task SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default) { try { 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 363744c1d4..fd6d773952 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 @@ -146,7 +146,7 @@ namespace Volo.Abp.EventBus.Kafka GetOrCreateHandlerFactories(eventType).Locking(factories => factories.Clear()); } - public async override Task PublishAsync(Type eventType, object eventData) + public override async Task PublishAsync(Type eventType, object eventData) { var eventName = EventNameAttribute.GetNameOrDefault(eventType); var body = Serializer.Serialize(eventData); 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 44d229ee94..ce3549646e 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 @@ -124,7 +124,7 @@ namespace Volo.Abp.EventBus.Rebus return Subscribe(typeof(TEvent), handler); } - public async override Task PublishAsync(Type eventType, object eventData) + public override async Task PublishAsync(Type eventType, object eventData) { await AbpRebusEventBusOptions.Publish(Rebus, eventType, eventData); } 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 828bd4f5c7..8c7bef6f2d 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 @@ -117,7 +117,7 @@ namespace Volo.Abp.EventBus.Local GetOrCreateHandlerFactories(eventType).Locking(factories => factories.Clear()); } - public async override Task PublishAsync(Type eventType, object eventData) + public override async Task PublishAsync(Type eventType, object eventData) { var exceptions = new List(); diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs index 3bb039f7b2..db8ec4774f 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.Features PrincipalAccessor = principalAccessor; } - public async override Task GetOrNullAsync(FeatureDefinition feature) + public override async Task GetOrNullAsync(FeatureDefinition feature) { var editionId = PrincipalAccessor.Principal?.FindEditionId(); if (editionId == null) diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs index b52ffe355e..84257df293 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs @@ -35,7 +35,7 @@ namespace Volo.Abp.Features ); } - public async override Task GetOrNullAsync(string name) + public override async Task GetOrNullAsync(string name) { var featureDefinition = FeatureDefinitionManager.Get(name); var providers = Enumerable diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/TenantFeatureValueProvider.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/TenantFeatureValueProvider.cs index 6e4dc669fa..2e6f72a9c6 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/TenantFeatureValueProvider.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/TenantFeatureValueProvider.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.Features CurrentTenant = currentTenant; } - public async override Task GetOrNullAsync(FeatureDefinition feature) + public override async Task GetOrNullAsync(FeatureDefinition feature) { return await FeatureStore.GetOrNullAsync(feature.Name, Name, CurrentTenant.Id?.ToString()); } diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextIdentityModelRemoteServiceHttpClientAuthenticator.cs b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextIdentityModelRemoteServiceHttpClientAuthenticator.cs index f3001eb443..a829a630d6 100644 --- a/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextIdentityModelRemoteServiceHttpClientAuthenticator.cs +++ b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextIdentityModelRemoteServiceHttpClientAuthenticator.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.Http.Client.IdentityModel.Web { } - public async override Task Authenticate(RemoteServiceHttpClientAuthenticateContext context) + public override async Task Authenticate(RemoteServiceHttpClientAuthenticateContext context) { if (context.RemoteService.GetUseCurrentAccessToken() != false) { diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel.WebAssembly/Volo/Abp/Http/Client/IdentityModel/WebAssembly/AccessTokenProviderIdentityModelRemoteServiceHttpClientAuthenticator.cs b/framework/src/Volo.Abp.Http.Client.IdentityModel.WebAssembly/Volo/Abp/Http/Client/IdentityModel/WebAssembly/AccessTokenProviderIdentityModelRemoteServiceHttpClientAuthenticator.cs index 0e0b659ef1..c86fc095c7 100644 --- a/framework/src/Volo.Abp.Http.Client.IdentityModel.WebAssembly/Volo/Abp/Http/Client/IdentityModel/WebAssembly/AccessTokenProviderIdentityModelRemoteServiceHttpClientAuthenticator.cs +++ b/framework/src/Volo.Abp.Http.Client.IdentityModel.WebAssembly/Volo/Abp/Http/Client/IdentityModel/WebAssembly/AccessTokenProviderIdentityModelRemoteServiceHttpClientAuthenticator.cs @@ -20,7 +20,7 @@ namespace Volo.Abp.Http.Client.IdentityModel.WebAssembly AccessTokenProvider = accessTokenProvider; } - public async override Task Authenticate(RemoteServiceHttpClientAuthenticateContext context) + public override async Task Authenticate(RemoteServiceHttpClientAuthenticateContext context) { if (context.RemoteService.GetUseCurrentAccessToken() != false) { diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs index 48ba2f1a4f..7eb4e5ad78 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs @@ -75,7 +75,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying Logger = NullLogger>.Instance; } - public async override Task InterceptAsync(IAbpMethodInvocation invocation) + public override async Task InterceptAsync(IAbpMethodInvocation invocation) { if (invocation.Method.ReturnType.GenericTypeArguments.IsNullOrEmpty()) { diff --git a/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs b/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs index d089f7b684..0fb93e8f40 100644 --- a/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs +++ b/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs @@ -28,7 +28,7 @@ namespace Volo.Abp.MailKit SmtpConfiguration = smtpConfiguration; } - protected async override Task SendEmailAsync(MailMessage mail) + protected override async Task SendEmailAsync(MailMessage mail) { using (var client = await BuildClientAsync()) { diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/TenantSettingValueProvider.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/TenantSettingValueProvider.cs index 6286356a04..9c1d34b741 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/TenantSettingValueProvider.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/TenantSettingValueProvider.cs @@ -19,12 +19,12 @@ namespace Volo.Abp.Settings CurrentTenant = currentTenant; } - public async override Task GetOrNullAsync(SettingDefinition setting) + public override async Task GetOrNullAsync(SettingDefinition setting) { return await SettingStore.GetOrNullAsync(setting.Name, Name, CurrentTenant.Id?.ToString()); } - public async override Task> GetAllAsync(SettingDefinition[] settings) + public override async Task> GetAllAsync(SettingDefinition[] settings) { return await SettingStore.GetAllAsync(settings.Select(x => x.Name).ToArray(), Name, CurrentTenant.Id?.ToString()); } diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/UserSettingValueProvider.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/UserSettingValueProvider.cs index 8c337bbee4..08ac6cc471 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/UserSettingValueProvider.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/UserSettingValueProvider.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.Settings CurrentUser = currentUser; } - public async override Task GetOrNullAsync(SettingDefinition setting) + public override async Task GetOrNullAsync(SettingDefinition setting) { if (CurrentUser.Id == null) { @@ -29,7 +29,7 @@ namespace Volo.Abp.Settings return await SettingStore.GetOrNullAsync(setting.Name, Name, CurrentUser.Id.ToString()); } - public async override Task> GetAllAsync(SettingDefinition[] settings) + public override async Task> GetAllAsync(SettingDefinition[] settings) { if (CurrentUser.Id == null) { diff --git a/framework/test/Volo.Abp.BlobStoring.Minio.Tests/Volo/Abp/BlobStoring/Minio/AbpBlobStoringMinioTestModule.cs b/framework/test/Volo.Abp.BlobStoring.Minio.Tests/Volo/Abp/BlobStoring/Minio/AbpBlobStoringMinioTestModule.cs index a448c2160e..776cc32c36 100644 --- a/framework/test/Volo.Abp.BlobStoring.Minio.Tests/Volo/Abp/BlobStoring/Minio/AbpBlobStoringMinioTestModule.cs +++ b/framework/test/Volo.Abp.BlobStoring.Minio.Tests/Volo/Abp/BlobStoring/Minio/AbpBlobStoringMinioTestModule.cs @@ -60,7 +60,7 @@ namespace Volo.Abp.BlobStoring.Minio }); } - public async override void OnApplicationShutdown(ApplicationShutdownContext context) + public override async void OnApplicationShutdown(ApplicationShutdownContext context) { var minioClient = new MinioClient(_endPoint, _accessKey, _secretKey); if (await minioClient.BucketExistsAsync(_randomContainerName)) diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleAsyncInterceptor.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleAsyncInterceptor.cs index 7f38276df2..029073a310 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleAsyncInterceptor.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleAsyncInterceptor.cs @@ -5,7 +5,7 @@ namespace Volo.Abp.DynamicProxy { public class SimpleAsyncInterceptor : AbpInterceptor { - public async override Task InterceptAsync(IAbpMethodInvocation invocation) + public override async Task InterceptAsync(IAbpMethodInvocation invocation) { await Task.Delay(5); (invocation.TargetObject as ICanLogOnObject)?.Logs?.Add($"{GetType().Name}_InterceptAsync_BeforeInvocation"); diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleResultCacheTestInterceptor.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleResultCacheTestInterceptor.cs index ebbf890b14..f19864f554 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleResultCacheTestInterceptor.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleResultCacheTestInterceptor.cs @@ -13,7 +13,7 @@ namespace Volo.Abp.DynamicProxy _cache = new ConcurrentDictionary(); } - public async override Task InterceptAsync(IAbpMethodInvocation invocation) + public override async Task InterceptAsync(IAbpMethodInvocation invocation) { if (_cache.ContainsKey(invocation.Method)) { diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests.cs index f998da8528..09b1551e3d 100644 --- a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests.cs +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests.cs @@ -51,7 +51,7 @@ namespace Volo.Abp.MongoDB.Repositories } [Fact] - public async override Task InsertAsync() + public override async Task InsertAsync() { var person = new Person(Guid.NewGuid(), "New Person", 35); person.Phones.Add(new Phone(person.Id, "1234567890")); diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/DistrictAppService.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/DistrictAppService.cs index 772db07e72..f7e7fde5e2 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/DistrictAppService.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/DistrictAppService.cs @@ -15,12 +15,12 @@ namespace Volo.Abp.TestApp.Application { } - protected async override Task DeleteByIdAsync(DistrictKey id) + protected override async Task DeleteByIdAsync(DistrictKey id) { await Repository.DeleteAsync(d => d.CityId == id.CityId && d.Name == id.Name); } - protected async override Task GetEntityByIdAsync(DistrictKey id) + protected override async Task GetEntityByIdAsync(DistrictKey id) { return await AsyncExecuter.FirstOrDefaultAsync( Repository.Where(d => d.CityId == id.CityId && d.Name == id.Name) From 9019cdb99bef515b7efb0a81aad37959652bb86f Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 11 Jan 2021 10:36:07 +0800 Subject: [PATCH 362/493] Consider port in DomainTenantResolveContributor. --- .../MultiTenancy/DomainTenantResolveContributor.cs | 7 ++++++- .../AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/DomainTenantResolveContributor.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/DomainTenantResolveContributor.cs index 7fa2038020..255e0ac89b 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/DomainTenantResolveContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/DomainTenantResolveContributor.cs @@ -25,7 +25,12 @@ namespace Volo.Abp.AspNetCore.MultiTenancy protected override Task GetTenantIdOrNameFromHttpContextOrNullAsync(ITenantResolveContext context, HttpContext httpContext) { - var hostName = httpContext.Request.Host.Host.RemovePreFix(ProtocolPrefixes); + if (!httpContext.Request.Host.HasValue) + { + return Task.FromResult(null); + } + + var hostName = httpContext.Request.Host.Value.RemovePreFix(ProtocolPrefixes); var extractResult = FormattedStringValueExtracter.Extract(hostName, _domainFormat, ignoreCase: true); context.Handled = true; diff --git a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs index e2ac111f5d..7a7244aa69 100644 --- a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs @@ -38,7 +38,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy services.Configure(options => { - options.AddDomainTenantResolver("{0}.abp.io"); + options.AddDomainTenantResolver("{0}.abp.io:8080"); }); }); } @@ -46,14 +46,14 @@ namespace Volo.Abp.AspNetCore.MultiTenancy [Fact] public async Task Should_Use_Host_If_Tenant_Is_Not_Specified() { - var result = await GetResponseAsObjectAsync>("http://abp.io"); + var result = await GetResponseAsObjectAsync>("http://abp.io:8080"); result["TenantId"].ShouldBe(""); } [Fact] public async Task Should_Use_Domain_If_Specified() { - var result = await GetResponseAsObjectAsync>("http://acme.abp.io"); + var result = await GetResponseAsObjectAsync>("http://acme.abp.io:8080"); result["TenantId"].ShouldBe(_testTenantId.ToString()); } @@ -62,8 +62,8 @@ namespace Volo.Abp.AspNetCore.MultiTenancy { Client.DefaultRequestHeaders.Add(_options.TenantKey, Guid.NewGuid().ToString()); - var result = await GetResponseAsObjectAsync>("http://acme.abp.io"); + var result = await GetResponseAsObjectAsync>("http://acme.abp.io:8080"); result["TenantId"].ShouldBe(_testTenantId.ToString()); } } -} \ No newline at end of file +} From 1fb5408368de5e4b4afdde08375223e159120534 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 11 Jan 2021 16:31:20 +0800 Subject: [PATCH 363/493] ABP.IO platform localization. --- .../Base/Localization/Resources/zh-Hans.json | 2 ++ .../Localization/Resources/zh-Hans.json | 8 +++-- .../Localization/Resources/zh-Hans.json | 31 +++++++++++++++++-- .../Www/Localization/Resources/zh-Hans.json | 1 + 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json index 79493b537e..f061408c98 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json @@ -27,6 +27,8 @@ "Blog": "博客", "Commercial": "商业版", "MyAccount": "我的账户", + "Permission:License": "许可", + "Permission:UserInfo": "用户信息", "SeeDocuments": "查看文档", "Samples": "示例" } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json index 0147e71a05..82c23450a0 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json @@ -28,8 +28,12 @@ "MyOrganizations": "我的组织", "ApiKey": "API key", "UserNameNotFound": "没有用户名为{0}的用户", - "SuccessfullyAddedToNewsletter": "感谢你订阅我们的新闻通讯!", + "SuccessfullyAddedToNewsletter": "感谢你订阅我们的新闻简讯!", "MyProfile": "我的资料", - "EmailNotValid": "请输入有效的电子邮件地址" + "EmailNotValid": "请输入有效的电子邮件地址", + "JoinOurMarketingNewsletter": "加入我们的营销简讯", + "WouldLikeToReceiveMarketingMaterials": "我想收到市场营销资料,例如产品交易和特别优惠.", + "StartUsingYourLicenseNow": "立即开始使用你的许可证", + "WelcomePage": "欢迎页面" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json index fa793c91a0..49b819227f 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json @@ -35,7 +35,6 @@ "EmailNotValid": "请输入有效的电子邮箱地址.", "FeatureRequest": "功能请求", "CreateArticleTitleInfo": "文章标题显示在文章列表中.", - "CreateArticleUrlInfo": "文章的原始GitHub/外部URL.", "CreateArticleSummaryInfo": "文章的简短摘要将显示在文章列表中.", "CreateArticleCoverInfo": "为了创建有效的文章,请添加封面图. 仅支持16:9的图片!", "ThisExtensionIsNotAllowed": "不允许此扩展名.", @@ -84,6 +83,34 @@ "Edit": "修改", "ProfileImageChange": "更改资料图片", "BlogItemErrorMessage": "无法从ABP获取最新的博客文章详细信息.", - "PlannedReleaseDate": "计划发布日期" + "PlannedReleaseDate": "计划发布日期", + "CommunityArticleRequestErrorMessage": "无法从Github获取最新的文章请求.", + "ArticleRequestFromGithubIssue": "现在没有任何文章请求.", + "LatestArticles": "最新的帖子", + "ArticleRequests": "文章请求", + "AllArticleRequests": "查看所有文章请求", + "SubscribeToTheNewsletter": "订阅简讯", + "NewsletterEmailDefinition": "获取有关ABP发生的信息,例如新版本,免费资源,文章等.", + "NoThanks": "不用了,谢谢", + "MaybeLater": "以后再说", + "JoinOurArticleNewsletter": "加入我们的文章简讯", + "Community": "社区", + "Marketing": "营销", + "CommunityPrivacyPolicyConfirmation": "我同意条款和条件以及隐私政策.", + "ArticleRequestMessageTitle": "在GitHub上创建一个Issue,以请求你要在此网站上查看的文章/教程.", + "ArticleRequestMessageBody": "在这里,是社区请求的文章列表. 您要写一篇要求的文章吗? 请单击该请求并加入讨论.", + "Language": "语言", + "CreateArticleLanguageInfo": "本文所用的语言", + "VideoPost": "视频", + "Article": "文章", + "Read": "阅读", + "CreateGithubArticleUrlInfo": "文章的原始GitHub链接.", + "CreateVideoContentUrlInfo": "文章的原始Youtube链接.", + "CreateExternalArticleUrlInfo": "本文的原始外部网址", + "VideoContentForm": "视频内容来源", + "GithubPostForm": "Github文章来源", + "ExternalPostForm": "外部文章来源", + "PostSourceTypeChooses": "我们接受文章的三种来源类型;", + "Posts": "文章" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json index caf52554d1..7101efcbd2 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json @@ -192,6 +192,7 @@ "MultipleUIOptions": "多个UI选项", "MultipleDBOptions": "多个数据库提供程序", "MultipleUIOptionsExplanation": "核心框架设计为独立与UI,可以和任何类型的UI系统一起使用. 同时提供了多个开箱即用的预构建集成选项.", + "MultipleDBOptionsExplanation": "该框架可以使用任何数据源,而以下提供程序已得到正式开发和支持;", "SelectLanguage": "選擇語言" } } \ No newline at end of file From 51b1dfeac81520527f7031ad35a6b6071d7fd8df Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 11 Jan 2021 16:35:58 +0800 Subject: [PATCH 364/493] Update zh-Hans.json --- .../Www/Localization/Resources/zh-Hans.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json index 7101efcbd2..d01d847716 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json @@ -192,7 +192,7 @@ "MultipleUIOptions": "多个UI选项", "MultipleDBOptions": "多个数据库提供程序", "MultipleUIOptionsExplanation": "核心框架设计为独立与UI,可以和任何类型的UI系统一起使用. 同时提供了多个开箱即用的预构建集成选项.", - "MultipleDBOptionsExplanation": "该框架可以使用任何数据源,而以下提供程序已得到正式开发和支持;", - "SelectLanguage": "選擇語言" + "MultipleDBOptionsExplanation": "该框架可以使用任何数据源,并且以下提供程序已得到正式开发和支持;", + "SelectLanguage": "选择语言" } -} \ No newline at end of file +} From 02e993a82d3e2d44357f23c02696a019f6702162 Mon Sep 17 00:00:00 2001 From: zfmy Date: Mon, 11 Jan 2021 17:30:08 +0800 Subject: [PATCH 365/493] a typo fixed in Abp.MongoDB --- .../Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs index ff367dc554..90605f416e 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs @@ -22,7 +22,7 @@ namespace Volo.Abp.Domain.Repositories return repository.ToMongoDbRepository().GetDatabaseAsync(); } - [Obsolete("Use GetCollection method.")] + [Obsolete("Use GetCollectionAsync method.")] public static IMongoCollection GetCollection(this IBasicRepository repository) where TEntity : class, IEntity { From 4aec6a9245fe005d19993365fa88c14cbea6e655 Mon Sep 17 00:00:00 2001 From: zfmy Date: Mon, 11 Jan 2021 17:36:30 +0800 Subject: [PATCH 366/493] fix namespace for IMongoDbBulkOperationProvider --- .../Repositories/MongoDB/IMongoDbBulkOperationProvider.cs | 3 +-- .../Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs index fda7f291c7..cdb91aa4a7 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs @@ -3,9 +3,8 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Entities; -using Volo.Abp.Domain.Repositories.MongoDB; -namespace Volo.Abp.MongoDB.Volo.Abp.Domain.Repositories.MongoDB +namespace Volo.Abp.Domain.Repositories.MongoDB { public interface IMongoDbBulkOperationProvider { diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index 537f6cdad3..b252c48999 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -16,7 +16,6 @@ using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Local; using Volo.Abp.Guids; using Volo.Abp.MongoDB; -using Volo.Abp.MongoDB.Volo.Abp.Domain.Repositories.MongoDB; namespace Volo.Abp.Domain.Repositories.MongoDB { From d514194bea772524f5552df4e6826608d09a7c0c Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 11 Jan 2021 13:45:51 +0300 Subject: [PATCH 367/493] chore: upgrade ng-zorro-and version to the latest --- npm/ng-packs/packages/components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/components/package.json b/npm/ng-packs/packages/components/package.json index 68b26abf8c..243deddcd0 100644 --- a/npm/ng-packs/packages/components/package.json +++ b/npm/ng-packs/packages/components/package.json @@ -11,7 +11,7 @@ "@ng-bootstrap/ng-bootstrap": ">=6.0.0" }, "dependencies": { - "ng-zorro-antd": "^9.3.0", + "ng-zorro-antd": "^11.0.0", "tslib": "^2.0.0" }, "publishConfig": { From 93188c06732cf5511a79865c451f0e5b6d18bfd1 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 11 Jan 2021 13:46:06 +0300 Subject: [PATCH 368/493] chore: add start script to package.json of the verdaccio-containers --- npm/verdaccio-containers/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/verdaccio-containers/package.json b/npm/verdaccio-containers/package.json index 310b896fb9..06866c853a 100644 --- a/npm/verdaccio-containers/package.json +++ b/npm/verdaccio-containers/package.json @@ -4,7 +4,8 @@ "description": "", "main": "index.js", "scripts": { - "prepare": "node prepare" + "prepare": "node prepare", + "start": "docker-compose rm -f && docker-compose build --build-arg next_version=\"4.1.0\" && docker-compose up" }, "keywords": [], "author": "", From e1f176639176e74dd54b73d29177b69f71617325 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 11 Jan 2021 13:52:16 +0300 Subject: [PATCH 369/493] chore: reinstall the ng-packs packages --- npm/ng-packs/package.json | 2 +- npm/ng-packs/yarn.lock | 479 ++++++++++++++++++++------------------ 2 files changed, 256 insertions(+), 225 deletions(-) diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index d604dd533b..8fb4c748b4 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -80,7 +80,7 @@ "just-compare": "^1.3.0", "lerna": "^3.19.0", "ng-packagr": "^11.0.1", - "ng-zorro-antd": "^10.1.1", + "ng-zorro-antd": "^11.0.1", "ngxs-schematic": "^1.1.9", "prettier": "^2.2.0", "protractor": "~7.0.0", diff --git a/npm/ng-packs/yarn.lock b/npm/ng-packs/yarn.lock index bc2c1e46f5..69e3985105 100644 --- a/npm/ng-packs/yarn.lock +++ b/npm/ng-packs/yarn.lock @@ -2,12 +2,12 @@ # yarn lockfile v1 -"@abp/ng.core@~4.1.0-rc.2": - version "4.1.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/ng.core/-/ng.core-4.1.0-rc.2.tgz#5fe53658965af66fae655dfce4bf6a7ad7105032" - integrity sha512-NcjOn1HYIdLTdHPbWTiLywPp1jQ+zmoeknnb0q/JfUUDn5r5kPrCf85xiZBUo8e+2ViB5vXvkM5lOOD5RfES6A== +"@abp/ng.core@~4.1.0", "@abp/ng.core@~4.1.0-rc.2": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@abp/ng.core/-/ng.core-4.1.0.tgz#be90be576300e9f379775484bc22643013e79b74" + integrity sha512-Jd9d4qIAzrhmU4cyZXCS4qOHIDQRJpirwxKwaPooKeeNrNs1HqVVLTNAlhGC/ofmukYsiJC99wpmd7pvUN2tBA== dependencies: - "@abp/utils" "^4.1.0-rc.1" + "@abp/utils" "^4.1.0-rc.2" "@angular/localize" "~10.0.10" "@ngxs/store" "^3.7.0" angular-oauth2-oidc "^10.0.0" @@ -17,35 +17,35 @@ ts-toolbelt "6.15.4" tslib "^2.0.0" -"@abp/ng.feature-management@~4.1.0-rc.2": - version "4.1.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/ng.feature-management/-/ng.feature-management-4.1.0-rc.2.tgz#02e760bfa913276e694dbff545e39210a69b21bd" - integrity sha512-vf//thBD3ve8tkmAIan2FqQeHrO/sP8NVV83noGVMTpqKIAWIu7PBuSL3YqcNVOVxHLsO6EIwr63OAJytlvH6A== +"@abp/ng.feature-management@~4.1.0", "@abp/ng.feature-management@~4.1.0-rc.2": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@abp/ng.feature-management/-/ng.feature-management-4.1.0.tgz#5e87592d276315994fa1b5f35f2a568476d9cf3d" + integrity sha512-PJM/rj5mjzGHXUEKa6UWbhhgjJafoKkHTYW/4+4KNM8tmwggNS+YmwOj0xdqfQlF1aYtUsMWpI0koMbtqgBH/A== dependencies: - "@abp/ng.theme.shared" "~4.1.0-rc.2" + "@abp/ng.theme.shared" "~4.1.0" tslib "^2.0.0" "@abp/ng.identity@~4.1.0-rc.2": - version "4.1.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/ng.identity/-/ng.identity-4.1.0-rc.2.tgz#381d956cebe2f3c272c59567ff424d3729adb6aa" - integrity sha512-4Wnx/iXAOgdexDYuNTV+DBdnjyfhcgca1ZiUSuEnSVDKePq0xvpGeKvpXzhhm9T3uXNsqYwqNq/X5jK3jd6mZg== + version "4.1.0" + resolved "https://registry.yarnpkg.com/@abp/ng.identity/-/ng.identity-4.1.0.tgz#bebf0e4b85f0332313a827cc344c3d9e6af59d33" + integrity sha512-doBqoPtxPdT8e27s4h97ldV6tsMHeKCXpyNiMAlweTFcsXjZjXnVJbuXYvqdoyRItqTbSxSlBKxk+6KRb9lPQQ== dependencies: - "@abp/ng.permission-management" "~4.1.0-rc.2" - "@abp/ng.theme.shared" "~4.1.0-rc.2" + "@abp/ng.permission-management" "~4.1.0" + "@abp/ng.theme.shared" "~4.1.0" tslib "^2.0.0" -"@abp/ng.permission-management@~4.1.0-rc.2": - version "4.1.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/ng.permission-management/-/ng.permission-management-4.1.0-rc.2.tgz#b74402241886e156a0e72baddfbc0ebebb7576aa" - integrity sha512-6/Z/8KGKkAflfk6CoXk92StEELuP0xkwj2dvvFvnGpr2od9ELGWWqtiJ5Pjz6i5FQvrLdqcHqPh8x/vgr7QV9w== +"@abp/ng.permission-management@~4.1.0", "@abp/ng.permission-management@~4.1.0-rc.2": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@abp/ng.permission-management/-/ng.permission-management-4.1.0.tgz#1bf09f21a254c265d75db83e96f48a5706214a08" + integrity sha512-/kc9wFtGmwHW28a2GfroJqUOk6PPlGQ8YNzU37cuN5BBK7909Eu1Q+4a9JigQqCsBGTxVgIpP4WQ2p7CcfIymg== dependencies: - "@abp/ng.theme.shared" "~4.1.0-rc.2" + "@abp/ng.theme.shared" "~4.1.0" tslib "^2.0.0" "@abp/ng.schematics@~4.1.0-rc.2": - version "4.1.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/ng.schematics/-/ng.schematics-4.1.0-rc.2.tgz#31dada6fc1f69d0198f4fb3801b6009d6a0a0c09" - integrity sha512-yVi/C1IbwcOQfXUAe8FSlekdNfoqi/UQvTBQ19h/HGBBDxhqbv6QKjhkaVs/+EOAW8WHWCufyVtQ2/y/jrCeog== + version "4.1.0" + resolved "https://registry.yarnpkg.com/@abp/ng.schematics/-/ng.schematics-4.1.0.tgz#f2b2361ccbe49c7981d3c2fe6b43c745eedc46c1" + integrity sha512-BNpyqkkWBEF8nYZwK+krHjqbbQHHiqUoXe/FspNDkSuVTvC6wGmNe/8BalJLZzPF3lNI8ByNC2/MwrGh/Tzlpg== dependencies: "@angular-devkit/core" "~11.0.2" "@angular-devkit/schematics" "~11.0.2" @@ -54,36 +54,36 @@ typescript "~3.9.2" "@abp/ng.setting-management@~4.1.0-rc.2": - version "4.1.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/ng.setting-management/-/ng.setting-management-4.1.0-rc.2.tgz#4b61bff63fa9d68be5f1c7b8c47049cc1bd8b5a8" - integrity sha512-Df2QS0bsytytUSkQ0KrI/m4pVTpQS708fwl8t3KcpeQ4hlgdg6LtTmhUaY/j6k8M1RJHaKvjPE9Jg6R2daLNGg== + version "4.1.0" + resolved "https://registry.yarnpkg.com/@abp/ng.setting-management/-/ng.setting-management-4.1.0.tgz#8ef31a7f4c75be34f5be78427165f2d2b85ae16e" + integrity sha512-8zH4jCNVwPIGgYlrHSm/0BKje1bFCQBOwAsdlVP6A6GRyOVY/6G5166ZAnEqbim8K6ln5WXPHTHtYnxB7Qur8Q== dependencies: - "@abp/ng.theme.shared" "~4.1.0-rc.2" + "@abp/ng.theme.shared" "~4.1.0" tslib "^2.0.0" "@abp/ng.tenant-management@~4.1.0-rc.2": - version "4.1.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/ng.tenant-management/-/ng.tenant-management-4.1.0-rc.2.tgz#b75b60db124e5246476821da2bfeebd5e5da09b6" - integrity sha512-AnDiMa/M4xSwiSXjyIsBY13BNxm+JMhWiIEb9WAPlk8IUaNDJZH9zHJH/HQSUHdy6dFCmutl5Ezi6U1J9ZHpPQ== + version "4.1.0" + resolved "https://registry.yarnpkg.com/@abp/ng.tenant-management/-/ng.tenant-management-4.1.0.tgz#ec59e469e806a5081b52b1c597c333b49381afe7" + integrity sha512-VZ/qiOz/XbUJT6rb+X9GUhwnBTqTt9UIAlAGiT7qONH/39pqUpe6n5d3lbL5oGGZ+ZxJ6S2/+dSKLC1cFt+Bgg== dependencies: - "@abp/ng.feature-management" "~4.1.0-rc.2" - "@abp/ng.theme.shared" "~4.1.0-rc.2" + "@abp/ng.feature-management" "~4.1.0" + "@abp/ng.theme.shared" "~4.1.0" tslib "^2.0.0" "@abp/ng.theme.basic@~4.1.0-rc.2": - version "4.1.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/ng.theme.basic/-/ng.theme.basic-4.1.0-rc.2.tgz#4c0ccb5386a09cf7d89efaee59c8920265032361" - integrity sha512-2NjHymzE/sgbZ8e+CJ4iMemB+mD6e/VSKA2EkCaekPpXDlp0Z3f2yyhm0jwYqCQPsmCjykdtTpR266yLQOs7ug== + version "4.1.0" + resolved "https://registry.yarnpkg.com/@abp/ng.theme.basic/-/ng.theme.basic-4.1.0.tgz#0931a33ca6cdb7375d77e75611cd7d3542b16c43" + integrity sha512-rI80s3meGZzgHa4Ke5fAhwP79D/MRiThI47ixFhxUyPSP3+ogjziAn98SIsadkcjhH86lsSV9s2uCnzeqReBMg== dependencies: - "@abp/ng.theme.shared" "~4.1.0-rc.2" + "@abp/ng.theme.shared" "~4.1.0" tslib "^2.0.0" -"@abp/ng.theme.shared@~4.1.0-rc.2": - version "4.1.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/ng.theme.shared/-/ng.theme.shared-4.1.0-rc.2.tgz#eaf524ef26f5433ec7ea01d402ba071c42ce1aa6" - integrity sha512-d6dVhV2wer7eeHoT8Y91Bqf7m2r3FVexUp7R+/f93564swuceZGZWSsgntwpHkNdDJaxhLUJ8tG5XMe2deEGTQ== +"@abp/ng.theme.shared@~4.1.0", "@abp/ng.theme.shared@~4.1.0-rc.2": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@abp/ng.theme.shared/-/ng.theme.shared-4.1.0.tgz#e0140bdc9f44609e77097dd046ce3067546fc6ca" + integrity sha512-0YtyVBp/1Tciu+8ORkRVTHSFT7kJGTqH+cdq+FnbqD90JQ5XZjlHcz+h/VhARoB00xbXsG8ZbwCOi/8ZFDg5wQ== dependencies: - "@abp/ng.core" "~4.1.0-rc.2" + "@abp/ng.core" "~4.1.0" "@fortawesome/fontawesome-free" "^5.14.0" "@ng-bootstrap/ng-bootstrap" "^7.0.0" "@ngx-validate/core" "^0.0.13" @@ -92,10 +92,10 @@ chart.js "^2.9.3" tslib "^2.0.0" -"@abp/utils@^4.1.0-rc.1", "@abp/utils@^4.1.0-rc.2": - version "4.1.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.1.0-rc.2.tgz#eb6dbf0ee493d0f050b37347d2d6d283098aedae" - integrity sha512-V2k5I89lVBoeGIKgg4p2H9GlMAcDWbctwKZPVwBEMVEVm1uTR2xQAWdTdSFd5Q8I8Xsf/aIG8ELM7l5j2h7/zQ== +"@abp/utils@^4.1.0-rc.2": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.1.0.tgz#1f5d8b4dc8a234c15d87869436485fd737f18b50" + integrity sha512-fksnKF1bsOab5AVe8qBs2HZmcRVjrnsMwXs23xaqSRdpWXpPgsLRuKCJHlD0usREyerDGPkpY5opUnXWggHvCg== dependencies: just-compare "^1.3.0" @@ -117,12 +117,12 @@ "@angular-devkit/core" "10.1.7" rxjs "6.6.2" -"@angular-devkit/architect@0.1100.5": - version "0.1100.5" - resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1100.5.tgz#3cf9b25464d484160b10417668efbdbd15c9e492" - integrity sha512-yOYfucNouc1doTbcGbCNMXGMSc36+j97XpdNoeGyzFQ7GwezLAro0a9gxc5PdOxndfelkND7J1JuOjxdW5O17A== +"@angular-devkit/architect@0.1100.6": + version "0.1100.6" + resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1100.6.tgz#ce90ffb78d1d945cafc339d4cfc63b3582cb8e6a" + integrity sha512-4O+cg3AimI2bNAxxdu5NrqSf4Oa8r8xL0+G2Ycd3jLoFv0h0ecJiNKEG5F6IpTprb4aexZD6pcxBJCqQ8MmzWQ== dependencies: - "@angular-devkit/core" "11.0.5" + "@angular-devkit/core" "11.0.6" rxjs "6.6.3" "@angular-devkit/architect@>=0.1000.0 < 0.1100.0": @@ -134,14 +134,14 @@ rxjs "6.6.2" "@angular-devkit/build-angular@~0.1100.0": - version "0.1100.5" - resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-0.1100.5.tgz#36a609a334369d9597ac50731f458440ffdbb2d1" - integrity sha512-lJYsnBImBAqUAIVC2qGY64UaC2uWOPZEpSWjYUxkRZA/c4IVCJj3M12CgONBjtcKYzFVXc1eojhrScukGIJJcg== - dependencies: - "@angular-devkit/architect" "0.1100.5" - "@angular-devkit/build-optimizer" "0.1100.5" - "@angular-devkit/build-webpack" "0.1100.5" - "@angular-devkit/core" "11.0.5" + version "0.1100.6" + resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-0.1100.6.tgz#4aa7635ab8fc1c6435b2b93954c08f2a7d7a8dd9" + integrity sha512-HcqsWiSIUxExGg3HRQScLOmF+ckVkCKolfpPcNOCCpBYxH/i8n4wDGLBP5Rtxky+0Qz+3nnAaFIpNb9p9aUmbg== + dependencies: + "@angular-devkit/architect" "0.1100.6" + "@angular-devkit/build-optimizer" "0.1100.6" + "@angular-devkit/build-webpack" "0.1100.6" + "@angular-devkit/core" "11.0.6" "@babel/core" "7.12.3" "@babel/generator" "7.12.1" "@babel/plugin-transform-runtime" "7.12.1" @@ -149,7 +149,7 @@ "@babel/runtime" "7.12.1" "@babel/template" "7.10.4" "@jsdevtools/coverage-istanbul-loader" "3.0.5" - "@ngtools/webpack" "11.0.5" + "@ngtools/webpack" "11.0.6" ansi-colors "4.1.1" autoprefixer "9.8.6" babel-loader "8.1.0" @@ -216,10 +216,10 @@ "@angular-devkit/architect" "0.1001.7" rxjs "6.6.2" -"@angular-devkit/build-optimizer@0.1100.5": - version "0.1100.5" - resolved "https://registry.yarnpkg.com/@angular-devkit/build-optimizer/-/build-optimizer-0.1100.5.tgz#25de00e9cbea1444f911aa0a7a53a05800c90d62" - integrity sha512-aKITFuiydR681eS1z84EIdOtqdxP/V5xGZuF3xjGmg5Ddwv36PweAHaCVJEB4btHSWH6uxMvW2hLXg2RTWbRNg== +"@angular-devkit/build-optimizer@0.1100.6": + version "0.1100.6" + resolved "https://registry.yarnpkg.com/@angular-devkit/build-optimizer/-/build-optimizer-0.1100.6.tgz#4d6712ae75eeae71d74fd161a0a18c08402dc527" + integrity sha512-Qkq7n6510N+nXmfZqpqpI0I6Td+b+06RRNmS7KftSNJntU1z5QYh4FggwlthZ5P0QUT92cnBQsnT8OgYqGnwbg== dependencies: loader-utils "2.0.0" source-map "0.7.3" @@ -227,13 +227,13 @@ typescript "4.0.5" webpack-sources "2.0.1" -"@angular-devkit/build-webpack@0.1100.5": - version "0.1100.5" - resolved "https://registry.yarnpkg.com/@angular-devkit/build-webpack/-/build-webpack-0.1100.5.tgz#81be4b35dc90ea66be205ad1cb9dc44dc31bf9e0" - integrity sha512-oD5t2oCfyiCyyeZckrqBnQco94zIMkRnRGzy3lFDH7KMiL0DG9l7x3nxn9H0YunYWr55LsGWwXGoR7l03Kl+jw== +"@angular-devkit/build-webpack@0.1100.6": + version "0.1100.6" + resolved "https://registry.yarnpkg.com/@angular-devkit/build-webpack/-/build-webpack-0.1100.6.tgz#301caf71bebed6e841cb15fb3af5147c3b2d9c97" + integrity sha512-kK0FlpYJHP25o1yzIGHQqIvO5kp+p6V5OwGpD2GGRZLlJqd3WdjY5DxnyZoX3/IofO6KsTnmm76fzTRqc62z/Q== dependencies: - "@angular-devkit/architect" "0.1100.5" - "@angular-devkit/core" "11.0.5" + "@angular-devkit/architect" "0.1100.6" + "@angular-devkit/core" "11.0.6" rxjs "6.6.3" "@angular-devkit/core@10.0.8": @@ -269,10 +269,10 @@ rxjs "6.6.2" source-map "0.7.3" -"@angular-devkit/core@11.0.5", "@angular-devkit/core@~11.0.2": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-11.0.5.tgz#8239486d2de6c08fc55d2a64f12a7f5d518c8beb" - integrity sha512-hwV8fjF8JNPJkiVWw8MNzeIfDo01aD/OAOlC4L5rQnVHn+i2EiU3brSDmFqyeHPPV3h/QjuBkS3tkN7gSnVWaQ== +"@angular-devkit/core@11.0.6", "@angular-devkit/core@~11.0.2": + version "11.0.6" + resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-11.0.6.tgz#b3ea815ecdea5f77dae58f3f410b268453d7eb8b" + integrity sha512-nhvU5hH01r9qcexAqvIFU233treWWeW3ncs9UFYjD9Hys9sDSvqC3+bvGvl9vCG5FsyY7oDsjaVAipyUc+SFAg== dependencies: ajv "6.12.6" fast-json-stable-stringify "2.1.0" @@ -322,12 +322,12 @@ ora "5.0.0" rxjs "6.6.2" -"@angular-devkit/schematics@11.0.5", "@angular-devkit/schematics@~11.0.2": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-11.0.5.tgz#e5d89451daa644eccce93970709f7cdf44c11982" - integrity sha512-0NKGC8Nf/4vvDpWKB7bwxIazvNnNHnZBX6XlyBXNl+fW8tpTef3PNMJMSErTz9LFnuv61vsKbc36u/Ek2YChWg== +"@angular-devkit/schematics@11.0.6", "@angular-devkit/schematics@~11.0.2": + version "11.0.6" + resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-11.0.6.tgz#06631190cb22609462597cd6659080fc3313582a" + integrity sha512-hCyu/SSSiC6dKl/NxdWctknIrBqKR6pRe7DMArWowrZX6P9oi36LpKEFnKutE8+tXjsOqQj8XMBq9L64sXZWqg== dependencies: - "@angular-devkit/core" "11.0.5" + "@angular-devkit/core" "11.0.6" ora "5.1.0" rxjs "6.6.3" @@ -340,31 +340,31 @@ rxjs "6.4.0" "@angular/animations@~11.0.0": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-11.0.5.tgz#44157c8bbb3f20ce1d3d6386eae956659cefd9d7" - integrity sha512-ghE/xDTYuEWkKNZtioH9JBrSlux0MLHzWoE7tNP+XMaplt80lCm979vWsEBO3/xpQLRmRlGPul6RacCAoeqogg== + version "11.0.7" + resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-11.0.7.tgz#d71ebb581da4e2805df1b35c75a331192063846a" + integrity sha512-P3cluDGIsaj7vqvqIGW7xFCIXWa1lJDsHsmY3Fexk+ZVCncokftp5ZUANb2+DwOD3BPgd/WjBdXVjwzFQFsoVA== dependencies: tslib "^2.0.0" -"@angular/cdk@^10.2.4": - version "10.2.7" - resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-10.2.7.tgz#0ff82eb91b2653ea26909c57a460d4593b44f186" - integrity sha512-ZQjDfTRTn7JuAKsf3jiIdU2XBaxxGBi/ZWYv5Pb3HCl6B4PISsIE5VWRhkoUogoAB0MiFHpjnWeIqknJEm11YQ== +"@angular/cdk@^11.0.2": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-11.0.3.tgz#f5a119e28b4ba21a6f013dfd4de41b16083bd25a" + integrity sha512-hgbJXvZURKBnZawwxUrsZE/3a+HCJh2UhoLIng3cn5Q+WIW/4a37knDl8B9DYKBWrCqeINXNcUHVSKkWc/gjCA== dependencies: tslib "^2.0.0" optionalDependencies: parse5 "^5.0.0" "@angular/cli@~11.0.0": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-11.0.5.tgz#1066d290fc91460f98cedcfbc9a5736340661467" - integrity sha512-k4j/2z7qkuigJ1shH0McW1wW63clhrbrg98FK4/KWhU/sce5AgVjuHDQFycAclTwHesf7Vs6Gzt7zGlqUmeKIg== - dependencies: - "@angular-devkit/architect" "0.1100.5" - "@angular-devkit/core" "11.0.5" - "@angular-devkit/schematics" "11.0.5" - "@schematics/angular" "11.0.5" - "@schematics/update" "0.1100.5" + version "11.0.6" + resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-11.0.6.tgz#8d65d3ad3841aabe23ff38a41fa6c4f38dd12f66" + integrity sha512-bwrXXyU23HjUlFl0CNCU+XMGa/enooqpMLcTAA15StVpKFHyaA4c57il/aqu+1IuB+zR6rGDzhAABuvRcHd+mQ== + dependencies: + "@angular-devkit/architect" "0.1100.6" + "@angular-devkit/core" "11.0.6" + "@angular-devkit/schematics" "11.0.6" + "@schematics/angular" "11.0.6" + "@schematics/update" "0.1100.6" "@yarnpkg/lockfile" "1.1.0" ansi-colors "4.1.1" debug "4.2.0" @@ -382,9 +382,9 @@ uuid "8.3.1" "@angular/common@~11.0.0": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-11.0.5.tgz#7ec508cb7e14cf38640fe4e1c0fa3dd322a52505" - integrity sha512-aoXdTkoni65LWhrPKNsAiOnO70XFaTaisO+K8ZYMpciMTTAxHx3hFCF9sj4a+Bo3M1a5UDjpsFDYMeGgJOkmFA== + version "11.0.7" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-11.0.7.tgz#bc76452161bc0728563bbf05fe10cac492dcfdad" + integrity sha512-9VuT9qrSP7Q91Wp276DDieCIZiTBrpLNoJzK/RygQShTymCVPg4Dsl3tQUKaHBPx9MexeqRG/HjN02DVpeqtsA== dependencies: tslib "^2.0.0" @@ -427,23 +427,23 @@ integrity sha512-6Pxgsrf0qF9iFFqmIcWmjJGkkCaCm6V5QNnxMy2KloO3SDq6QuMVRbN9RtC8Urmo25LP+eZ6ZgYqFYpdD8Hd9w== "@angular/core@~11.0.0": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-11.0.5.tgz#b8c448c3cd4f6dae7327cc1ba4ee2aa29c8dbc26" - integrity sha512-XAXWQi7R3ucZXQwx9QK5jSKJeQyRJ53u2dQDpr7R5stzeCy1a5hrNOkZLg9zOTTPcth/6+FrOrRZP9SMdxtw3w== + version "11.0.7" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-11.0.7.tgz#4d81b1a49d3d4aaeb0ef9908695a3cc06707cfd9" + integrity sha512-Kj5uRZoK5+xfMTjkP3tw8oIF5hKTnoF9Bwh5m9GUKqg1wHVKOJcT5JBIEMc8qPyiFgALREA01reIzQdGMjX36A== dependencies: tslib "^2.0.0" "@angular/forms@~11.0.0": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-11.0.5.tgz#1be90f86b45a3d672eecea249b1d8e5e9f8f0bc3" - integrity sha512-2zB1IuqYNJrjh7Og9J8f/AtjX3NHc3VVbt0rPw35ghqIU3aQLpOichdQ1y5QvMWic1UzZ7SjWXDU7RpKbm4iUA== + version "11.0.7" + resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-11.0.7.tgz#958558b92d2e524e08b447c16b17b2ae42717657" + integrity sha512-+3A+SciMyHTdUwkKUz4XzC1DSYexQEbFLe0PKQIFSFOROmbssjnWJv7yO2HbzCpGa7oGKPYNlE5twYWyLxpvFg== dependencies: tslib "^2.0.0" "@angular/language-service@~11.0.0": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-11.0.5.tgz#92499b5f29509142f29ae7af64b049765a7f7050" - integrity sha512-EzGycD9ztTKAZB+kR+masNqCfGmU0vnKd/z33VLmeo9fo41t/YNCEQEEFz/pEl2dEwX/Wjou+3oyTYZIZz2uSA== + version "11.0.7" + resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-11.0.7.tgz#78a912eaf025c2d01181dc72ff4fb99ca598ae49" + integrity sha512-1IiJNwy/phjpYfqLVlhOp4Gr/A89joydwqPB7Nf7hbhl3xFnT98GOp/nsoZCwMBKotXYNk93m025LbJ++augfQ== "@angular/localize@~10.0.10": version "10.0.14" @@ -455,32 +455,32 @@ yargs "15.3.0" "@angular/localize@~11.0.0": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-11.0.5.tgz#e770d4ec1b2094822fdb0524516dca6bf39dfd05" - integrity sha512-tvzgRa/t0xCouCPFMurqZImLeWIISUjVEzkcny9P7xaaz0Cw7kSyulc0e8HXf+8oijSJ624YOYUzr7mkPoIfew== + version "11.0.7" + resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-11.0.7.tgz#0335f1fc4852d6d36d99d239ef946645b34c78fb" + integrity sha512-NDs08oAELLn7tA/hHLuW8APULg25C7iINYTA168QzOdFTEsJ2MoLf3SiVQExUV65h3MnB24xNbhaNodmBKUNPg== dependencies: "@babel/core" "7.8.3" glob "7.1.2" yargs "^16.1.1" "@angular/platform-browser-dynamic@~11.0.0": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-11.0.5.tgz#1e1de1ca429d85eb43b14cd5da90eba4ac95bd76" - integrity sha512-MFjpQcqkHOu8iTUMKVG6vfuOHwrRlgPBvkNucEbtXhTTYNlsw2mprxfUODYEu26EBUAh+FGttu8ZjclUGw4bVg== + version "11.0.7" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-11.0.7.tgz#8ee8c72799a96eee3967596ae52b69ee90ac3df0" + integrity sha512-pUXCum1Z2DZV/34WR4Vfmkc5nWxbmVdwAA9pXbAarwAYqHIqOzX8rpRaHsuHBAR+SK+VH+xjproeLgsVfV8FSA== dependencies: tslib "^2.0.0" "@angular/platform-browser@~11.0.0": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-11.0.5.tgz#b695d2533491f85721612a41d6d3708791bca96c" - integrity sha512-173JZHF3QS78hEscBxFZ/kX8KLjdaDhfAYi4Sh8daIKNUcDcyhqEy7wpAjWmCwdspL1QUtWKCrhZqrEVNGTpvA== + version "11.0.7" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-11.0.7.tgz#1475540b38d1e2d19dbd9242e0a9ddf6d9bf7873" + integrity sha512-W8Wt8jMUjcbpqGtqrNWAj0p7CLdjOxgVlbrgBXTbaoqdchvXH85YzGr7ohA3MuE61H90OcVK9OhfYQk5o6joSg== dependencies: tslib "^2.0.0" "@angular/router@~11.0.0": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@angular/router/-/router-11.0.5.tgz#95d47b3b510f6a49597db64cfd7ef936bb24c402" - integrity sha512-mSD4tbzuFH4uBb9vxPQHBUbkIMoWAfVUb7r9gtn3/deOxQbVh08f2gk2iWDN3OQLAa5mNHswuLByAYSw2rPbMA== + version "11.0.7" + resolved "https://registry.yarnpkg.com/@angular/router/-/router-11.0.7.tgz#c5d0cacb927018eb495a4538ab1f81c088f5b7f1" + integrity sha512-oh/MOPRSOCLRPsM/3CVUNYZ3pz3g+CzLOk5Vad/zFJmnGwjA/lQGJo2pl7VXVq3RF7MieaHlDWG5TexGlXAP5w== dependencies: tslib "^2.0.0" @@ -491,10 +491,10 @@ dependencies: "@ctrl/tinycolor" "^3.3.1" -"@ant-design/icons-angular@^10.0.0": - version "10.2.0" - resolved "https://registry.yarnpkg.com/@ant-design/icons-angular/-/icons-angular-10.2.0.tgz#cf13a6a33b1415934b7331b58cc38fa0653fa374" - integrity sha512-c5g31hD9otf0DAmHMlvijyOcq1sXpdqKbMFZHxXAUG2sTi+cgixqI8LNePCc9MxBy0N48gAmp0CfhGiByxZJnQ== +"@ant-design/icons-angular@^11.0.1": + version "11.0.1" + resolved "https://registry.yarnpkg.com/@ant-design/icons-angular/-/icons-angular-11.0.1.tgz#8ff3131f3d9b4b25fd28c64c4a9bdfe36da54942" + integrity sha512-WwxVx/aToxTjWmB5+O+3rOjSYdF8FC/Yd/8jF1ZGQMtLWAzP8/foQmKvPAktTUsh0/Ijhtur7LrHN2VuUedMcA== dependencies: "@ant-design/colors" "^5.0.0" tslib "^2.0.0" @@ -2466,12 +2466,12 @@ jquery "3.5.0" replace-in-file "^4.1.3" -"@ngtools/webpack@11.0.5": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-11.0.5.tgz#9d1abb9f9a5e72c014b5ed3e0c2cefe2a4175b30" - integrity sha512-hM0LdOSlC6c7ij+BvIpAFbe7dpJhL+A51L5v6YbMA6aM0Sb/y+HpE2u34AHEQvute7cLe4EyOyvJ9jSinVAJhQ== +"@ngtools/webpack@11.0.6": + version "11.0.6" + resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-11.0.6.tgz#1a1d7775022e7e6263f8d9ee2872d995163b3fc0" + integrity sha512-vf5YNEpXWRa0fKC/BRq5sVVj2WnEqW8jn14YQRHwVt5ppUeyu8IKUF69p6W1MwZMgMqMaw/vPQ8LI5cFbyf3uw== dependencies: - "@angular-devkit/core" "11.0.5" + "@angular-devkit/core" "11.0.6" enhanced-resolve "5.3.1" webpack-sources "2.0.1" @@ -2552,10 +2552,10 @@ is-plain-object "^5.0.0" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-2.0.1.tgz#7453d8281ce66b8ed1607f7ac7d751c3baffd2cc" - integrity sha512-9AuC04PUnZrjoLiw3uPtwGh9FE4Q3rTqs51oNlQ0rkwgE8ftYsOC+lsrQyvCvWm85smBbSc0FNRKKumvGyb44Q== +"@octokit/openapi-types@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-2.2.0.tgz#123e0438a0bc718ccdac3b5a2e69b3dd00daa85b" + integrity sha512-274lNUDonw10kT8wHg8fCcUc1ZjZHbWv0/TbAwb0ojhBQqZYc1cQ/4yqTVTtPMDeZ//g7xVEYe/s3vURkRghPg== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -2644,11 +2644,11 @@ "@types/node" ">= 8" "@octokit/types@^6.0.0", "@octokit/types@^6.0.3": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.1.2.tgz#2b3a6ae0b8b71c27c770b4ff3e9ad8f1f538af58" - integrity sha512-LPCpcLbcky7fWfHCTuc7tMiSHFpFlrThJqVdaHgowBTMS0ijlZFfonQC/C1PrZOjD4xRCYgBqH9yttEATGE/nw== + version "6.2.1" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.2.1.tgz#7f881fe44475ab1825776a4a59ca1ae082ed1043" + integrity sha512-jHs9OECOiZxuEzxMZcXmqrEO8GYraHF+UzNVH2ACYh8e/Y7YoT+hUf9ldvVd6zIvWv4p3NdxbQ0xx3ku5BnSiA== dependencies: - "@octokit/openapi-types" "^2.0.1" + "@octokit/openapi-types" "^2.2.0" "@types/node" ">= 8" "@rollup/plugin-commonjs@^15.0.0": @@ -2692,13 +2692,13 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@schematics/angular@11.0.5": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-11.0.5.tgz#149f908fd600e881ff87c5192d2673d0e3c37f38" - integrity sha512-7p2wweoJYhim8YUy3ih1SrPGqRsa6+aEFbYgo9v4zt7b3tOva8SvkbC2alayK74fclzQ7umqa6xAwvWhy8ORvg== +"@schematics/angular@11.0.6": + version "11.0.6" + resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-11.0.6.tgz#5e52f8396e66138df0d6062130399fab830ee79e" + integrity sha512-XUcpOrlcp55PBHrgpIVx69lnhDY6ro35BSRmqNmjXik56qcOkfvdki8vvyW9EsWvu9/sfBSsVDdparlbVois7w== dependencies: - "@angular-devkit/core" "11.0.5" - "@angular-devkit/schematics" "11.0.5" + "@angular-devkit/core" "11.0.6" + "@angular-devkit/schematics" "11.0.6" jsonc-parser "2.3.1" "@schematics/angular@~10.0.5": @@ -2717,13 +2717,13 @@ "@angular-devkit/core" "10.1.7" "@angular-devkit/schematics" "10.1.7" -"@schematics/update@0.1100.5": - version "0.1100.5" - resolved "https://registry.yarnpkg.com/@schematics/update/-/update-0.1100.5.tgz#40b529d93db51e6f66378bd9f4ff99f2e9c278f6" - integrity sha512-BYtKKuiWsrlc4FMW3bRyl4tm6lWNMTi8oql/mtkSgH7V5eMmaLDJtM+zDl+qyC/KHPxbHTfoHDapfv1tITSWjA== +"@schematics/update@0.1100.6": + version "0.1100.6" + resolved "https://registry.yarnpkg.com/@schematics/update/-/update-0.1100.6.tgz#8e76276a3daecfd698b39e7643bc21f3abb3a4d0" + integrity sha512-+B8n+k+zZ3VYOhjNBsLqzjp8O9ZdUWgdpf9L8XAA7mh/oPwufXpExyEc66uAS07imvUMmjz6i8E2eNWV/IjBJg== dependencies: - "@angular-devkit/core" "11.0.5" - "@angular-devkit/schematics" "11.0.5" + "@angular-devkit/core" "11.0.6" + "@angular-devkit/schematics" "11.0.6" "@yarnpkg/lockfile" "1.1.0" ini "1.3.6" npm-package-arg "^8.0.0" @@ -2885,9 +2885,9 @@ integrity sha512-AzfesNFLvOs6Q1mHzIsVJXSeUnqVh4ZHG8ngygKJfbkcSLwzrBVm/LKa+mR8KrOfnWtUL47112gde1MC0IXqpQ== "@types/jest@26.x": - version "26.0.19" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.19.tgz#e6fa1e3def5842ec85045bd5210e9bb8289de790" - integrity sha512-jqHoirTG61fee6v6rwbnEuKhpSKih0tuhqeFbCmMmErhtu3BYlOZaXWjffgOstMM4S/3iQD31lI5bGLTrs97yQ== + version "26.0.20" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.20.tgz#cd2f2702ecf69e86b586e1f5223a60e454056307" + integrity sha512-9zi2Y+5USJRxd0FsahERhBwlcvFh6D2GLQnY2FH2BzK8J9s9omvNHIbvABwIluXa0fD8XVKMLTO0aOEuUfACAA== dependencies: jest-diff "^26.0.0" pretty-format "^26.0.0" @@ -2923,14 +2923,14 @@ integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg== "@types/node@*", "@types/node@>= 8": - version "14.14.19" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.19.tgz#5135176a8330b88ece4e9ab1fdcfc0a545b4bab4" - integrity sha512-4nhBPStMK04rruRVtVc6cDqhu7S9GZai0fpXgPXrFpcPX6Xul8xnrjSdGB4KPBVYG/R5+fXWdCM8qBoiULWGPQ== + version "14.14.20" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.20.tgz#f7974863edd21d1f8a494a73e8e2b3658615c340" + integrity sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A== "@types/node@^12.11.1": - version "12.19.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.11.tgz#9220ab4b20d91169eb78f456dbfcbabee89dfb50" - integrity sha512-bwVfNTFZOrGXyiQ6t4B9sZerMSShWNsGRw8tC5DY1qImUNczS9SjT4G6PnzjCnxsu5Ubj6xjL2lgwddkxtQl5w== + version "12.19.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.12.tgz#04793c2afa4ce833a9972e4c476432e30f9df47b" + integrity sha512-UwfL2uIU9arX/+/PRcIkT08/iBadGN2z6ExOROA2Dh5mAuWTBj6iJbQX4nekiV5H8cTrEG569LeX+HRco9Cbxw== "@types/node@^8.0.31": version "8.10.66" @@ -3800,9 +3800,9 @@ binary-extensions@^1.0.0: integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== binary-extensions@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" - integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== bindings@^1.5.0: version "1.5.0" @@ -3990,15 +3990,15 @@ browserify-zlib@^0.2.0: pako "~1.0.5" browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.16.0, browserslist@^4.7.0, browserslist@^4.9.1: - version "4.16.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.0.tgz#410277627500be3cb28a1bfe037586fbedf9488b" - integrity sha512-/j6k8R0p3nxOC6kx5JGAxsnhc9ixaWJfYc+TNTzxg6+ARaESAvQGV7h0uNOB4t+pLQJZWzcrMxXOxjgsCj3dqQ== + version "4.16.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.1.tgz#bf757a2da376b3447b800a16f0f1c96358138766" + integrity sha512-UXhDrwqsNcpTYJBTZsbGATDxZbiVDsx6UjpmRUmtnP10pr8wAYr5LgFoEFw9ixriQH2mv/NX2SfGzE/o8GndLA== dependencies: - caniuse-lite "^1.0.30001165" + caniuse-lite "^1.0.30001173" colorette "^1.2.1" - electron-to-chromium "^1.3.621" + electron-to-chromium "^1.3.634" escalade "^3.1.1" - node-releases "^1.1.67" + node-releases "^1.1.69" browserstack@^1.5.1: version "1.6.1" @@ -4181,12 +4181,12 @@ cachedir@2.2.0: integrity sha512-VvxA0xhNqIIfg0V9AmJkDg91DaJwryutH5rVEZAhcNi4iJFj9f+QxmAjgK1LT9I8OgToX27fypX6/MeCXVbBjQ== call-bind@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.0.tgz#24127054bb3f9bdcb4b1fb82418186072f77b8ce" - integrity sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w== + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.1.tgz#29aca9151f8ddcfd5b9b786898f005f425e88567" + integrity sha512-tvAvUwNcRikl3RVF20X9lsYmmepsovzTWeJiXjO0PkJp15uy/6xKFZOQtuiSULwYW+6ToZBprphCgWXC2dSgcQ== dependencies: function-bind "^1.1.1" - get-intrinsic "^1.0.0" + get-intrinsic "^1.0.2" call-me-maybe@^1.0.1: version "1.0.1" @@ -4273,10 +4273,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001032, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001165: - version "1.0.30001173" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001173.tgz#3c47bbe3cd6d7a9eda7f50ac016d158005569f56" - integrity sha512-R3aqmjrICdGCTAnSXtNyvWYMK3YtV5jwudbq0T7nN9k4kmE4CBuwPqyJ+KBzepSTh0huivV2gLbSMEzTTmfeYw== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001032, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001173: + version "1.0.30001174" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001174.tgz#0f2aca2153fd88ceb07a2bb982fc2acb787623c4" + integrity sha512-tqClL/4ThQq6cfFXH3oJL4rifFBeM6gTkphjao5kgwMaW9yn0tKgQLAEfKzDwj6HQWCB/aWo8kTFlSvIN8geEA== canonical-path@1.0.0: version "1.0.0" @@ -4360,9 +4360,9 @@ chartjs-color@^2.1.0: color-convert "^1.9.3" "chokidar@>=2.0.0 <4.0.0", chokidar@^3.0.0, chokidar@^3.0.2, chokidar@^3.2.1, chokidar@^3.4.1: - version "3.4.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" - integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== + version "3.5.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.0.tgz#458a4816a415e9d3b3caa4faec2b96a6935a9e65" + integrity sha512-JgQM9JS92ZbFR4P90EvmzNpSGhpPBGBSj10PILeDyYFwp4h2/D9OM03wsJ4zW1fEp4ka2DGrnUeD7FuvQ2aZ2Q== dependencies: anymatch "~3.1.1" braces "~3.0.2" @@ -4372,7 +4372,7 @@ chartjs-color@^2.1.0: normalize-path "~3.0.0" readdirp "~3.5.0" optionalDependencies: - fsevents "~2.1.2" + fsevents "~2.3.1" chokidar@^2.1.8: version "2.1.8" @@ -5832,10 +5832,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-to-chromium@^1.3.621: - version "1.3.633" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.633.tgz#16dd5aec9de03894e8d14a1db4cda8a369b9b7fe" - integrity sha512-bsVCsONiVX1abkWdH7KtpuDAhsQ3N3bjPYhROSAXE78roJKet0Y5wznA14JE9pzbwSZmSMAW6KiKYf1RvbTJkA== +electron-to-chromium@^1.3.634: + version "1.3.635" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.635.tgz#8d1591eeca6b257d380061a2c04f0b3cc6c9e33b" + integrity sha512-RRriZOLs9CpW6KTLmgBqyUdnY0QNqqWs0HOtuQGGEMizOTNNn1P7sGRBxARnUeLejOsgwjDyRqT3E/CSst02ZQ== elliptic@^6.5.3: version "6.5.3" @@ -6668,10 +6668,10 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -fsevents@^2.1.2: - version "2.2.1" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.2.1.tgz#1fb02ded2036a8ac288d507a65962bd87b97628d" - integrity sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA== +fsevents@^2.1.2, fsevents@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.1.tgz#b209ab14c61012636c8863507edf7fb68cc54e9f" + integrity sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw== fsevents@~2.1.2: version "2.1.3" @@ -6712,7 +6712,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.0: +get-intrinsic@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49" integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg== @@ -6930,9 +6930,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globby@^11.0.1: - version "11.0.1" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357" - integrity sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ== + version "11.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83" + integrity sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" @@ -9180,9 +9180,9 @@ meow@^4.0.0: trim-newlines "^2.0.0" meow@^8.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.0.tgz#0fcaa267e35e4d58584b8205923df6021ddcc7ba" - integrity sha512-fNWkgM1UVMey2kf24yLiccxLihc5W+6zVus3/N0b+VfnJgxV99E9u04X6NAiKdg6ED7DAQBX5sy36NM0QJZkWA== + version "8.1.2" + resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" + integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== dependencies: "@types/minimist" "^1.2.0" camelcase-keys "^6.2.2" @@ -9622,13 +9622,13 @@ ng-packagr@^11.0.1: stylus "^0.54.7" terser "^5.0.0" -ng-zorro-antd@^10.1.1: - version "10.2.2" - resolved "https://registry.yarnpkg.com/ng-zorro-antd/-/ng-zorro-antd-10.2.2.tgz#5951f1fd5d1e405e7fe983756dca1eb942b255de" - integrity sha512-4Q2G6DtRJnEQXFcIEUyqgFi6JXcEF9bN0zOPNBV7LTNgjOf31QiE+3Pu2ifz8esGVwv7vmG8if8V2/Ha/Ol8Dw== +ng-zorro-antd@^11.0.1: + version "11.0.1" + resolved "https://registry.yarnpkg.com/ng-zorro-antd/-/ng-zorro-antd-11.0.1.tgz#ffa642a225b4dd41ddad93ac5e83aa3cd9422567" + integrity sha512-RfU19OMCRqRw/p/2+2XETcDFInCEZwVgSIFMnTqIqAFk0ndfmrPXbVWdIMTCCllKc3md414ExYckWXaqQ/8Vzg== dependencies: - "@angular/cdk" "^10.2.4" - "@ant-design/icons-angular" "^10.0.0" + "@angular/cdk" "^11.0.2" + "@ant-design/icons-angular" "^11.0.1" date-fns "^2.10.0" resize-observer-polyfill "^1.5.1" tslib "^2.0.0" @@ -9736,10 +9736,10 @@ node-notifier@^6.0.0: shellwords "^0.1.1" which "^1.3.1" -node-releases@^1.1.67: - version "1.1.67" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.67.tgz#28ebfcccd0baa6aad8e8d4d8fe4cbc49ae239c12" - integrity sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg== +node-releases@^1.1.69: + version "1.1.69" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.69.tgz#3149dbde53b781610cd8b486d62d86e26c3725f6" + integrity sha512-DGIjo79VDEyAnRlfSqYTsy+yoHd2IOjJiKUozD2MV2D85Vso6Bug56mb9tT/fY5Urt0iqk01H7x+llAruDR2zA== node-sass-tilde-importer@^1.0.0: version "1.0.2" @@ -10423,12 +10423,14 @@ parse-passwd@^1.0.0: integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= parse-path@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-4.0.2.tgz#ef14f0d3d77bae8dd4bc66563a4c151aac9e65aa" - integrity sha512-HSqVz6iuXSiL8C1ku5Gl1Z5cwDd9Wo0q8CoffdAghP6bz8pJa1tcMC+m4N+z6VAS8QdksnIGq1TB6EgR4vPR6w== + version "4.0.3" + resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-4.0.3.tgz#82d81ec3e071dcc4ab49aa9f2c9c0b8966bb22bf" + integrity sha512-9Cepbp2asKnWTJ9x2kpw6Fe8y9JDbqwahGCTvklzd/cEq5C5JC59x2Xb0Kx+x0QZ8bvNquGO8/BWP0cwBHzSAA== dependencies: is-ssh "^1.3.0" protocols "^1.4.0" + qs "^6.9.4" + query-string "^6.13.8" parse-url@^5.0.0: version "5.0.2" @@ -11222,11 +11224,25 @@ qs@6.7.0: resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== +qs@^6.9.4: + version "6.9.4" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.4.tgz#9090b290d1f91728d3c22e54843ca44aea5ab687" + integrity sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ== + qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== +query-string@^6.13.8: + version "6.13.8" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.8.tgz#8cf231759c85484da3cf05a851810d8e825c1159" + integrity sha512-jxJzQI2edQPE/NPUOusNjO/ZOGqr1o2OBa/3M00fU76FsLXDVbJDv/p7ng5OdQyorKrkRz1oqfwmbe5MAMePQg== + dependencies: + decode-uri-component "^0.2.0" + split-on-first "^1.0.0" + strict-uri-encode "^2.0.0" + querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -11558,9 +11574,9 @@ regjsgen@^0.5.1: integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A== regjsparser@^0.6.4: - version "0.6.4" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.4.tgz#a769f8684308401a66e9b529d2436ff4d0666272" - integrity sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw== + version "0.6.6" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.6.tgz#6d8c939d1a654f78859b08ddcc4aa777f3fa800a" + integrity sha512-jjyuCp+IEMIm3N1H1LLTJW1EISEJV9+5oHdEyrt43Pg9cDSb6rrLZei2cVWpl0xTjmmlpec/lEQGYgM7xfpGCQ== dependencies: jsesc "~0.5.0" @@ -11857,9 +11873,9 @@ rollup@2.32.1: fsevents "~2.1.2" rollup@^2.8.0: - version "2.35.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.35.1.tgz#e6bc8d10893556a638066f89e8c97f422d03968c" - integrity sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA== + version "2.36.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.36.1.tgz#2174f0c25c7b400d57b05628d0e732c7ae8d2178" + integrity sha512-eAfqho8dyzuVvrGqpR0ITgEdq0zG2QJeWYh+HeuTbpcaXk8vNFc48B7bJa1xYosTCKx0CuW+447oQOW8HgBIZQ== optionalDependencies: fsevents "~2.1.2" @@ -11969,9 +11985,9 @@ sass@1.27.0: chokidar ">=2.0.0 <4.0.0" sass@^1.23.0: - version "1.32.0" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.32.0.tgz#10101a026c13080b14e2b374d4e15ee24400a4d3" - integrity sha512-fhyqEbMIycQA4blrz/C0pYhv2o4x2y6FYYAH0CshBw3DXh5D5wyERgxw0ptdau1orc/GhNrhF7DFN2etyOCEng== + version "1.32.2" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.32.2.tgz#66dc0250bc86c15d19ddee7135e93d0cf3d3257b" + integrity sha512-u1pUuzqwz3SAgvHSWp1k0mRhX82b2DdlVnP6UIetQPZtYbuJUDaPQhZE12jyjB7vYeOScfz9WPsZJB6Rpk7heA== dependencies: chokidar ">=2.0.0 <4.0.0" @@ -12476,6 +12492,11 @@ speed-measure-webpack-plugin@1.3.3: dependencies: chalk "^2.0.1" +split-on-first@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" + integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== + split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" @@ -12605,6 +12626,11 @@ stream-shift@^1.0.0: resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== +strict-uri-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= + string-length@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-length/-/string-length-3.1.0.tgz#107ef8c23456e187a8abd4a61162ff4ac6e25837" @@ -12919,9 +12945,9 @@ tar@^4.4.10, tar@^4.4.12, tar@^4.4.8: yallist "^3.0.3" tar@^6.0.2: - version "6.0.5" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.0.5.tgz#bde815086e10b39f1dcd298e89d596e1535e200f" - integrity sha512-0b4HOimQHj9nXNEAA7zWwMM91Zhhba3pspja6sQbgTpynOJf+bkjBnfybNYzbpLbnwXnbyB4LOREvlyXLkCHSg== + version "6.1.0" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.0.tgz#d1724e9bcc04b977b18d5c573b333a2207229a83" + integrity sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" @@ -13274,7 +13300,7 @@ tsickle@^0.39.1: resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.39.1.tgz#7ccf672cde5b430f5dd0b281ee49e170ef390ff9" integrity sha512-CCc9cZhZbKoNizVM+K3Uqgit/go8GacjpqTv1cpwG/n2P0gB9GMoWZbxrUULDE9Wz26Lh86CGf6QyIPUVV1lnQ== -tslib@2.0.3, tslib@^2.0.0: +tslib@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== @@ -13284,6 +13310,11 @@ tslib@^1.10.0, tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tslib@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" + integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== + tslint@~6.1.0: version "6.1.3" resolved "https://registry.yarnpkg.com/tslint/-/tslint-6.1.3.tgz#5c23b2eccc32487d5523bd3a470e9aa31789d904" @@ -13536,9 +13567,9 @@ upath@^1.1.1, upath@^1.2.0: integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== uri-js@^4.2.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" - integrity sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g== + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" @@ -13736,9 +13767,9 @@ webdriver-js-extender@2.1.0: selenium-webdriver "^3.0.1" webdriver-manager@^12.1.7: - version "12.1.7" - resolved "https://registry.yarnpkg.com/webdriver-manager/-/webdriver-manager-12.1.7.tgz#ed4eaee8f906b33c146e869b55e850553a1b1162" - integrity sha512-XINj6b8CYuUYC93SG3xPkxlyUc3IJbD6Vvo75CVGuG9uzsefDzWQrhz0Lq8vbPxtb4d63CZdYophF8k8Or/YiA== + version "12.1.8" + resolved "https://registry.yarnpkg.com/webdriver-manager/-/webdriver-manager-12.1.8.tgz#5e70e73eaaf53a0767d5745270addafbc5905fd4" + integrity sha512-qJR36SXG2VwKugPcdwhaqcLQOD7r8P2Xiv9sfNbfZrKBnX243iAkOueX1yAmeNgIKhJ3YAT/F2gq6IiEZzahsg== dependencies: adm-zip "^0.4.9" chalk "^1.1.1" From c6d62a2c9901e7022089ebd051b02a55d4b9bb06 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 11 Jan 2021 14:05:22 +0300 Subject: [PATCH 370/493] added missing virtual to identity mongo repositories --- .../MongoDB/MongoIdentityClaimTypeRepository.cs | 2 +- .../MongoDB/MongoIdentityLinkUserRepository.cs | 4 ++-- .../Identity/MongoDB/MongoIdentityRoleRepository.cs | 6 +++--- .../MongoDB/MongoIdentitySecurityLogRepository.cs | 6 +++--- .../Identity/MongoDB/MongoIdentityUserRepository.cs | 10 +++++----- .../MongoDB/MongoOrganizationUnitRepository.cs | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityClaimTypeRepository.cs b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityClaimTypeRepository.cs index 6795735793..3ad208efc0 100644 --- a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityClaimTypeRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityClaimTypeRepository.cs @@ -55,7 +55,7 @@ namespace Volo.Abp.Identity.MongoDB .ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task GetCountAsync( + public virtual async Task GetCountAsync( string filter = null, CancellationToken cancellationToken = default) { diff --git a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityLinkUserRepository.cs b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityLinkUserRepository.cs index 43bad94271..e670759e5c 100644 --- a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityLinkUserRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityLinkUserRepository.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.Identity.MongoDB { } - public async Task FindAsync(IdentityLinkUserInfo sourceLinkUserInfo, IdentityLinkUserInfo targetLinkUserInfo, CancellationToken cancellationToken = default) + public virtual async Task FindAsync(IdentityLinkUserInfo sourceLinkUserInfo, IdentityLinkUserInfo targetLinkUserInfo, CancellationToken cancellationToken = default) { return await (await GetMongoQueryableAsync(cancellationToken)) .OrderBy(x => x.Id).FirstOrDefaultAsync(x => @@ -28,7 +28,7 @@ namespace Volo.Abp.Identity.MongoDB , cancellationToken: GetCancellationToken(cancellationToken)); } - public async Task> GetListAsync(IdentityLinkUserInfo linkUserInfo, CancellationToken cancellationToken = default) + public virtual async Task> GetListAsync(IdentityLinkUserInfo linkUserInfo, CancellationToken cancellationToken = default) { return await (await GetMongoQueryableAsync(cancellationToken)).Where(x => x.SourceUserId == linkUserInfo.UserId && x.SourceTenantId == linkUserInfo.TenantId || diff --git a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityRoleRepository.cs b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityRoleRepository.cs index 0731008f57..f4b5049b16 100644 --- a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityRoleRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityRoleRepository.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.Identity.MongoDB { } - public async Task FindByNormalizedNameAsync( + public virtual async Task FindByNormalizedNameAsync( string normalizedRoleName, bool includeDetails = true, CancellationToken cancellationToken = default) @@ -28,7 +28,7 @@ namespace Volo.Abp.Identity.MongoDB .FirstOrDefaultAsync(r => r.NormalizedName == normalizedRoleName, GetCancellationToken(cancellationToken)); } - public async Task> GetListAsync( + public virtual async Task> GetListAsync( string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, @@ -64,7 +64,7 @@ namespace Volo.Abp.Identity.MongoDB .ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task GetCountAsync( + public virtual async Task GetCountAsync( string filter = null, CancellationToken cancellationToken = default) { diff --git a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentitySecurityLogRepository.cs b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentitySecurityLogRepository.cs index a0a8b9b103..cc926db139 100644 --- a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentitySecurityLogRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentitySecurityLogRepository.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.Identity.MongoDB { } - public async Task> GetListAsync( + public virtual async Task> GetListAsync( string sorting = null, int maxResultCount = 50, int skipCount = 0, @@ -53,7 +53,7 @@ namespace Volo.Abp.Identity.MongoDB .ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task GetCountAsync( + public virtual async Task GetCountAsync( DateTime? startTime = null, DateTime? endTime = null, string applicationName = null, @@ -82,7 +82,7 @@ namespace Volo.Abp.Identity.MongoDB } - public async Task GetByUserIdAsync(Guid id, Guid userId, bool includeDetails = false, + public virtual async Task GetByUserIdAsync(Guid id, Guid userId, bool includeDetails = false, CancellationToken cancellationToken = default) { return await (await GetMongoQueryableAsync(cancellationToken)).OrderBy(x => x.Id).FirstOrDefaultAsync(x => x.Id == id && x.UserId == userId, diff --git a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityUserRepository.cs b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityUserRepository.cs index 0864f7b01c..1909b269cc 100644 --- a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityUserRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityUserRepository.cs @@ -53,7 +53,7 @@ namespace Volo.Abp.Identity.MongoDB return await dbContext.Roles.AsQueryable().Where(r => allRoleIds.Contains(r.Id)).Select(r => r.Name).ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task> GetRoleNamesInOrganizationUnitAsync( + public virtual async Task> GetRoleNamesInOrganizationUnitAsync( Guid id, CancellationToken cancellationToken = default) { @@ -178,7 +178,7 @@ namespace Volo.Abp.Identity.MongoDB return await dbContext.Roles.AsQueryable().Where(r => allRoleIds.Contains(r.Id)).ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task> GetOrganizationUnitsAsync( + public virtual async Task> GetOrganizationUnitsAsync( Guid id, bool includeDetails = false, CancellationToken cancellationToken = default) @@ -210,7 +210,7 @@ namespace Volo.Abp.Identity.MongoDB .LongCountAsync(GetCancellationToken(cancellationToken)); } - public async Task> GetUsersInOrganizationUnitAsync( + public virtual async Task> GetUsersInOrganizationUnitAsync( Guid organizationUnitId, CancellationToken cancellationToken = default) { @@ -221,7 +221,7 @@ namespace Volo.Abp.Identity.MongoDB return result; } - public async Task> GetUsersInOrganizationsListAsync( + public virtual async Task> GetUsersInOrganizationsListAsync( List organizationUnitIds, CancellationToken cancellationToken = default) { @@ -232,7 +232,7 @@ namespace Volo.Abp.Identity.MongoDB return result; } - public async Task> GetUsersInOrganizationUnitWithChildrenAsync( + public virtual async Task> GetUsersInOrganizationUnitWithChildrenAsync( string code, CancellationToken cancellationToken = default) { diff --git a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoOrganizationUnitRepository.cs b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoOrganizationUnitRepository.cs index de0afd8abc..6479bc4be0 100644 --- a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoOrganizationUnitRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoOrganizationUnitRepository.cs @@ -112,7 +112,7 @@ namespace Volo.Abp.Identity.MongoDB .CountAsync(cancellationToken); } - public async Task> GetUnaddedRolesAsync( + public virtual async Task> GetUnaddedRolesAsync( OrganizationUnit organizationUnit, string sorting = null, int maxResultCount = int.MaxValue, @@ -132,7 +132,7 @@ namespace Volo.Abp.Identity.MongoDB .ToListAsync(cancellationToken); } - public async Task GetUnaddedRolesCountAsync( + public virtual async Task GetUnaddedRolesCountAsync( OrganizationUnit organizationUnit, string filter = null, CancellationToken cancellationToken = default) @@ -174,7 +174,7 @@ namespace Volo.Abp.Identity.MongoDB return await query.CountAsync(cancellationToken); } - public async Task> GetUnaddedUsersAsync( + public virtual async Task> GetUnaddedUsersAsync( OrganizationUnit organizationUnit, string sorting = null, int maxResultCount = int.MaxValue, @@ -199,7 +199,7 @@ namespace Volo.Abp.Identity.MongoDB .ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task GetUnaddedUsersCountAsync(OrganizationUnit organizationUnit, string filter = null, + public virtual async Task GetUnaddedUsersCountAsync(OrganizationUnit organizationUnit, string filter = null, CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(cancellationToken); From f6c8feeac8b03a96658a5fca30c0f8f4727c605b Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 11 Jan 2021 14:08:27 +0300 Subject: [PATCH 371/493] added missing virtual to identity efcore repositories --- .../EFCoreIdentitySecurityLogRepository.cs | 6 +++--- .../EfCoreIdentityClaimTypeRepository.cs | 2 +- .../EntityFrameworkCore/EfCoreIdentityLinkUserRepository.cs | 4 ++-- .../EntityFrameworkCore/EfCoreIdentityRoleRepository.cs | 2 +- .../EntityFrameworkCore/EfCoreIdentityUserRepository.cs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EFCoreIdentitySecurityLogRepository.cs b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EFCoreIdentitySecurityLogRepository.cs index 91915cd9b8..c985680455 100644 --- a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EFCoreIdentitySecurityLogRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EFCoreIdentitySecurityLogRepository.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore } - public async Task> GetListAsync( + public virtual async Task> GetListAsync( string sorting = null, int maxResultCount = 50, int skipCount = 0, @@ -54,7 +54,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore .ToListAsync(cancellationToken); } - public async Task GetCountAsync( + public virtual async Task GetCountAsync( DateTime? startTime = null, DateTime? endTime = null, string applicationName = null, @@ -84,7 +84,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore return await query.LongCountAsync(cancellationToken); } - public async Task GetByUserIdAsync(Guid id, Guid userId, bool includeDetails = false, CancellationToken cancellationToken = default) + public virtual async Task GetByUserIdAsync(Guid id, Guid userId, bool includeDetails = false, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) .OrderBy(x => x.Id) diff --git a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityClaimTypeRepository.cs b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityClaimTypeRepository.cs index 4cbdfb5725..f634050b23 100644 --- a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityClaimTypeRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityClaimTypeRepository.cs @@ -47,7 +47,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore return identityClaimTypes; } - public async Task GetCountAsync( + public virtual async Task GetCountAsync( string filter = null, CancellationToken cancellationToken = default) { diff --git a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityLinkUserRepository.cs b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityLinkUserRepository.cs index 6920d1081e..c7e81f327e 100644 --- a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityLinkUserRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityLinkUserRepository.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore } - public async Task FindAsync(IdentityLinkUserInfo sourceLinkUserInfo, IdentityLinkUserInfo targetLinkUserInfo, CancellationToken cancellationToken = default) + public virtual async Task FindAsync(IdentityLinkUserInfo sourceLinkUserInfo, IdentityLinkUserInfo targetLinkUserInfo, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) .OrderBy(x => x.Id).FirstOrDefaultAsync(x => @@ -28,7 +28,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore , cancellationToken: GetCancellationToken(cancellationToken)); } - public async Task> GetListAsync(IdentityLinkUserInfo linkUserInfo, CancellationToken cancellationToken = default) + public virtual async Task> GetListAsync(IdentityLinkUserInfo linkUserInfo, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) .Where(x => diff --git a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs index b1389afd6a..aed6ed2232 100644 --- a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs @@ -64,7 +64,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore .ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task GetCountAsync( + public virtual async Task GetCountAsync( string filter = null, CancellationToken cancellationToken = default) { diff --git a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs index 8fcce7c35a..57b625a816 100644 --- a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs @@ -231,7 +231,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore return await query.ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task> GetUsersInOrganizationsListAsync( + public virtual async Task> GetUsersInOrganizationsListAsync( List organizationUnitIds, CancellationToken cancellationToken = default ) From 2f263e710c322653d7287ac4a23a0a88cab26ea3 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 11 Jan 2021 15:20:50 +0300 Subject: [PATCH 372/493] Microservice template generation via CLI --- .../Building/ProjectBuildContextExtensions.cs | 7 +- .../Steps/RemoveProjectFromSolutionStep.cs | 25 ++++++- .../TemplateProjectBuildPipelineBuilder.cs | 4 +- .../ProjectBuilding/TemplateInfoProvider.cs | 3 + .../Microservice/MicroserviceProTemplate.cs | 16 ++++ .../Microservice/MicroserviceTemplateBase.cs | 74 +++++++++++++++++++ 6 files changed, 123 insertions(+), 6 deletions(-) create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceProTemplate.cs create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ProjectBuildContextExtensions.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ProjectBuildContextExtensions.cs index e793c77011..80fb6db058 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ProjectBuildContextExtensions.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ProjectBuildContextExtensions.cs @@ -16,5 +16,10 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building return file; } + + public static FileEntry FindFile(this ProjectBuildContext context, string filePath) + { + return context.Files.FirstOrDefault(f => f.Name == filePath); + } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs index 7b48c780f1..6026ea96ca 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs @@ -7,8 +7,8 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps public class RemoveProjectFromSolutionStep : ProjectBuildPipelineStep { private readonly string _projectName; - private readonly string _solutionFilePath; - private readonly string _projectFolderPath; + private string _solutionFilePath; + private string _projectFolderPath; private string ProjectNameWithQuotes => $"\"{_projectName}\""; @@ -18,12 +18,14 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps string projectFolderPath = null) { _projectName = projectName; - _solutionFilePath = solutionFilePath ?? "/aspnet-core/MyCompanyName.MyProjectName.sln"; - _projectFolderPath = projectFolderPath ?? ("/aspnet-core/src/" + projectName); + _solutionFilePath = solutionFilePath; + _projectFolderPath = projectFolderPath; } public override void Execute(ProjectBuildContext context) { + SetSolutionAndProjectPathsIfNull(context); + new RemoveFolderStep(_projectFolderPath).Execute(context); var solutionFile = context.GetFile(_solutionFilePath); solutionFile.NormalizeLineEndings(); @@ -75,5 +77,20 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps return null; } + + private void SetSolutionAndProjectPathsIfNull(ProjectBuildContext context) + { + + if (_solutionFilePath == null) + { + _solutionFilePath = context.FindFile("/aspnet-core/MyCompanyName.MyProjectName.sln")?.Name ?? + context.FindFile("/MyCompanyName.MyProjectName.sln").Name; + } + if (_projectFolderPath == null) + { + _projectFolderPath = context.FindFile("/aspnet-core/src/" + _projectName.EnsureEndsWith('/'))?.Name ?? + context.FindFile("/src/" + _projectName.EnsureEndsWith('/')).Name; + } + } } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs index 31c8f216b4..7642a7d697 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs @@ -1,5 +1,6 @@ using Volo.Abp.Cli.ProjectBuilding.Building.Steps; using Volo.Abp.Cli.ProjectBuilding.Templates.App; +using Volo.Abp.Cli.ProjectBuilding.Templates.Microservice; using Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule; namespace Volo.Abp.Cli.ProjectBuilding.Building @@ -25,6 +26,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building pipeline.Steps.Add(new SolutionRenameStep()); if (context.Template.Name == AppProTemplate.TemplateName || + context.Template.Name == MicroserviceProTemplate.TemplateName || context.Template.Name == ModuleProTemplate.TemplateName) { pipeline.Steps.Add(new LicenseCodeReplaceStep()); // todo: move to custom steps? @@ -37,7 +39,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building } if ((context.BuildArgs.UiFramework == UiFramework.Mvc || context.BuildArgs.UiFramework == UiFramework.Blazor) - && context.BuildArgs.MobileApp == MobileApp.None) + && context.BuildArgs.MobileApp == MobileApp.None && context.Template.Name != MicroserviceProTemplate.TemplateName) { pipeline.Steps.Add(new RemoveRootFolderStep()); } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs index 2aefcfd1a9..b9308dd707 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs @@ -8,6 +8,7 @@ using Volo.Abp.Cli.Http; using Volo.Abp.Cli.ProjectBuilding.Building; using Volo.Abp.Cli.ProjectBuilding.Templates.App; using Volo.Abp.Cli.ProjectBuilding.Templates.Console; +using Volo.Abp.Cli.ProjectBuilding.Templates.Microservice; using Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule; using Volo.Abp.Cli.ProjectBuilding.Templates.Wpf; using Volo.Abp.DependencyInjection; @@ -49,6 +50,8 @@ namespace Volo.Abp.Cli.ProjectBuilding return new AppTemplate(); case AppProTemplate.TemplateName: return new AppProTemplate(); + case MicroserviceProTemplate.TemplateName: + return new MicroserviceProTemplate(); case ModuleTemplate.TemplateName: return new ModuleTemplate(); case ModuleProTemplate.TemplateName: diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceProTemplate.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceProTemplate.cs new file mode 100644 index 0000000000..aef7ffec3b --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceProTemplate.cs @@ -0,0 +1,16 @@ +namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice +{ + public class MicroserviceProTemplate : MicroserviceTemplateBase + { + /// + /// "microservice-pro". + /// + public const string TemplateName = "microservice-pro"; + + public MicroserviceProTemplate() + : base(TemplateName) + { + DocumentUrl = null; // todo: set this + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs new file mode 100644 index 0000000000..13bfe3433e --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs @@ -0,0 +1,74 @@ +using System.Collections.Generic; +using JetBrains.Annotations; +using Volo.Abp.Cli.ProjectBuilding.Building; +using Volo.Abp.Cli.ProjectBuilding.Building.Steps; + +namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice +{ + public abstract class MicroserviceTemplateBase : TemplateInfo + { + protected MicroserviceTemplateBase([NotNull] string name) + : base(name) + { + } + + public override IEnumerable GetCustomSteps(ProjectBuildContext context) + { + var steps = new List(); + + DeleteUnrelatedProjects(context, steps); + RandomizeStringEncryption(context, steps); + UpdateNuGetConfig(context, steps); + + return steps; + } + + private static void DeleteUnrelatedProjects(ProjectBuildContext context, List steps) + { + switch (context.BuildArgs.UiFramework) + { + case UiFramework.None: + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.WebGateway")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor")); + steps.Add(new RemoveFolderStep("/angular")); + break; + + case UiFramework.Angular: + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.WebGateway")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor")); + break; + + + case UiFramework.Blazor: + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.WebGateway")); + steps.Add(new RemoveFolderStep("/angular")); + break; + + case UiFramework.Mvc: + case UiFramework.NotSpecified: + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor")); + steps.Add(new RemoveFolderStep("/angular")); + break; + } + + if (!context.BuildArgs.PublicWebSite) + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.PublicWeb")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.PublicWebGateway")); + } + } + + private static void RandomizeStringEncryption(ProjectBuildContext context, List steps) + { + steps.Add(new RandomizeStringEncryptionStep()); + } + + private static void UpdateNuGetConfig(ProjectBuildContext context, List steps) + { + steps.Add(new UpdateNuGetConfigStep("/NuGet.Config")); + } + } +} From 3aacb2d5ae8fde3b9a4a0d14cb56c9aee15a00b0 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 11 Jan 2021 15:54:58 +0300 Subject: [PATCH 373/493] Update RemoveProjectFromSolutionStep.cs --- .../Building/Steps/RemoveProjectFromSolutionStep.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs index 6026ea96ca..942dd91067 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs @@ -26,6 +26,11 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps { SetSolutionAndProjectPathsIfNull(context); + if (_solutionFilePath == null || _projectFolderPath == null) + { + return; + } + new RemoveFolderStep(_projectFolderPath).Execute(context); var solutionFile = context.GetFile(_solutionFilePath); solutionFile.NormalizeLineEndings(); @@ -84,12 +89,12 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps if (_solutionFilePath == null) { _solutionFilePath = context.FindFile("/aspnet-core/MyCompanyName.MyProjectName.sln")?.Name ?? - context.FindFile("/MyCompanyName.MyProjectName.sln").Name; + context.FindFile("/MyCompanyName.MyProjectName.sln")?.Name; } if (_projectFolderPath == null) { _projectFolderPath = context.FindFile("/aspnet-core/src/" + _projectName.EnsureEndsWith('/'))?.Name ?? - context.FindFile("/src/" + _projectName.EnsureEndsWith('/')).Name; + context.FindFile("/src/" + _projectName.EnsureEndsWith('/'))?.Name; } } } From 3c9a9b9fc0987806fb3a2b16a60d1bde1e2871af Mon Sep 17 00:00:00 2001 From: bnymncoskuner Date: Mon, 11 Jan 2021 19:26:56 +0300 Subject: [PATCH 374/493] feat: add page alert service and use it in theme-basic --- .../application-layout.component.html | 4 ++- .../theme-basic/src/lib/components/index.ts | 1 + .../page-alert-container.component.html | 22 ++++++++++++ .../page-alert-container.component.ts | 11 ++++++ .../theme-basic/src/lib/theme-basic.module.ts | 3 ++ .../theme-shared/src/lib/services/index.ts | 1 + .../src/lib/services/page-alert.service.ts | 34 +++++++++++++++++++ 7 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 npm/ng-packs/packages/theme-basic/src/lib/components/page-alert-container/page-alert-container.component.html create mode 100644 npm/ng-packs/packages/theme-basic/src/lib/components/page-alert-container/page-alert-container.component.ts create mode 100644 npm/ng-packs/packages/theme-shared/src/lib/services/page-alert.service.ts diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html index eb68dc7df0..7892d43a00 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html @@ -1,7 +1,7 @@
public static class EntityHelper { + public static bool IsMultiTenant() + where TEntity : IEntity + { + return IsMultiTenant(typeof(TEntity)); + } + + public static bool IsMultiTenant(Type type) + { + return typeof(IMultiTenant).IsAssignableFrom(type); + } + public static bool EntityEquals(IEntity entity1, IEntity entity2) { if (entity1 == null || entity2 == null) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs index 4ba5457677..055c9c2de9 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs @@ -13,6 +13,7 @@ using Volo.Abp.Domain.Entities; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.DependencyInjection; using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore { @@ -21,18 +22,42 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore where TEntity : class, IEntity { [Obsolete("Use GetDbContextAsync() method.")] - protected virtual TDbContext DbContext => _dbContextProvider.GetDbContext(); + protected virtual TDbContext DbContext => GetDbContext(); [Obsolete("Use GetDbContextAsync() method.")] - DbContext IEfCoreRepository.DbContext => DbContext.As(); + DbContext IEfCoreRepository.DbContext => GetDbContext() as DbContext; async Task IEfCoreRepository.GetDbContextAsync() { return await GetDbContextAsync() as DbContext; } + [Obsolete("Use GetDbContextAsync() method.")] + private TDbContext GetDbContext() + { + // Multi-tenancy unaware entities should always use the host connection string + if (!EntityHelper.IsMultiTenant()) + { + using (CurrentTenant.Change(null)) + { + return _dbContextProvider.GetDbContext(); + } + } + + return _dbContextProvider.GetDbContext(); + } + protected virtual Task GetDbContextAsync() { + // Multi-tenancy unaware entities should always use the host connection string + if (!EntityHelper.IsMultiTenant()) + { + using (CurrentTenant.Change(null)) + { + return _dbContextProvider.GetDbContextAsync(); + } + } + return _dbContextProvider.GetDbContextAsync(); } diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index b252c48999..c816abb86c 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -51,10 +51,34 @@ namespace Volo.Abp.Domain.Repositories.MongoDB } [Obsolete("Use GetDbContextAsync method.")] - protected virtual TMongoDbContext DbContext => DbContextProvider.GetDbContext(); + protected virtual TMongoDbContext DbContext => GetDbContext(); + + [Obsolete("Use GetDbContextAsync method.")] + private TMongoDbContext GetDbContext() + { + // Multi-tenancy unaware entities should always use the host connection string + if (!EntityHelper.IsMultiTenant()) + { + using (CurrentTenant.Change(null)) + { + return DbContextProvider.GetDbContext(); + } + } + + return DbContextProvider.GetDbContext(); + } protected Task GetDbContextAsync(CancellationToken cancellationToken = default) { + // Multi-tenancy unaware entities should always use the host connection string + if (!EntityHelper.IsMultiTenant()) + { + using (CurrentTenant.Change(null)) + { + return DbContextProvider.GetDbContextAsync(GetCancellationToken(cancellationToken)); + } + } + return DbContextProvider.GetDbContextAsync(GetCancellationToken(cancellationToken)); } From 68427bc2ebb2d055269436d1f4e0296bd853d7b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 28 Jan 2021 14:26:04 +0300 Subject: [PATCH 467/493] IBackgroundJobsDbContext should ignore multi-tenancy. --- .../EntityFrameworkCore/BackgroundJobsDbContext.cs | 6 ++++-- .../EntityFrameworkCore/IBackgroundJobsDbContext.cs | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs index d879803677..e49fa3fe55 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs @@ -1,15 +1,17 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] public class BackgroundJobsDbContext : AbpDbContext, IBackgroundJobsDbContext { public DbSet BackgroundJobs { get; set; } - public BackgroundJobsDbContext(DbContextOptions options) + public BackgroundJobsDbContext(DbContextOptions options) : base(options) { @@ -22,4 +24,4 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore builder.ConfigureBackgroundJobs(); } } -} \ No newline at end of file +} diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs index cc70b6543a..46701b863e 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs @@ -1,12 +1,14 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] public interface IBackgroundJobsDbContext : IEfCoreDbContext { DbSet BackgroundJobs { get; } } -} \ No newline at end of file +} From aa4d30c7b2b7dd5797de56a6389ed7f888e9acfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 28 Jan 2021 14:28:21 +0300 Subject: [PATCH 468/493] IgnoreMultiTenancy for BackgroundJobsMongoDbContext --- .../BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs | 4 +++- .../BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs | 2 ++ .../Volo/Abp/BlobStoring/Database/DatabaseBlobContainer.cs | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs index 745903cae7..13a058bc33 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] public class BackgroundJobsMongoDbContext : AbpMongoDbContext, IBackgroundJobsMongoDbContext { @@ -16,4 +18,4 @@ namespace Volo.Abp.BackgroundJobs.MongoDB modelBuilder.ConfigureBackgroundJobs(); } } -} \ No newline at end of file +} diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs index 8e2d11869d..254d22d63c 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] public interface IBackgroundJobsMongoDbContext : IAbpMongoDbContext { diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/DatabaseBlobContainer.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/DatabaseBlobContainer.cs index 4342d9092c..df912b84e5 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/DatabaseBlobContainer.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/DatabaseBlobContainer.cs @@ -5,17 +5,17 @@ using Volo.Abp.MultiTenancy; namespace Volo.Abp.BlobStoring.Database { - public class DatabaseBlobContainer : AggregateRoot, IMultiTenant //TODO: Rename to BlobContainer + public class DatabaseBlobContainer : AggregateRoot, IMultiTenant { public virtual Guid? TenantId { get; protected set; } public virtual string Name { get; protected set; } - public DatabaseBlobContainer(Guid id, [NotNull] string name, Guid? tenantId = null) + public DatabaseBlobContainer(Guid id, [NotNull] string name, Guid? tenantId = null) : base(id) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), DatabaseContainerConsts.MaxNameLength); TenantId = tenantId; } } -} \ No newline at end of file +} From 50945ae0cc5e7d1f8ae3dbdb55264f49fb8462d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 28 Jan 2021 14:45:05 +0300 Subject: [PATCH 469/493] IgnoreMultiTenancy for the blogging and docs module databases. --- .../Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs | 6 ++++-- .../Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs | 4 +++- .../Volo/Blogging/MongoDB/BloggingMongoDbContext.cs | 2 ++ .../Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs | 4 +++- .../docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs | 1 - .../Volo/Docs/EntityFrameworkCore/DocsDbContext.cs | 4 +++- .../Volo/Docs/EntityFrameworkCore/IDocsDbContext.cs | 4 +++- .../Volo/Docs/MongoDB/DocsMongoDbContext.cs | 2 ++ .../Volo/Docs/MongoDB/IDocsMongoDbContext.cs | 4 +++- 9 files changed, 23 insertions(+), 8 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs index 4ab71a0222..85c34aa996 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; using Volo.Blogging.Blogs; using Volo.Blogging.Comments; using Volo.Blogging.Posts; @@ -9,6 +10,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] public class BloggingDbContext : AbpDbContext, IBloggingDbContext { @@ -23,7 +25,7 @@ namespace Volo.Blogging.EntityFrameworkCore public DbSet PostTags { get; set; } public DbSet Comments { get; set; } - + public BloggingDbContext(DbContextOptions options) : base(options) { @@ -37,4 +39,4 @@ namespace Volo.Blogging.EntityFrameworkCore builder.ConfigureBlogging(); } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs index dcdb6c78e1..ecb7c282d4 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; using Volo.Blogging.Blogs; using Volo.Blogging.Comments; using Volo.Blogging.Posts; @@ -9,6 +10,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] public interface IBloggingDbContext : IEfCoreDbContext { @@ -24,4 +26,4 @@ namespace Volo.Blogging.EntityFrameworkCore DbSet Tags { get; set; } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs index fa265b3e67..1f20ff1744 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs @@ -1,6 +1,7 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; using Volo.Blogging.Blogs; using Volo.Blogging.Comments; using Volo.Blogging.Posts; @@ -8,6 +9,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] public class BloggingMongoDbContext : AbpMongoDbContext, IBloggingMongoDbContext { diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs index 8366e87d74..1dbf5eee92 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs @@ -1,6 +1,7 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; using Volo.Blogging.Blogs; using Volo.Blogging.Comments; using Volo.Blogging.Posts; @@ -8,6 +9,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] public interface IBloggingMongoDbContext : IAbpMongoDbContext { @@ -22,4 +24,4 @@ namespace Volo.Blogging.MongoDB IMongoCollection Comments { get; } } -} \ No newline at end of file +} diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs index 720cf494d6..48eb93d19e 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using JetBrains.Annotations; using Volo.Abp; using Volo.Abp.Domain.Entities; diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContext.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContext.cs index 7c1c635617..911db81a15 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContext.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContext.cs @@ -1,11 +1,13 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; using Volo.Docs.Documents; using Volo.Docs.Projects; namespace Volo.Docs.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(DocsDbProperties.ConnectionStringName)] public class DocsDbContext: AbpDbContext, IDocsDbContext { @@ -15,7 +17,7 @@ namespace Volo.Docs.EntityFrameworkCore public DbSet DocumentContributors { get; set; } - public DocsDbContext(DbContextOptions options) + public DocsDbContext(DbContextOptions options) : base(options) { diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/IDocsDbContext.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/IDocsDbContext.cs index 6e96604592..8edd1b74a0 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/IDocsDbContext.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/IDocsDbContext.cs @@ -1,11 +1,13 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; using Volo.Docs.Documents; using Volo.Docs.Projects; namespace Volo.Docs.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(DocsDbProperties.ConnectionStringName)] public interface IDocsDbContext : IEfCoreDbContext { @@ -15,4 +17,4 @@ namespace Volo.Docs.EntityFrameworkCore DbSet DocumentContributors { get; set; } } -} \ No newline at end of file +} diff --git a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContext.cs b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContext.cs index afc430c945..3bfb5df491 100644 --- a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContext.cs +++ b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContext.cs @@ -2,10 +2,12 @@ using Volo.Abp.Data; using Volo.Docs.Projects; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; using Volo.Docs.Documents; namespace Volo.Docs.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(DocsDbProperties.ConnectionStringName)] public class DocsMongoDbContext : AbpMongoDbContext, IDocsMongoDbContext { diff --git a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/IDocsMongoDbContext.cs b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/IDocsMongoDbContext.cs index 92c86a7c4f..f6b748611c 100644 --- a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/IDocsMongoDbContext.cs +++ b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/IDocsMongoDbContext.cs @@ -1,11 +1,13 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; using Volo.Docs.Documents; using Volo.Docs.Projects; namespace Volo.Docs.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(DocsDbProperties.ConnectionStringName)] public interface IDocsMongoDbContext : IAbpMongoDbContext { @@ -13,4 +15,4 @@ namespace Volo.Docs.MongoDB IMongoCollection Documents { get; } } -} \ No newline at end of file +} From a003bf15336a9a87d4ff22ff9ba6362c6c9d3a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 28 Jan 2021 16:01:38 +0300 Subject: [PATCH 470/493] IgnoreMultiTenancy for feature and setting module databases. --- .../EntityFrameworkCore/FeatureManagementDbContext.cs | 6 ++++-- .../EntityFrameworkCore/IFeatureManagementDbContext.cs | 4 +++- .../MongoDB/FeatureManagementMongoDbContext.cs | 4 +++- .../MongoDB/IFeatureManagementMongoDbContext.cs | 2 ++ .../EntityFrameworkCore/ISettingManagementDbContext.cs | 4 +++- .../EntityFrameworkCore/SettingManagementDbContext.cs | 2 ++ .../MongoDB/ISettingManagementMongoDbContext.cs | 4 +++- .../MongoDB/SettingManagementMongoDbContext.cs | 4 +++- 8 files changed, 23 insertions(+), 7 deletions(-) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContext.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContext.cs index af027dc9ba..9c47fcc28c 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContext.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContext.cs @@ -1,15 +1,17 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.FeatureManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(FeatureManagementDbProperties.ConnectionStringName)] public class FeatureManagementDbContext : AbpDbContext, IFeatureManagementDbContext { public DbSet FeatureValues { get; set; } - public FeatureManagementDbContext(DbContextOptions options) + public FeatureManagementDbContext(DbContextOptions options) : base(options) { @@ -22,4 +24,4 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore builder.ConfigureFeatureManagement(); } } -} \ No newline at end of file +} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/IFeatureManagementDbContext.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/IFeatureManagementDbContext.cs index 14abbccc5c..5f1f3f19b2 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/IFeatureManagementDbContext.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/IFeatureManagementDbContext.cs @@ -1,12 +1,14 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.FeatureManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(FeatureManagementDbProperties.ConnectionStringName)] public interface IFeatureManagementDbContext : IEfCoreDbContext { DbSet FeatureValues { get; set; } } -} \ No newline at end of file +} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContext.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContext.cs index e563130d4f..ba87fbabfb 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContext.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.FeatureManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(FeatureManagementDbProperties.ConnectionStringName)] public class FeatureManagementMongoDbContext : AbpMongoDbContext, IFeatureManagementMongoDbContext { @@ -16,4 +18,4 @@ namespace Volo.Abp.FeatureManagement.MongoDB modelBuilder.ConfigureFeatureManagement(); } } -} \ No newline at end of file +} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/IFeatureManagementMongoDbContext.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/IFeatureManagementMongoDbContext.cs index 290dfbe950..d826571ba6 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/IFeatureManagementMongoDbContext.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/IFeatureManagementMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.FeatureManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(FeatureManagementDbProperties.ConnectionStringName)] public interface IFeatureManagementMongoDbContext : IAbpMongoDbContext { diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/ISettingManagementDbContext.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/ISettingManagementDbContext.cs index fea486a163..eca448f732 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/ISettingManagementDbContext.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/ISettingManagementDbContext.cs @@ -1,12 +1,14 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.SettingManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(AbpSettingManagementDbProperties.ConnectionStringName)] public interface ISettingManagementDbContext : IEfCoreDbContext { DbSet Settings { get; set; } } -} \ No newline at end of file +} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContext.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContext.cs index e85bcd21cc..23a9773912 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContext.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContext.cs @@ -1,9 +1,11 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.SettingManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(AbpSettingManagementDbProperties.ConnectionStringName)] public class SettingManagementDbContext : AbpDbContext, ISettingManagementDbContext { diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/ISettingManagementMongoDbContext.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/ISettingManagementMongoDbContext.cs index 357ab0bfe3..609e940b63 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/ISettingManagementMongoDbContext.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/ISettingManagementMongoDbContext.cs @@ -1,12 +1,14 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.SettingManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(AbpSettingManagementDbProperties.ConnectionStringName)] public interface ISettingManagementMongoDbContext : IAbpMongoDbContext { IMongoCollection Settings { get; } } -} \ No newline at end of file +} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContext.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContext.cs index ada3a8100f..003e1a4b46 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContext.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.SettingManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(AbpSettingManagementDbProperties.ConnectionStringName)] public class SettingManagementMongoDbContext : AbpMongoDbContext, ISettingManagementMongoDbContext { @@ -16,4 +18,4 @@ namespace Volo.Abp.SettingManagement.MongoDB modelBuilder.ConfigureSettingManagement(); } } -} \ No newline at end of file +} From f4edd897adbabb9d210d70da13d945cb5a0cdd95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 28 Jan 2021 16:05:36 +0300 Subject: [PATCH 471/493] IgnoreMultiTenancy for ITenantManagementDbContext --- .../EntityFrameworkCore/ITenantManagementDbContext.cs | 4 +++- .../EntityFrameworkCore/TenantManagementDbContext.cs | 2 ++ .../MongoDb/ITenantManagementMongoDbContext.cs | 4 +++- .../MongoDb/TenantManagementMongoDbContext.cs | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/ITenantManagementDbContext.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/ITenantManagementDbContext.cs index 20eb5128da..0000e2827c 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/ITenantManagementDbContext.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/ITenantManagementDbContext.cs @@ -1,9 +1,11 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.TenantManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(AbpTenantManagementDbProperties.ConnectionStringName)] public interface ITenantManagementDbContext : IEfCoreDbContext { @@ -11,4 +13,4 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore DbSet TenantConnectionStrings { get; set; } } -} \ No newline at end of file +} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/TenantManagementDbContext.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/TenantManagementDbContext.cs index f75dbd0562..8a359dcde8 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/TenantManagementDbContext.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/TenantManagementDbContext.cs @@ -1,9 +1,11 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.TenantManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(AbpTenantManagementDbProperties.ConnectionStringName)] public class TenantManagementDbContext : AbpDbContext, ITenantManagementDbContext { diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/ITenantManagementMongoDbContext.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/ITenantManagementMongoDbContext.cs index d3c3fcbb62..211aabf1d4 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/ITenantManagementMongoDbContext.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/ITenantManagementMongoDbContext.cs @@ -1,12 +1,14 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.TenantManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(AbpTenantManagementDbProperties.ConnectionStringName)] public interface ITenantManagementMongoDbContext : IAbpMongoDbContext { IMongoCollection Tenants { get; } } -} \ No newline at end of file +} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoDbContext.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoDbContext.cs index 56327952d0..f35cdec78a 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoDbContext.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.TenantManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(AbpTenantManagementDbProperties.ConnectionStringName)] public class TenantManagementMongoDbContext : AbpMongoDbContext, ITenantManagementMongoDbContext { @@ -16,4 +18,4 @@ namespace Volo.Abp.TenantManagement.MongoDB modelBuilder.ConfigureTenantManagement(); } } -} \ No newline at end of file +} From 81786a87348f4b9273030bd8b56594188ed19845 Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Thu, 28 Jan 2021 19:49:03 +0300 Subject: [PATCH 472/493] fix shell command for Alpine Linux Distribution. closes volosoft/volo#5153 --- .../Volo/Abp/Cli/Utils/CmdHelper.cs | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs index 819022e672..07b470225a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.IO; using System.Runtime.InteropServices; namespace Volo.Abp.Cli.Utils @@ -103,14 +104,28 @@ namespace Volo.Abp.Cli.Utils public static string GetFileName() { - if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + //Windows + return "cmd.exe"; + } + + //Linux or OSX + if (File.Exists("/bin/bash")) { - //TODO: Test this. it should work for both operation systems. return "/bin/bash"; } - //Windows default. - return "cmd.exe"; + if (File.Exists("/bin/sh")) + { + return "/bin/sh"; //some Linux distributions like Alpine doesn't have bash + } + + throw new AbpException($"Cannot determine shell command for this OS! " + + $"Running on OS: {System.Runtime.InteropServices.RuntimeInformation.OSDescription} | " + + $"OS Architecture: {System.Runtime.InteropServices.RuntimeInformation.OSArchitecture} | " + + $"Framework: {System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription} | " + + $"Process Architecture{System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture}"); } } } From 378a272617ed3e1fb5ba67927fa5183912ba67ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 28 Jan 2021 22:17:48 +0300 Subject: [PATCH 473/493] Resolved #7508: Use the default language setting if user hasn't selected a language. --- .../MultiTenancy/MultiTenancyMiddleware.cs | 64 ++++++++++++++++++- ...hedApplicationConfigurationClientHelper.cs | 3 +- .../Localization/AbpLanguagesController.cs | 14 ++-- .../AbpRequestCultureCookieHelper.cs | 23 +++++++ .../DynamicProxying/ApiDescriptionFinder.cs | 59 +++++++++++++++-- .../DynamicHttpProxyInterceptor.cs | 20 ++++-- 6 files changed, 163 insertions(+), 20 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestCultureCookieHelper.cs diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs index 0aeb97e89d..ba84b32eb1 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs @@ -1,7 +1,15 @@ -using System.Threading.Tasks; +using System; +using System.Globalization; +using System.Threading.Tasks; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Localization; +using Microsoft.AspNetCore.RequestLocalization; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; +using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; +using Volo.Abp.Settings; namespace Volo.Abp.AspNetCore.MultiTenancy { @@ -23,8 +31,62 @@ namespace Volo.Abp.AspNetCore.MultiTenancy var tenant = await _tenantConfigurationProvider.GetAsync(saveResolveResult: true); using (_currentTenant.Change(tenant?.Id, tenant?.Name)) { + var requestCulture = await TryGetRequestCultureAsync(context); + if (requestCulture != null) + { + CultureInfo.CurrentCulture = requestCulture.Culture; + CultureInfo.CurrentUICulture = requestCulture.UICulture; + AbpRequestCultureCookieHelper.SetCultureCookie( + context, + requestCulture + ); + } + await next(context); } } + + private async Task TryGetRequestCultureAsync(HttpContext httpContext) + { + var requestCultureFeature = httpContext.Features.Get(); + + /* If requestCultureFeature == null, that means the RequestLocalizationMiddleware was not used + * and we don't want to set the culture. */ + if (requestCultureFeature == null) + { + return null; + } + + /* If requestCultureFeature.Provider is not null, that means RequestLocalizationMiddleware + * already picked a language, so we don't need to set the default. */ + if (requestCultureFeature.Provider != null) + { + return null; + } + + var settingProvider = httpContext.RequestServices.GetRequiredService(); + var defaultLanguage = await settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage); + if (defaultLanguage.IsNullOrWhiteSpace()) + { + return null; + } + + string culture; + string uiCulture; + + if (defaultLanguage.Contains(';')) + { + var splitted = defaultLanguage.Split(';'); + culture = splitted[0]; + uiCulture = splitted[1]; + } + else + { + culture = defaultLanguage; + uiCulture = defaultLanguage; + } + + return new RequestCulture(CultureInfo.GetCultureInfo(culture), CultureInfo.GetCultureInfo(uiCulture)); + } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs index 4b4a0e6301..ae013c4343 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs @@ -7,7 +7,8 @@ namespace Volo.Abp.AspNetCore.Mvc.Client { public static string CreateCacheKey(ICurrentUser currentUser) { - return $"ApplicationConfiguration_{currentUser.Id?.ToString("N") ?? "Anonymous"}_{CultureInfo.CurrentUICulture.Name}"; + var userKey = currentUser.Id?.ToString("N") ?? "Anonymous"; + return $"ApplicationConfiguration_{userKey}_{CultureInfo.CurrentUICulture.Name}"; } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs index 06b9c9a620..6b73aa26da 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs @@ -1,7 +1,7 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Localization; +using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Mvc; using System; +using Microsoft.AspNetCore.RequestLocalization; using Volo.Abp.Localization; namespace Volo.Abp.AspNetCore.Mvc.Localization @@ -20,12 +20,10 @@ namespace Volo.Abp.AspNetCore.Mvc.Localization throw new AbpException("Unknown language: " + culture + ". It must be a valid culture!"); } - string cookieValue = CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture, uiCulture)); - - Response.Cookies.Append(CookieRequestCultureProvider.DefaultCookieName, cookieValue, new CookieOptions - { - Expires = Clock.Now.AddYears(2) - }); + AbpRequestCultureCookieHelper.SetCultureCookie( + HttpContext, + new RequestCulture(culture, uiCulture) + ); if (!string.IsNullOrWhiteSpace(returnUrl)) { diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestCultureCookieHelper.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestCultureCookieHelper.cs new file mode 100644 index 0000000000..0f27925496 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestCultureCookieHelper.cs @@ -0,0 +1,23 @@ +using System; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Localization; + +namespace Microsoft.AspNetCore.RequestLocalization +{ + public static class AbpRequestCultureCookieHelper + { + public static void SetCultureCookie( + HttpContext httpContext, + RequestCulture requestCulture) + { + httpContext.Response.Cookies.Append( + CookieRequestCultureProvider.DefaultCookieName, + CookieRequestCultureProvider.MakeCookieValue(requestCulture), + new CookieOptions + { + Expires = DateTime.Now.AddYears(2) + } + ); + } + } +} diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs index 9142118b97..7e90bd4fe7 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs @@ -1,24 +1,38 @@ using System; +using System.Globalization; using System.Linq; using System.Net.Http; +using System.Net.Http.Headers; using System.Reflection; using System.Text.Json; using System.Threading.Tasks; +using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Modeling; +using Volo.Abp.MultiTenancy; using Volo.Abp.Threading; +using Volo.Abp.Tracing; namespace Volo.Abp.Http.Client.DynamicProxying { public class ApiDescriptionFinder : IApiDescriptionFinder, ITransientDependency { public ICancellationTokenProvider CancellationTokenProvider { get; set; } - protected IApiDescriptionCache Cache { get; } - - public ApiDescriptionFinder(IApiDescriptionCache cache) + protected AbpCorrelationIdOptions AbpCorrelationIdOptions { get; } + protected ICorrelationIdProvider CorrelationIdProvider { get; } + protected ICurrentTenant CurrentTenant { get; } + + public ApiDescriptionFinder( + IApiDescriptionCache cache, + IOptions abpCorrelationIdOptions, + ICorrelationIdProvider correlationIdProvider, + ICurrentTenant currentTenant) { Cache = cache; + AbpCorrelationIdOptions = abpCorrelationIdOptions.Value; + CorrelationIdProvider = correlationIdProvider; + CurrentTenant = currentTenant; CancellationTokenProvider = NullCancellationTokenProvider.Instance; } @@ -71,10 +85,19 @@ namespace Volo.Abp.Http.Client.DynamicProxying return await Cache.GetAsync(baseUrl, () => GetApiDescriptionFromServerAsync(client, baseUrl)); } - protected virtual async Task GetApiDescriptionFromServerAsync(HttpClient client, string baseUrl) + protected virtual async Task GetApiDescriptionFromServerAsync( + HttpClient client, + string baseUrl) { - var response = await client.GetAsync( - baseUrl.EnsureEndsWith('/') + "api/abp/api-definition", + var requestMessage = new HttpRequestMessage( + HttpMethod.Get, + baseUrl.EnsureEndsWith('/') + "api/abp/api-definition" + ); + + AddHeaders(requestMessage); + + var response = await client.SendAsync( + requestMessage, CancellationTokenProvider.Token ); @@ -93,6 +116,30 @@ namespace Volo.Abp.Http.Client.DynamicProxying return (ApplicationApiDescriptionModel)result; } + protected virtual void AddHeaders(HttpRequestMessage requestMessage) + { + //CorrelationId + requestMessage.Headers.Add(AbpCorrelationIdOptions.HttpHeaderName, CorrelationIdProvider.Get()); + + //TenantId + if (CurrentTenant.Id.HasValue) + { + //TODO: Use AbpAspNetCoreMultiTenancyOptions to get the key + requestMessage.Headers.Add(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString()); + } + + //Culture + //TODO: Is that the way we want? Couldn't send the culture (not ui culture) + var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name; + if (!currentCulture.IsNullOrEmpty()) + { + requestMessage.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(currentCulture)); + } + + //X-Requested-With + requestMessage.Headers.Add("X-Requested-With", "XMLHttpRequest"); + } + protected virtual bool TypeMatches(MethodParameterApiDescriptionModel actionParameter, ParameterInfo methodParameter) { return NormalizeTypeName(actionParameter.TypeAsString) == diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs index 7eb4e5ad78..0f281607cf 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs @@ -136,7 +136,13 @@ namespace Volo.Abp.Http.Client.DynamicProxying var client = HttpClientFactory.Create(clientConfig.RemoteServiceName); - var action = await ApiDescriptionFinder.FindActionAsync(client, remoteServiceConfig.BaseUrl, typeof(TService), invocation.Method); + var action = await ApiDescriptionFinder.FindActionAsync( + client, + remoteServiceConfig.BaseUrl, + typeof(TService), + invocation.Method + ); + var apiVersion = GetApiVersionInfo(action); var url = remoteServiceConfig.BaseUrl.EnsureEndsWith('/') + UrlBuilder.GenerateUrlWithParameters(action, invocation.ArgumentsDictionary, apiVersion); @@ -156,9 +162,11 @@ namespace Volo.Abp.Http.Client.DynamicProxying ) ); - var response = await client.SendAsync(requestMessage, + var response = await client.SendAsync( + requestMessage, HttpCompletionOption.ResponseHeadersRead /*this will buffer only the headers, the content will be used as a stream*/, - GetCancellationToken()); + GetCancellationToken() + ); if (!response.IsSuccessStatusCode) { @@ -196,7 +204,11 @@ namespace Volo.Abp.Http.Client.DynamicProxying return action.SupportedVersions.Last(); //TODO: Ensure to get the latest version! } - protected virtual void AddHeaders(IAbpMethodInvocation invocation, ActionApiDescriptionModel action, HttpRequestMessage requestMessage, ApiVersionInfo apiVersion) + protected virtual void AddHeaders( + IAbpMethodInvocation invocation, + ActionApiDescriptionModel action, + HttpRequestMessage requestMessage, + ApiVersionInfo apiVersion) { //API Version if (!apiVersion.Version.IsNullOrEmpty()) From 065c1e00ed5219ddfd035670950afa7272f4c1fd Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 29 Jan 2021 11:54:09 +0800 Subject: [PATCH 474/493] Only switch and get default language when the tenants are different. --- .../MultiTenancy/MultiTenancyMiddleware.cs | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs index ba84b32eb1..eaf5c753fd 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs @@ -5,7 +5,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.RequestLocalization; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; @@ -29,19 +28,26 @@ namespace Volo.Abp.AspNetCore.MultiTenancy public async Task InvokeAsync(HttpContext context, RequestDelegate next) { var tenant = await _tenantConfigurationProvider.GetAsync(saveResolveResult: true); - using (_currentTenant.Change(tenant?.Id, tenant?.Name)) + if (tenant?.Id != _currentTenant.Id) { - var requestCulture = await TryGetRequestCultureAsync(context); - if (requestCulture != null) + using (_currentTenant.Change(tenant?.Id, tenant?.Name)) { - CultureInfo.CurrentCulture = requestCulture.Culture; - CultureInfo.CurrentUICulture = requestCulture.UICulture; - AbpRequestCultureCookieHelper.SetCultureCookie( - context, - requestCulture - ); - } + var requestCulture = await TryGetRequestCultureAsync(context); + if (requestCulture != null) + { + CultureInfo.CurrentCulture = requestCulture.Culture; + CultureInfo.CurrentUICulture = requestCulture.UICulture; + AbpRequestCultureCookieHelper.SetCultureCookie( + context, + requestCulture + ); + } + await next(context); + } + } + else + { await next(context); } } @@ -86,7 +92,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy uiCulture = defaultLanguage; } - return new RequestCulture(CultureInfo.GetCultureInfo(culture), CultureInfo.GetCultureInfo(uiCulture)); + return new RequestCulture(culture, uiCulture); } } } From 33bd4b1fd45bade060b01225ea427c64716be4f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 29 Jan 2021 09:52:28 +0300 Subject: [PATCH 475/493] Temporary remove the API documentation link. --- docs/en/docs-nav.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 3fff6d67c1..c0a4d4d2bc 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -1056,10 +1056,6 @@ { "text": "CLI", "path": "CLI.md" - }, - { - "text": "API Documentation", - "path": "{ApiDocumentationUrl}" } ] }, From a67300cdf3ee6ba5f77f7c0e18992581206db97a Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 29 Jan 2021 10:58:54 +0300 Subject: [PATCH 476/493] Update tr.json --- .../Volo/Abp/TenantManagement/Localization/Resources/tr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/tr.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/tr.json index 7315cccc3f..a2e4ee5257 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/tr.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/tr.json @@ -10,7 +10,7 @@ "ConnectionStrings": "Bağlantı cümlesi", "DisplayName:DefaultConnectionString": "Varsayılan bağlantı cümlesi", "DisplayName:UseSharedDatabase": "Paylaşılan veritabanını kullan", - "ManageHostFeatures": "Toplantı Sahibi özelliklerini yönetin", + "ManageHostFeatures": "Host özelliklerini yönetin", "Permission:TenantManagement": "Müşteri yönetimi", "Permission:Create": "Oluşturma", "Permission:Edit": "Düzenleme", From 40b3e3892e1afef5594ee36ae85053a6a2105b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 29 Jan 2021 14:27:47 +0300 Subject: [PATCH 477/493] Added extension methods to ModelBuilder to know the multi-tenancy side for the current schema. --- .../AbpModelBuilderExtensions.cs | 72 +++++++++++++++++-- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Microsoft/EntityFrameworkCore/AbpModelBuilderExtensions.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Microsoft/EntityFrameworkCore/AbpModelBuilderExtensions.cs index 7148cb69bd..1ccfee1506 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Microsoft/EntityFrameworkCore/AbpModelBuilderExtensions.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Microsoft/EntityFrameworkCore/AbpModelBuilderExtensions.cs @@ -1,10 +1,72 @@ using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Microsoft.EntityFrameworkCore { public static class AbpModelBuilderExtensions { private const string ModelDatabaseProviderAnnotationKey = "_Abp_DatabaseProvider"; + private const string ModelMultiTenancySideAnnotationKey = "_Abp_MultiTenancySide"; + + #region MultiTenancySide + + public static void SetMultiTenancySide( + this ModelBuilder modelBuilder, + MultiTenancySides side) + { + modelBuilder.Model.SetAnnotation(ModelMultiTenancySideAnnotationKey, side); + } + + public static MultiTenancySides GetMultiTenancySide(this ModelBuilder modelBuilder) + { + var value = modelBuilder.Model[ModelMultiTenancySideAnnotationKey]; + if (value == null) + { + return MultiTenancySides.Both; + } + + return (MultiTenancySides) value; + } + + /// + /// Returns true if this is a database schema that is used by the host + /// but can also be shared with the tenants. + /// + public static bool IsHostDatabase(this ModelBuilder modelBuilder) + { + return modelBuilder.GetMultiTenancySide().HasFlag(MultiTenancySides.Host); + } + + /// + /// Returns true if this is a database schema that is used by the tenants + /// but can also be shared with the host. + /// + public static bool IsTenantDatabase(this ModelBuilder modelBuilder) + { + return modelBuilder.GetMultiTenancySide().HasFlag(MultiTenancySides.Tenant); + } + + /// + /// Returns true if this is a database schema that is only used by the host + /// and should not contain tenant-only tables. + /// + public static bool IsHostOnlyDatabase(this ModelBuilder modelBuilder) + { + return modelBuilder.GetMultiTenancySide() == MultiTenancySides.Host; + } + + /// + /// Returns true if this is a database schema that is only used by tenants. + /// and should not contain host-only tables. + /// + public static bool IsTenantOnlyDatabase(this ModelBuilder modelBuilder) + { + return modelBuilder.GetMultiTenancySide() == MultiTenancySides.Tenant; + } + + #endregion + + #region DatabaseProvider public static void SetDatabaseProvider( this ModelBuilder modelBuilder, @@ -61,7 +123,7 @@ namespace Microsoft.EntityFrameworkCore { modelBuilder.SetDatabaseProvider(EfCoreDatabaseProvider.InMemory); } - + public static bool IsUsingInMemory( this ModelBuilder modelBuilder) { @@ -73,7 +135,7 @@ namespace Microsoft.EntityFrameworkCore { modelBuilder.SetDatabaseProvider(EfCoreDatabaseProvider.Cosmos); } - + public static bool IsUsingCosmos( this ModelBuilder modelBuilder) { @@ -85,11 +147,13 @@ namespace Microsoft.EntityFrameworkCore { modelBuilder.SetDatabaseProvider(EfCoreDatabaseProvider.Firebird); } - + public static bool IsUsingFirebird( this ModelBuilder modelBuilder) { return modelBuilder.GetDatabaseProvider() == EfCoreDatabaseProvider.Firebird; } + + #endregion } -} \ No newline at end of file +} From afc52fa3d0b84192ec618fb49c34dc7e516027ef Mon Sep 17 00:00:00 2001 From: Ahmet Date: Fri, 29 Jan 2021 14:41:10 +0300 Subject: [PATCH 478/493] update module template host projects --- .../Pages/Index.cshtml | 1 + .../Pages/Index.cshtml | 25 +++++++++++++------ .../Menus/MyProjectNameMenuContributor.cs | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml index c46fdc673c..86106c7175 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml @@ -6,6 +6,7 @@ @using Volo.Abp.Users @inject IHtmlLocalizer L @inject ICurrentUser CurrentUser + Welcome diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Pages/Index.cshtml b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Pages/Index.cshtml index 3f37ed5a3e..655fa4d552 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Pages/Index.cshtml +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Pages/Index.cshtml @@ -7,11 +7,20 @@ @inject IStringLocalizer Localizer @inject ICurrentUser CurrentUser -@if (!CurrentUser.IsAuthenticated) -{ - @Localizer["Login"] -} -else -{ - Welcome: @CurrentUser.UserName -} \ No newline at end of file + + Welcome + + @if (!CurrentUser.IsAuthenticated) + { + @Localizer["Login"] + } + else + { + Welcome: @CurrentUser.UserName + } +
+

abp.io

+
+
+ + diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Menus/MyProjectNameMenuContributor.cs b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Menus/MyProjectNameMenuContributor.cs index 9ed725efb7..116bffb5aa 100644 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Menus/MyProjectNameMenuContributor.cs +++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Menus/MyProjectNameMenuContributor.cs @@ -16,7 +16,7 @@ namespace MyCompanyName.MyProjectName.Blazor.Menus private Task ConfigureMainMenuAsync(MenuConfigurationContext context) { //Add main menu items. - context.Menu.AddItem(new ApplicationMenuItem(MyProjectNameMenus.Prefix, displayName: "MyProjectName", "~/MyProjectName", icon: "fa fa-globe")); + context.Menu.AddItem(new ApplicationMenuItem(MyProjectNameMenus.Prefix, displayName: "MyProjectName", "/MyProjectName", icon: "fa fa-globe")); return Task.CompletedTask; } From 0c45c0e2ca227b95bd5a6dc675aad075a50b907d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 29 Jan 2021 14:42:16 +0300 Subject: [PATCH 479/493] Do not create host related tables in the tenant-only databases. --- ...undJobsDbContextModelCreatingExtensions.cs | 11 ++-- ...BloggingDbContextModelBuilderExtensions.cs | 5 ++ .../DocsDbContextModelBuilderExtensions.cs | 7 ++- ...agementDbContextModelCreatingExtensions.cs | 7 ++- ...IdentityDbContextModelBuilderExtensions.cs | 50 ++++++++++--------- ...yServerDbContextModelCreatingExtensions.cs | 5 ++ ...nagementDbContextModelBuilderExtensions.cs | 9 +++- ...agementDbContextModelCreatingExtensions.cs | 7 ++- 8 files changed, 70 insertions(+), 31 deletions(-) diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs index 0d16130fb5..0e36a661f6 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs @@ -12,13 +12,18 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore { Check.NotNull(builder, nameof(builder)); + if (builder.IsTenantOnlyDatabase()) + { + return; + } + var options = new BackgroundJobsModelBuilderConfigurationOptions( BackgroundJobsDbProperties.DbTablePrefix, BackgroundJobsDbProperties.DbSchema ); optionsAction?.Invoke(options); - + builder.Entity(b => { b.ToTable(options.TablePrefix + "BackgroundJobs", options.Schema); @@ -32,9 +37,9 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore b.Property(x => x.LastTryTime); b.Property(x => x.IsAbandoned).HasDefaultValue(false); b.Property(x => x.Priority).HasDefaultValue(BackgroundJobPriority.Normal); - + b.HasIndex(x => new { x.IsAbandoned, x.NextTryTime }); }); } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs index a5e909d8a4..9c54d0a3a0 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs @@ -20,6 +20,11 @@ namespace Volo.Blogging.EntityFrameworkCore { Check.NotNull(builder, nameof(builder)); + if (builder.IsTenantOnlyDatabase()) + { + return; + } + var options = new BloggingModelBuilderConfigurationOptions( BloggingDbProperties.DbTablePrefix, BloggingDbProperties.DbSchema diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs index 379ca8792d..c751475728 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs @@ -16,6 +16,11 @@ namespace Volo.Docs.EntityFrameworkCore { Check.NotNull(builder, nameof(builder)); + if (builder.IsTenantOnlyDatabase()) + { + return; + } + var options = new DocsModelBuilderConfigurationOptions( DocsDbProperties.DbTablePrefix, DocsDbProperties.DbSchema @@ -69,4 +74,4 @@ namespace Volo.Docs.EntityFrameworkCore }); } } -} \ No newline at end of file +} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs index d854f89448..0398096b95 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs @@ -12,6 +12,11 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore { Check.NotNull(builder, nameof(builder)); + if (builder.IsTenantOnlyDatabase()) + { + return; + } + var options = new FeatureManagementModelBuilderConfigurationOptions( FeatureManagementDbProperties.DbTablePrefix, FeatureManagementDbProperties.DbSchema @@ -34,4 +39,4 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore }); } } -} \ No newline at end of file +} diff --git a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs index a533ce6340..4e43721a80 100644 --- a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs +++ b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs @@ -152,18 +152,21 @@ namespace Volo.Abp.Identity.EntityFrameworkCore b.HasIndex(uc => uc.RoleId); }); - builder.Entity(b => + if (builder.IsHostDatabase()) { - b.ToTable(options.TablePrefix + "ClaimTypes", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "ClaimTypes", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.Property(uc => uc.Name).HasMaxLength(IdentityClaimTypeConsts.MaxNameLength) - .IsRequired(); // make unique - b.Property(uc => uc.Regex).HasMaxLength(IdentityClaimTypeConsts.MaxRegexLength); - b.Property(uc => uc.RegexDescription).HasMaxLength(IdentityClaimTypeConsts.MaxRegexDescriptionLength); - b.Property(uc => uc.Description).HasMaxLength(IdentityClaimTypeConsts.MaxDescriptionLength); - }); + b.Property(uc => uc.Name).HasMaxLength(IdentityClaimTypeConsts.MaxNameLength) + .IsRequired(); // make unique + b.Property(uc => uc.Regex).HasMaxLength(IdentityClaimTypeConsts.MaxRegexLength); + b.Property(uc => uc.RegexDescription).HasMaxLength(IdentityClaimTypeConsts.MaxRegexDescriptionLength); + b.Property(uc => uc.Description).HasMaxLength(IdentityClaimTypeConsts.MaxDescriptionLength); + }); + } builder.Entity(b => { @@ -233,22 +236,23 @@ namespace Volo.Abp.Identity.EntityFrameworkCore b.HasIndex(x => new { x.TenantId, x.UserId }); }); - builder.Entity(b => + if (builder.IsHostDatabase()) { - b.ToTable(options.TablePrefix + "LinkUsers", options.Schema); - - b.ConfigureByConvention(); - - b.HasIndex(x => new + builder.Entity(b => { - UserId = x.SourceUserId, - TenantId = x.SourceTenantId, - LinkedUserId = x.TargetUserId, - LinkedTenantId = x.TargetTenantId - }).IsUnique(); - }); - - + b.ToTable(options.TablePrefix + "LinkUsers", options.Schema); + + b.ConfigureByConvention(); + + b.HasIndex(x => new + { + UserId = x.SourceUserId, + TenantId = x.SourceTenantId, + LinkedUserId = x.TargetUserId, + LinkedTenantId = x.TargetTenantId + }).IsUnique(); + }); + } } } } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs index 1759ce5855..d3d08dca15 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs @@ -19,6 +19,11 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore { Check.NotNull(builder, nameof(builder)); + if (builder.IsTenantOnlyDatabase()) + { + return; + } + var options = new IdentityServerModelBuilderConfigurationOptions( AbpIdentityServerDbProperties.DbTablePrefix, AbpIdentityServerDbProperties.DbSchema diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs index 6f0bd5c3f8..0758cc9957 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs @@ -27,6 +27,11 @@ namespace Volo.Abp.SettingManagement.EntityFrameworkCore { Check.NotNull(builder, nameof(builder)); + if (builder.IsTenantOnlyDatabase()) + { + return; + } + var options = new SettingManagementModelBuilderConfigurationOptions( AbpSettingManagementDbProperties.DbTablePrefix, AbpSettingManagementDbProperties.DbSchema @@ -44,7 +49,7 @@ namespace Volo.Abp.SettingManagement.EntityFrameworkCore if (builder.IsUsingOracle()) { SettingConsts.MaxValueLengthValue = 2000; } b.Property(x => x.Value).HasMaxLength(SettingConsts.MaxValueLengthValue).IsRequired(); - + b.Property(x => x.ProviderName).HasMaxLength(SettingConsts.MaxProviderNameLength); b.Property(x => x.ProviderKey).HasMaxLength(SettingConsts.MaxProviderKeyLength); @@ -52,4 +57,4 @@ namespace Volo.Abp.SettingManagement.EntityFrameworkCore }); } } -} \ No newline at end of file +} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementDbContextModelCreatingExtensions.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementDbContextModelCreatingExtensions.cs index 03858df202..04c97046cf 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementDbContextModelCreatingExtensions.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementDbContextModelCreatingExtensions.cs @@ -13,6 +13,11 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore { Check.NotNull(builder, nameof(builder)); + if (builder.IsTenantOnlyDatabase()) + { + return; + } + var options = new AbpTenantManagementModelBuilderConfigurationOptions( AbpTenantManagementDbProperties.DbTablePrefix, AbpTenantManagementDbProperties.DbSchema @@ -46,4 +51,4 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore }); } } -} \ No newline at end of file +} From bfb896dc3f3533aeae9c662ab50b6c48faa10111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 29 Jan 2021 15:28:34 +0300 Subject: [PATCH 480/493] Rollback non-relational database transactions. Also, added comment to clarify it. --- .../EntityFrameworkCore/EfCoreTransactionApi.cs | 16 ++++++++++++---- .../UnitOfWorkDbContextProvider.cs | 10 ++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/EfCoreTransactionApi.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/EfCoreTransactionApi.cs index 625ba72ee2..a5c57b8597 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/EfCoreTransactionApi.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/EfCoreTransactionApi.cs @@ -48,11 +48,19 @@ namespace Volo.Abp.Uow.EntityFrameworkCore DbContextTransaction.Dispose(); } - public Task RollbackAsync(CancellationToken cancellationToken) + public async Task RollbackAsync(CancellationToken cancellationToken) { - return DbContextTransaction.RollbackAsync( - CancellationTokenProvider.FallbackToProvider(cancellationToken) - ); + await DbContextTransaction.RollbackAsync(CancellationTokenProvider.FallbackToProvider(cancellationToken)); + + foreach (var dbContext in AttendedDbContexts) + { + if (dbContext.As().HasRelationalTransactionManager()) + { + continue; //Relational databases use the shared transaction + } + + await dbContext.Database.RollbackTransactionAsync(CancellationTokenProvider.Token); + } } } } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs index dee4d3444d..89cc69fb74 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs @@ -191,7 +191,10 @@ namespace Volo.Abp.Uow.EntityFrameworkCore } else { - dbContext.Database.BeginTransaction(); //TODO: Why not using the new created transaction? + /* No need to store the returning IDbContextTransaction for non-relational databases + * since EfCoreTransactionApi will handle the commit/rollback over the DbContext instance. + */ + dbContext.Database.BeginTransaction(); } activeTransaction.AttendedDbContexts.Add(dbContext); @@ -236,7 +239,10 @@ namespace Volo.Abp.Uow.EntityFrameworkCore } else { - await dbContext.Database.BeginTransactionAsync(GetCancellationToken()); //TODO: Why not using the new created transaction? + /* No need to store the returning IDbContextTransaction for non-relational databases + * since EfCoreTransactionApi will handle the commit/rollback over the DbContext instance. + */ + await dbContext.Database.BeginTransactionAsync(GetCancellationToken()); } activeTransaction.AttendedDbContexts.Add(dbContext); From 30d147b0c39eda0654ca6f165724b4902ebbf98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 29 Jan 2021 15:31:16 +0300 Subject: [PATCH 481/493] Use CancellationTokenProvider.FallbackToProvider --- .../Volo/Abp/Uow/EntityFrameworkCore/EfCoreTransactionApi.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/EfCoreTransactionApi.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/EfCoreTransactionApi.cs index a5c57b8597..ce9afacef1 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/EfCoreTransactionApi.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/EfCoreTransactionApi.cs @@ -59,7 +59,7 @@ namespace Volo.Abp.Uow.EntityFrameworkCore continue; //Relational databases use the shared transaction } - await dbContext.Database.RollbackTransactionAsync(CancellationTokenProvider.Token); + await dbContext.Database.RollbackTransactionAsync(CancellationTokenProvider.FallbackToProvider(cancellationToken)); } } } From adebfb958d8d5ea3b744452b866f09d4ad094974 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 1 Feb 2021 15:15:42 +0800 Subject: [PATCH 482/493] Use eager loading for GetAssemblies of FolderPlugInSource. https://github.com/abpframework/abp/pull/7538 --- .../Volo/Abp/Modularity/PlugIns/FolderPlugInSource.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/PlugIns/FolderPlugInSource.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/PlugIns/FolderPlugInSource.cs index b0544d0338..eb54a19900 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/PlugIns/FolderPlugInSource.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/PlugIns/FolderPlugInSource.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.Modularity.PlugIns public Func Filter { get; set; } public FolderPlugInSource( - [NotNull] string folder, + [NotNull] string folder, SearchOption searchOption = SearchOption.TopDirectoryOnly) { Check.NotNull(folder, nameof(folder)); @@ -52,7 +52,7 @@ namespace Volo.Abp.Modularity.PlugIns return modules.ToArray(); } - private IEnumerable GetAssemblies() + private List GetAssemblies() { var assemblyFiles = AssemblyHelper.GetAssemblyFiles(Folder, SearchOption); @@ -61,7 +61,7 @@ namespace Volo.Abp.Modularity.PlugIns assemblyFiles = assemblyFiles.Where(Filter); } - return assemblyFiles.Select(AssemblyLoadContext.Default.LoadFromAssemblyPath); + return assemblyFiles.Select(AssemblyLoadContext.Default.LoadFromAssemblyPath).ToList(); } } -} \ No newline at end of file +} From 792af17439fd231f359d4fc34e161b5c9f3eb7df Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 1 Feb 2021 21:59:34 +0800 Subject: [PATCH 483/493] Insert the modal after the existing one. --- .../bootstrap/modal-manager.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js index a4d32550f8..75d080feda 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js @@ -39,7 +39,7 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f var _$modal = null; var _$form = null; - var _modalId = 'Modal_' + (Math.floor((Math.random() * 1000000))) + new Date().getTime(); + var _modalId = 'Abp_Modal_' + (Math.floor((Math.random() * 1000000))) + new Date().getTime(); var _modalObject = null; var _publicApi = null; @@ -56,7 +56,12 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f function _createContainer() { _removeContainer(); _$modalContainer = $('
'); - $('body').prepend(_$modalContainer); + var existsModals = $('[id^="Abp_Modal_"]'); + if (existsModals.length) { + existsModals.last().after(_$modalContainer) + } else { + $('body').prepend(_$modalContainer); + } return _$modalContainer; } From 45f778cb94e8405772d865983c386b4b727974e5 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 4 Feb 2021 11:31:08 +0800 Subject: [PATCH 484/493] Allow custom services construction --- .../Abp/AutoMapper/AbpAutoMapperModule.cs | 6 +- ...oMapper_CustomServiceConstruction_Tests.cs | 74 +++++++++++++++++++ .../AutoMapper_Dependency_Injection_Tests.cs | 23 +++++- 3 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_CustomServiceConstruction_Tests.cs diff --git a/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs b/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs index 25707e3899..cb576ba1de 100644 --- a/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs +++ b/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs @@ -25,7 +25,7 @@ namespace Volo.Abp.AutoMapper { context.Services.AddAutoMapperObjectMapper(); - context.Services.AddSingleton(provider => CreateMappings(provider)); + context.Services.AddSingleton(CreateMappings); context.Services.AddSingleton(provider => provider.GetRequiredService()); } @@ -43,6 +43,8 @@ namespace Volo.Abp.AutoMapper } } + options.Configurators.Insert(0, ctx => ctx.MapperConfiguration.ConstructServicesUsing(serviceProvider.GetService)); + void ValidateAll(IConfigurationProvider config) { foreach (var profileType in options.ValidatingProfiles) @@ -60,7 +62,7 @@ namespace Volo.Abp.AutoMapper return new MapperAccessor { - Mapper = new Mapper(mapperConfiguration, serviceProvider.GetService) + Mapper = new Mapper(mapperConfiguration) }; } } diff --git a/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_CustomServiceConstruction_Tests.cs b/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_CustomServiceConstruction_Tests.cs new file mode 100644 index 0000000000..ab2f2309d5 --- /dev/null +++ b/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_CustomServiceConstruction_Tests.cs @@ -0,0 +1,74 @@ +using System; +using AutoMapper; +using Microsoft.Extensions.DependencyInjection; +using Shouldly; +using Volo.Abp.AutoMapper.SampleClasses; +using Volo.Abp.Modularity; +using Volo.Abp.Testing; +using Xunit; +using IObjectMapper = Volo.Abp.ObjectMapping.IObjectMapper; + +namespace Volo.Abp.AutoMapper +{ + public class AutoMapper_CustomServiceConstruction_Tests : AbpIntegratedTest + { + private readonly IObjectMapper _objectMapper; + + public AutoMapper_CustomServiceConstruction_Tests() + { + _objectMapper = ServiceProvider.GetRequiredService(); + } + + [Fact] + public void Should_Custom_Service_Construction() + { + var myEntity = new MyEntity + { + Number = 2 + }; + _objectMapper.Map(myEntity).Number.ShouldBe(1); + } + + [DependsOn(typeof(AbpAutoMapperModule))] + public class TestModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.AddMaps(); + options.Configurators.Add(configurationContext => + { + configurationContext.MapperConfiguration.ConstructServicesUsing(type => + type.Name.Contains(nameof(CustomMappingAction)) + ? new CustomMappingAction(1) + : Activator.CreateInstance(type)); + }); + }); + } + } + + public class MapperActionProfile : Profile + { + public MapperActionProfile() + { + CreateMap().AfterMap(); + } + } + + public class CustomMappingAction : IMappingAction + { + private readonly int _number; + + public CustomMappingAction(int number) + { + _number = number; + } + + public void Process(MyEntity source, MyEntityDto destination, ResolutionContext context) + { + destination.Number = _number; + } + } + } +} diff --git a/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_Dependency_Injection_Tests.cs b/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_Dependency_Injection_Tests.cs index 56c5e6f061..7edf32eb23 100644 --- a/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_Dependency_Injection_Tests.cs +++ b/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_Dependency_Injection_Tests.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.AutoMapper [Fact] public void Should_Registered_AutoMapper_Service() { - GetService().ShouldNotBeNull(); + GetService().ShouldNotBeNull(); } [Fact] @@ -47,15 +47,30 @@ namespace Volo.Abp.AutoMapper { public MapperActionProfile() { - CreateMap().AfterMap(); + CreateMap().AfterMap(); } } - public class CustomMappingActionService : IMappingAction + public class CustomMappingAction : IMappingAction { + private readonly CustomMappingActionService _customMappingActionService; + + public CustomMappingAction(CustomMappingActionService customMappingActionService) + { + _customMappingActionService = customMappingActionService; + } + public void Process(SourceModel source, DestModel destination, ResolutionContext context) { - destination.Name = nameof(CustomMappingActionService); + destination.Name = _customMappingActionService.GetName(); + } + } + + public class CustomMappingActionService : ITransientDependency + { + public string GetName() + { + return nameof(CustomMappingActionService); } } } From 13c5e0eea395ae9b500205670ab979f9cf339651 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 4 Feb 2021 13:00:55 +0800 Subject: [PATCH 485/493] Update unit tests --- ...oMapper_CustomServiceConstruction_Tests.cs | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_CustomServiceConstruction_Tests.cs b/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_CustomServiceConstruction_Tests.cs index ab2f2309d5..c1995970b5 100644 --- a/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_CustomServiceConstruction_Tests.cs +++ b/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_CustomServiceConstruction_Tests.cs @@ -2,7 +2,6 @@ using AutoMapper; using Microsoft.Extensions.DependencyInjection; using Shouldly; -using Volo.Abp.AutoMapper.SampleClasses; using Volo.Abp.Modularity; using Volo.Abp.Testing; using Xunit; @@ -22,11 +21,11 @@ namespace Volo.Abp.AutoMapper [Fact] public void Should_Custom_Service_Construction() { - var myEntity = new MyEntity + var source = new SourceModel { - Number = 2 + Name = nameof(SourceModel) }; - _objectMapper.Map(myEntity).Number.ShouldBe(1); + _objectMapper.Map(source).Name.ShouldBe(nameof(CustomMappingAction)); } [DependsOn(typeof(AbpAutoMapperModule))] @@ -41,33 +40,43 @@ namespace Volo.Abp.AutoMapper { configurationContext.MapperConfiguration.ConstructServicesUsing(type => type.Name.Contains(nameof(CustomMappingAction)) - ? new CustomMappingAction(1) + ? new CustomMappingAction(nameof(CustomMappingAction)) : Activator.CreateInstance(type)); }); }); } } + public class SourceModel + { + public string Name { get; set; } + } + + public class DestModel + { + public string Name { get; set; } + } + public class MapperActionProfile : Profile { public MapperActionProfile() { - CreateMap().AfterMap(); + CreateMap().AfterMap(); } } - public class CustomMappingAction : IMappingAction + public class CustomMappingAction : IMappingAction { - private readonly int _number; + private readonly string _name; - public CustomMappingAction(int number) + public CustomMappingAction(string name) { - _number = number; + _name = name; } - public void Process(MyEntity source, MyEntityDto destination, ResolutionContext context) + public void Process(SourceModel source, DestModel destination, ResolutionContext context) { - destination.Number = _number; + destination.Name = _name; } } } From 12d602dffe7fcd3203ea37b678a58a05b72e1794 Mon Sep 17 00:00:00 2001 From: cuibty Date: Fri, 5 Feb 2021 14:30:40 +0800 Subject: [PATCH 486/493] Update Domain-Driven-Design-Implementation-Guide.md --- docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md b/docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md index db434ab365..e59f96ce56 100644 --- a/docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md +++ b/docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md @@ -1315,7 +1315,7 @@ namespace IssueTracking.Users #### 输出DTO最佳实践 -* 保持**数量较少**的输出DTO,尽可能**重用输入DTO**(例外:不要将输入DTO作为输出DTO). +* 保持**数量较少**的输出DTO,尽可能**重用输出DTO**(例外:不要将输入DTO作为输出DTO). * 输出DTO可以包含比用例需要的属性**更多**的属性. * 针对 **Create** 和 **Update** 方法,返回实体的DTO. @@ -1976,4 +1976,4 @@ public class IssueAppService * "*Domain Driven Design*" by Eric Evans * "*Implementing Domain Driven Design*" by Vaughn Vernon -* "*Clean Architecture*" by Robert C. Martin \ No newline at end of file +* "*Clean Architecture*" by Robert C. Martin From 3dbdecfa5f48ccd4880468b65dd3a762da968cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 5 Feb 2021 15:17:56 +0300 Subject: [PATCH 487/493] Resolved #7611: Distributed event bus should send NACK to RabbitMQ server on event handling failures. --- .../Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs index b94663d886..0c180a4ac7 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs @@ -191,6 +191,7 @@ namespace Volo.Abp.RabbitMQ } catch (Exception ex) { + Channel.BasicNack(basicDeliverEventArgs.DeliveryTag, multiple: false, requeue: true); Logger.LogException(ex); await ExceptionNotifier.NotifyAsync(ex); } From 43491dd2138c8d7f05a9e91994efd70ff8bed78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 5 Feb 2021 17:54:35 +0300 Subject: [PATCH 488/493] Resolved #7613: Should use the tenant's default connection string if available when requested a specific connection but not defined for the tenant. --- .../MultiTenantConnectionStringResolver.cs | 191 +++++++++++------- 1 file changed, 116 insertions(+), 75 deletions(-) diff --git a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs b/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs index 0d82419013..959c910901 100644 --- a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs +++ b/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs @@ -26,105 +26,146 @@ namespace Volo.Abp.MultiTenancy public override async Task ResolveAsync(string connectionStringName = null) { - //No current tenant, fallback to default logic if (_currentTenant.Id == null) { + //No current tenant, fallback to default logic return await base.ResolveAsync(connectionStringName); } - using (var serviceScope = _serviceProvider.CreateScope()) + var tenant = await FindTenantConfigurationAsync(_currentTenant.Id.Value); + + if (tenant == null || tenant.ConnectionStrings.IsNullOrEmpty()) { - var tenantStore = serviceScope - .ServiceProvider - .GetRequiredService(); + //Tenant has not defined any connection string, fallback to default logic + return await base.ResolveAsync(connectionStringName); + } + + var tenantDefaultConnectionString = tenant.ConnectionStrings.Default; + + //Requesting default connection string... + if (connectionStringName == null || + connectionStringName == ConnectionStrings.DefaultConnectionStringName) + { + //Return tenant's default or global default + return !tenantDefaultConnectionString.IsNullOrWhiteSpace() + ? tenantDefaultConnectionString + : Options.ConnectionStrings.Default; + } + + //Requesting specific connection string... + var connString = tenant.ConnectionStrings.GetOrDefault(connectionStringName); + if (!connString.IsNullOrWhiteSpace()) + { + //Found for the tenant + return connString; + } - var tenant = await tenantStore.FindAsync(_currentTenant.Id.Value); - - if (tenant?.ConnectionStrings == null) - { - return await base.ResolveAsync(connectionStringName); - } - - //Requesting default connection string - if (connectionStringName == null) - { - return tenant.ConnectionStrings.Default ?? - Options.ConnectionStrings.Default; - } - - //Requesting specific connection string - var connString = tenant.ConnectionStrings.GetOrDefault(connectionStringName); - if (connString != null) - { - return connString; - } - - /* Requested a specific connection string, but it's not specified for the tenant. - * - If it's specified in options, use it. - * - If not, use tenant's default conn string. - */ - - var connStringInOptions = Options.ConnectionStrings.GetOrDefault(connectionStringName); - if (connStringInOptions != null) - { - return connStringInOptions; - } - - return tenant.ConnectionStrings.Default ?? - Options.ConnectionStrings.Default; + //Fallback to tenant's default connection string if available + if (!tenantDefaultConnectionString.IsNullOrWhiteSpace()) + { + return tenantDefaultConnectionString; + } + + //Try to find the specific connection string for given name + var connStringInOptions = Options.ConnectionStrings.GetOrDefault(connectionStringName); + if (!connStringInOptions.IsNullOrWhiteSpace()) + { + return connStringInOptions; + } + + //Fallback to the global default connection string + var defaultConnectionString = Options.ConnectionStrings.Default; + if (!defaultConnectionString.IsNullOrWhiteSpace()) + { + return defaultConnectionString; } + + throw new AbpException("No connection string defined!"); } [Obsolete("Use ResolveAsync method.")] public override string Resolve(string connectionStringName = null) { - //No current tenant, fallback to default logic if (_currentTenant.Id == null) { + //No current tenant, fallback to default logic return base.Resolve(connectionStringName); } + var tenant = FindTenantConfiguration(_currentTenant.Id.Value); + + if (tenant == null || tenant.ConnectionStrings.IsNullOrEmpty()) + { + //Tenant has not defined any connection string, fallback to default logic + return base.Resolve(connectionStringName); + } + + var tenantDefaultConnectionString = tenant.ConnectionStrings.Default; + + //Requesting default connection string... + if (connectionStringName == null || + connectionStringName == ConnectionStrings.DefaultConnectionStringName) + { + //Return tenant's default or global default + return !tenantDefaultConnectionString.IsNullOrWhiteSpace() + ? tenantDefaultConnectionString + : Options.ConnectionStrings.Default; + } + + //Requesting specific connection string... + var connString = tenant.ConnectionStrings.GetOrDefault(connectionStringName); + if (!connString.IsNullOrWhiteSpace()) + { + //Found for the tenant + return connString; + } + + //Fallback to tenant's default connection string if available + if (!tenantDefaultConnectionString.IsNullOrWhiteSpace()) + { + return tenantDefaultConnectionString; + } + + //Try to find the specific connection string for given name + var connStringInOptions = Options.ConnectionStrings.GetOrDefault(connectionStringName); + if (!connStringInOptions.IsNullOrWhiteSpace()) + { + return connStringInOptions; + } + + //Fallback to the global default connection string + var defaultConnectionString = Options.ConnectionStrings.Default; + if (!defaultConnectionString.IsNullOrWhiteSpace()) + { + return defaultConnectionString; + } + + throw new AbpException("No connection string defined!"); + } + + protected virtual async Task FindTenantConfigurationAsync(Guid tenantId) + { + using (var serviceScope = _serviceProvider.CreateScope()) + { + var tenantStore = serviceScope + .ServiceProvider + .GetRequiredService(); + + return await tenantStore.FindAsync(tenantId); + } + } + + [Obsolete("Use FindTenantConfigurationAsync method.")] + protected virtual TenantConfiguration FindTenantConfiguration(Guid tenantId) + { using (var serviceScope = _serviceProvider.CreateScope()) { var tenantStore = serviceScope .ServiceProvider .GetRequiredService(); - var tenant = tenantStore.Find(_currentTenant.Id.Value); - - if (tenant?.ConnectionStrings == null) - { - return base.Resolve(connectionStringName); - } - - //Requesting default connection string - if (connectionStringName == null) - { - return tenant.ConnectionStrings.Default ?? - Options.ConnectionStrings.Default; - } - - //Requesting specific connection string - var connString = tenant.ConnectionStrings.GetOrDefault(connectionStringName); - if (connString != null) - { - return connString; - } - - /* Requested a specific connection string, but it's not specified for the tenant. - * - If it's specified in options, use it. - * - If not, use tenant's default conn string. - */ - - var connStringInOptions = Options.ConnectionStrings.GetOrDefault(connectionStringName); - if (connStringInOptions != null) - { - return connStringInOptions; - } - - return tenant.ConnectionStrings.Default ?? - Options.ConnectionStrings.Default; + return tenantStore.Find(tenantId); } } } -} +} \ No newline at end of file From 341183b2dd7e6cbee7400149058e991371043cdf Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Fri, 5 Feb 2021 18:05:08 +0300 Subject: [PATCH 489/493] Update ModuleInfo.cs --- .../Volo/Abp/Cli/ProjectBuilding/Building/ModuleInfo.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ModuleInfo.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ModuleInfo.cs index 260fbb745f..1d8da0e3b1 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ModuleInfo.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ModuleInfo.cs @@ -23,5 +23,7 @@ public bool MvcUi { get; set; } public bool BlazorUi { get; set; } + + public bool IsFreeToActiveLicenseOwners { get; set; } } } From 002b539c45ea37ce77cb5a22e21b0d6b952ba34f Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Sun, 7 Feb 2021 22:32:11 +0800 Subject: [PATCH 490/493] Add re-queue feature to kafka --- .../Volo/Abp/Kafka/AbpKafkaOptions.cs | 4 ++- .../Volo/Abp/Kafka/KafkaMessageConsumer.cs | 26 ++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/AbpKafkaOptions.cs b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/AbpKafkaOptions.cs index 1769d8a076..26d15ce818 100644 --- a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/AbpKafkaOptions.cs +++ b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/AbpKafkaOptions.cs @@ -9,11 +9,13 @@ namespace Volo.Abp.Kafka public KafkaConnections Connections { get; } public Action ConfigureProducer { get; set; } - + public Action ConfigureConsumer { get; set; } public Action ConfigureTopic { get; set; } + public bool ReQueue { get; set; } = true; + public AbpKafkaOptions() { Connections = new KafkaConnections(); diff --git a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs index 8ae81a2a26..a1c3fefd74 100644 --- a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs +++ b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Concurrent; -using System.Linq; using System.Threading.Tasks; using Confluent.Kafka; using Confluent.Kafka.Admin; @@ -20,6 +19,8 @@ namespace Volo.Abp.Kafka protected IConsumerPool ConsumerPool { get; } + protected IProducerPool ProducerPool { get; } + protected IExceptionNotifier ExceptionNotifier { get; } protected AbpKafkaOptions Options { get; } @@ -37,10 +38,12 @@ namespace Volo.Abp.Kafka public KafkaMessageConsumer( IConsumerPool consumerPool, IExceptionNotifier exceptionNotifier, - IOptions options) + IOptions options, + IProducerPool producerPool) { ConsumerPool = consumerPool; ExceptionNotifier = exceptionNotifier; + ProducerPool = producerPool; Options = options.Value; Logger = NullLogger.Instance; @@ -132,14 +135,29 @@ namespace Volo.Abp.Kafka { await callback(consumeResult.Message); } - - Consumer.Commit(consumeResult); } catch (Exception ex) { + await RequeueAsync(consumeResult); + Logger.LogException(ex); await ExceptionNotifier.NotifyAsync(ex); } + finally + { + Consumer.Commit(consumeResult); + } + } + + protected virtual async Task RequeueAsync(ConsumeResult consumeResult) + { + if (!Options.ReQueue) + { + return; + } + + var producer = ProducerPool.Get(ConnectionName); + await producer.ProduceAsync(consumeResult.Topic, consumeResult.Message); } public virtual void Dispose() From 3ab79685b4ed2ecd329d05515799f1cc7451d05c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sun, 7 Feb 2021 18:00:11 +0300 Subject: [PATCH 491/493] Ignore errors on RabbitMQ Nack message. --- .../Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs index 0c180a4ac7..f757efab64 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs @@ -191,7 +191,16 @@ namespace Volo.Abp.RabbitMQ } catch (Exception ex) { - Channel.BasicNack(basicDeliverEventArgs.DeliveryTag, multiple: false, requeue: true); + try + { + Channel.BasicNack( + basicDeliverEventArgs.DeliveryTag, + multiple: false, + requeue: true + ); + } + catch { } + Logger.LogException(ex); await ExceptionNotifier.NotifyAsync(ex); } From e4c193513fd1378bb07499753d4f9e9d3b28bc30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sun, 7 Feb 2021 18:58:52 +0300 Subject: [PATCH 492/493] Update jmeter tests. --- test/AbpPerfTest/_jmeter/SimpleTestPlan.jmx | 6 +++--- test/AbpPerfTest/_jmeter/SimpleTestPlanWithoutAbp.jmx | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/AbpPerfTest/_jmeter/SimpleTestPlan.jmx b/test/AbpPerfTest/_jmeter/SimpleTestPlan.jmx index 0c08c60f20..5c1c5dbced 100644 --- a/test/AbpPerfTest/_jmeter/SimpleTestPlan.jmx +++ b/test/AbpPerfTest/_jmeter/SimpleTestPlan.jmx @@ -1,5 +1,5 @@ - + @@ -16,10 +16,10 @@ continue false - 20 + 40 2000 - 10 + 20 false diff --git a/test/AbpPerfTest/_jmeter/SimpleTestPlanWithoutAbp.jmx b/test/AbpPerfTest/_jmeter/SimpleTestPlanWithoutAbp.jmx index c7d6b3292c..5ceb318e6b 100644 --- a/test/AbpPerfTest/_jmeter/SimpleTestPlanWithoutAbp.jmx +++ b/test/AbpPerfTest/_jmeter/SimpleTestPlanWithoutAbp.jmx @@ -1,5 +1,5 @@ - + @@ -16,10 +16,10 @@ continue false - 20 + 40 - 500 - 10 + 2000 + 20 false From 9be8eb2ea5827d70c1b437589f5996819b3262ce Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 8 Feb 2021 11:32:24 +0300 Subject: [PATCH 493/493] create NuGetPackageTarget.IdentityServer --- .../Volo/Abp/Cli/ProjectModification/NuGetPackageTarget.cs | 3 ++- .../Volo/Abp/Cli/ProjectModification/ProjectFinder.cs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NuGetPackageTarget.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NuGetPackageTarget.cs index 10274f3528..68b6e4fb44 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NuGetPackageTarget.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NuGetPackageTarget.cs @@ -13,6 +13,7 @@ EntityFrameworkCore = 8, MongoDB = 9, SignalR = 10, - Blazor = 11 + Blazor = 11, + IdentityServer = 12 } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectFinder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectFinder.cs index 0c02f8cb87..0ac4bb2a51 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectFinder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectFinder.cs @@ -22,6 +22,8 @@ namespace Volo.Abp.Cli.ProjectModification { case NuGetPackageTarget.Web: return FindProjectEndsWith(projectFiles, assemblyNames, ".Web"); + case NuGetPackageTarget.IdentityServer: + return FindProjectEndsWith(projectFiles, assemblyNames, ".IdentityServer"); case NuGetPackageTarget.EntityFrameworkCore: return FindProjectEndsWith(projectFiles, assemblyNames, ".EntityFrameworkCore"); case NuGetPackageTarget.MongoDB: