From 2ac19a485d8bbe79bca29241fea4df574c393e67 Mon Sep 17 00:00:00 2001 From: wakuflair <130427427@qq.com> Date: Sat, 23 Nov 2019 14:36:53 +0800 Subject: [PATCH 001/105] Resolved: https://github.com/abpframework/abp/issues/2239 --- .../Pages/SettingManagement/Index.cshtml | 9 ++++++--- .../Pages/SettingManagement/SettingPageGroup.cs | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml index 88645ad20e..aa69161a10 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml @@ -19,14 +19,17 @@
- + @foreach (var group in Model.SettingPageCreationContext.Groups) { - +

@group.DisplayName


- @await Component.InvokeAsync(group.ComponentType) + @await Component.InvokeAsync(group.ComponentType, new + { + settingDefinitions = group.Parameter + })
}
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingPageGroup.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingPageGroup.cs index 5acd284267..f6fae8726d 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingPageGroup.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingPageGroup.cs @@ -26,11 +26,14 @@ namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement } private Type _componentType; - public SettingPageGroup([NotNull] string id, [NotNull] string displayName, [NotNull] Type componentType) + public object Parameter { get; set; } + + public SettingPageGroup([NotNull] string id, [NotNull] string displayName, [NotNull] Type componentType, object parameter = null) { Id = id; DisplayName = displayName; ComponentType = componentType; + Parameter = parameter; } } } \ No newline at end of file From 9e7d425f64cfdd59884c9841736e2aeb3ebe7be2 Mon Sep 17 00:00:00 2001 From: wakuflair <130427427@qq.com> Date: Sat, 23 Nov 2019 14:46:28 +0800 Subject: [PATCH 002/105] rename the parameter's name --- .../Pages/SettingManagement/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml index aa69161a10..7a4a36ed6a 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml @@ -28,7 +28,7 @@
@await Component.InvokeAsync(group.ComponentType, new { - settingDefinitions = group.Parameter + parameter = group.Parameter }) } From bc02f0e980c60abf18a3173ccf1f4ccb9c983f14 Mon Sep 17 00:00:00 2001 From: iyilm4z Date: Wed, 11 Dec 2019 18:37:16 +0300 Subject: [PATCH 003/105] AddGlobalFilters method of MongoDbRepository extracted to a service --- .../MongoDB/IMongoDbRepositoryFilterer.cs | 20 ++++++ .../Repositories/MongoDB/MongoDbRepository.cs | 59 ++-------------- .../MongoDB/MongoDbRepositoryFilterer.cs | 68 +++++++++++++++++++ 3 files changed, 94 insertions(+), 53 deletions(-) create mode 100644 framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepositoryFilterer.cs create mode 100644 framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepositoryFilterer.cs 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 new file mode 100644 index 0000000000..680afce38f --- /dev/null +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepositoryFilterer.cs @@ -0,0 +1,20 @@ +using MongoDB.Driver; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities; + +namespace Volo.Abp.Domain.Repositories.MongoDB +{ + public interface IMongoDbRepositoryFilterer + where TEntity : class, IEntity + { + void AddGlobalFilters(List> filters); + } + + public interface IMongoDbRepositoryFilterer : IMongoDbRepositoryFilterer + where TEntity : class, IEntity + { + FilterDefinition CreateEntityFilter(TKey id, bool applyFilters = false); + + FilterDefinition CreateEntityFilter(TEntity entity, bool withConcurrencyStamp = false, string concurrencyStamp = null); + } +} 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 057f72bbb5..8dd452463f 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 @@ -14,8 +14,6 @@ using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Local; using Volo.Abp.Guids; using Volo.Abp.MongoDB; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Reflection; using Volo.Abp.Threading; namespace Volo.Abp.Domain.Repositories.MongoDB @@ -411,6 +409,8 @@ namespace Volo.Abp.Domain.Repositories.MongoDB where TMongoDbContext : IAbpMongoDbContext where TEntity : class, IEntity { + public virtual IMongoDbRepositoryFilterer RepositoryFilterer { get; set; } + public MongoDbRepository(IMongoDbContextProvider dbContextProvider) : base(dbContextProvider) { @@ -450,18 +450,18 @@ namespace Volo.Abp.Domain.Repositories.MongoDB CancellationToken cancellationToken = default) { return await Collection - .Find(CreateEntityFilter(id, true)) + .Find(RepositoryFilterer.CreateEntityFilter(id, true)) .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } public virtual TEntity Find(TKey id, bool includeDetails = true) { - return Collection.Find(CreateEntityFilter(id, true)).FirstOrDefault(); + return Collection.Find(RepositoryFilterer.CreateEntityFilter(id, true)).FirstOrDefault(); } public virtual void Delete(TKey id, bool autoSave = false) { - Collection.DeleteOne(CreateEntityFilter(id)); + Collection.DeleteOne(RepositoryFilterer.CreateEntityFilter(id)); } public virtual Task DeleteAsync( @@ -470,56 +470,9 @@ namespace Volo.Abp.Domain.Repositories.MongoDB CancellationToken cancellationToken = default) { return Collection.DeleteOneAsync( - CreateEntityFilter(id), + RepositoryFilterer.CreateEntityFilter(id), GetCancellationToken(cancellationToken) ); } - - protected override FilterDefinition CreateEntityFilter(TEntity entity, bool withConcurrencyStamp = false, string concurrencyStamp = null) - { - if (!withConcurrencyStamp || !(entity is IHasConcurrencyStamp entityWithConcurrencyStamp)) - { - return Builders.Filter.Eq(e => e.Id, entity.Id); - } - - if (concurrencyStamp == null) - { - concurrencyStamp = entityWithConcurrencyStamp.ConcurrencyStamp; - } - - return Builders.Filter.And( - Builders.Filter.Eq(e => e.Id, entity.Id), - Builders.Filter.Eq(e => ((IHasConcurrencyStamp)e).ConcurrencyStamp, concurrencyStamp) - ); - } - - protected virtual FilterDefinition CreateEntityFilter(TKey id, bool applyFilters = false) - { - var filters = new List> - { - Builders.Filter.Eq(e => e.Id, id) - }; - - if (applyFilters) - { - AddGlobalFilters(filters); - } - - return Builders.Filter.And(filters); - } - - protected virtual void AddGlobalFilters(List> filters) - { - if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)) && DataFilter.IsEnabled()) - { - 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)); - } - } } } \ 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 new file mode 100644 index 0000000000..5222121cab --- /dev/null +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepositoryFilterer.cs @@ -0,0 +1,68 @@ +using MongoDB.Driver; +using System.Collections.Generic; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities; +using Volo.Abp.MultiTenancy; + +namespace Volo.Abp.Domain.Repositories.MongoDB +{ + public class MongoDbRepositoryFilterer : IMongoDbRepositoryFilterer, ITransientDependency + where TEntity : class, IEntity + { + public IDataFilter DataFilter { get; set; } + + public ICurrentTenant CurrentTenant { get; set; } + + public void AddGlobalFilters(List> filters) + { + if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)) && DataFilter.IsEnabled()) + { + 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)); + } + } + } + + public class MongoDbRepositoryFilterer : MongoDbRepositoryFilterer, IMongoDbRepositoryFilterer, ITransientDependency + where TEntity : class, IEntity + { + public FilterDefinition CreateEntityFilter(TKey id, bool applyFilters = false) + { + var filters = new List> + { + Builders.Filter.Eq(e => e.Id, id) + }; + + if (applyFilters) + { + AddGlobalFilters(filters); + } + + return Builders.Filter.And(filters); + } + + public FilterDefinition CreateEntityFilter(TEntity entity, bool withConcurrencyStamp = false, string concurrencyStamp = null) + { + if (!withConcurrencyStamp || !(entity is IHasConcurrencyStamp entityWithConcurrencyStamp)) + { + return Builders.Filter.Eq(e => e.Id, entity.Id); + } + + if (concurrencyStamp == null) + { + concurrencyStamp = entityWithConcurrencyStamp.ConcurrencyStamp; + } + + return Builders.Filter.And( + Builders.Filter.Eq(e => e.Id, entity.Id), + Builders.Filter.Eq(e => ((IHasConcurrencyStamp)e).ConcurrencyStamp, concurrencyStamp) + ); + } + } +} From b1eed339622e4a5abba6d0e1c4f29f52f1ab3846 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 12 Dec 2019 15:36:38 +0800 Subject: [PATCH 004/105] Implement AsyncBackgroundJob. Resolve #2374 --- .../AbpBackgroundJobsAbstractionsModule.cs | 3 ++- .../Abp/BackgroundJobs/AsyncBackgroundJob.cs | 20 +++++++++++++++ .../BackgroundJobs/BackgroundJobArgsHelper.cs | 7 ++++-- .../BackgroundJobs/BackgroundJobExecuter.cs | 17 ++++++++++--- .../Abp/BackgroundJobs/IAsyncBackgroundJob.cs | 16 ++++++++++++ .../BackgroundJobExecuter_Tests.cs | 25 ++++++++++++++++++- .../BackgroundJobManager_Tests.cs | 8 ++++++ .../Volo/Abp/BackgroundJobs/MyAsyncJob.cs | 19 ++++++++++++++ .../Volo/Abp/BackgroundJobs/MyAsyncJobArgs.cs | 17 +++++++++++++ 9 files changed, 125 insertions(+), 7 deletions(-) create mode 100644 framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AsyncBackgroundJob.cs create mode 100644 framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/IAsyncBackgroundJob.cs create mode 100644 framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/MyAsyncJob.cs create mode 100644 framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/MyAsyncJobArgs.cs diff --git a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AbpBackgroundJobsAbstractionsModule.cs b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AbpBackgroundJobsAbstractionsModule.cs index 38a0afb2cd..2b5f6fa7a5 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AbpBackgroundJobsAbstractionsModule.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AbpBackgroundJobsAbstractionsModule.cs @@ -23,7 +23,8 @@ namespace Volo.Abp.BackgroundJobs services.OnRegistred(context => { - if (ReflectionHelper.IsAssignableToGenericType(context.ImplementationType, typeof(IBackgroundJob<>))) + if (ReflectionHelper.IsAssignableToGenericType(context.ImplementationType, typeof(IBackgroundJob<>)) || + ReflectionHelper.IsAssignableToGenericType(context.ImplementationType, typeof(IAsyncBackgroundJob<>))) { jobTypes.Add(context.ImplementationType); } diff --git a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AsyncBackgroundJob.cs b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AsyncBackgroundJob.cs new file mode 100644 index 0000000000..3c76bd718e --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AsyncBackgroundJob.cs @@ -0,0 +1,20 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; + +namespace Volo.Abp.BackgroundJobs +{ + public abstract class AsyncBackgroundJob : IAsyncBackgroundJob + { + //TODO: Add UOW, Localization and other useful properties..? + + public ILogger> Logger { get; set; } + + protected AsyncBackgroundJob() + { + Logger = NullLogger>.Instance; + } + + public abstract Task ExecuteAsync(TArgs args); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/BackgroundJobArgsHelper.cs b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/BackgroundJobArgsHelper.cs index 284a2cbb42..58199a9659 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/BackgroundJobArgsHelper.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/BackgroundJobArgsHelper.cs @@ -13,7 +13,8 @@ namespace Volo.Abp.BackgroundJobs continue; } - if (@interface.GetGenericTypeDefinition() != typeof(IBackgroundJob<>)) + if (@interface.GetGenericTypeDefinition() != typeof(IBackgroundJob<>) && + @interface.GetGenericTypeDefinition() != typeof(IAsyncBackgroundJob<>)) { continue; } @@ -27,7 +28,9 @@ namespace Volo.Abp.BackgroundJobs return genericArgs[0]; } - throw new AbpException($"Could not find type of the job args. Ensure that given type implements the {typeof(IBackgroundJob<>).AssemblyQualifiedName} interface. Given job type: {jobType.AssemblyQualifiedName}"); + throw new AbpException($"Could not find type of the job args. " + + $"Ensure that given type implements the {typeof(IBackgroundJob<>).AssemblyQualifiedName} or {typeof(IAsyncBackgroundJob<>).AssemblyQualifiedName} interface. " + + $"Given job type: {jobType.AssemblyQualifiedName}"); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/BackgroundJobExecuter.cs b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/BackgroundJobExecuter.cs index df0ec36dd6..ec0ac8ee3f 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/BackgroundJobExecuter.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/BackgroundJobExecuter.cs @@ -2,7 +2,9 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using System; +using System.Threading.Tasks; using Volo.Abp.DependencyInjection; +using Volo.Abp.Threading; namespace Volo.Abp.BackgroundJobs { @@ -27,15 +29,24 @@ namespace Volo.Abp.BackgroundJobs throw new AbpException("The job type is not registered to DI: " + context.JobType); } - var jobExecuteMethod = context.JobType.GetMethod(nameof(IBackgroundJob.Execute)); + var jobExecuteMethod = context.JobType.GetMethod(nameof(IBackgroundJob.Execute)) ?? + context.JobType.GetMethod(nameof(IAsyncBackgroundJob.ExecuteAsync)); if (jobExecuteMethod == null) { - throw new AbpException($"Given job type does not implement {typeof(IBackgroundJob<>).Name}. The job type was: " + context.JobType); + throw new AbpException($"Given job type does not implement {typeof(IBackgroundJob<>).Name} or {typeof(IAsyncBackgroundJob<>).Name}. " + + "The job type was: " + context.JobType); } try { - jobExecuteMethod.Invoke(job, new[] { context.JobArgs }); + if (jobExecuteMethod.Name == nameof(IAsyncBackgroundJob.ExecuteAsync)) + { + AsyncHelper.RunSync(() => (Task) jobExecuteMethod.Invoke(job, new[] {context.JobArgs})); + } + else + { + jobExecuteMethod.Invoke(job, new[] { context.JobArgs }); + } } catch (Exception ex) { diff --git a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/IAsyncBackgroundJob.cs b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/IAsyncBackgroundJob.cs new file mode 100644 index 0000000000..262d95d35b --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/IAsyncBackgroundJob.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; + +namespace Volo.Abp.BackgroundJobs +{ + /// + /// Defines interface of a background job. + /// + public interface IAsyncBackgroundJob + { + /// + /// Executes the job with the . + /// + /// Job arguments. + Task ExecuteAsync(TArgs args); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobExecuter_Tests.cs b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobExecuter_Tests.cs index 566c69c318..81c76f2559 100644 --- a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobExecuter_Tests.cs +++ b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobExecuter_Tests.cs @@ -1,4 +1,4 @@ -using System.Threading.Tasks; +using System.Threading.Tasks; using Shouldly; using Xunit; @@ -35,5 +35,28 @@ namespace Volo.Abp.BackgroundJobs jobObject.ExecutedValues.ShouldContain("42"); } + + [Fact] + public async Task Should_Execute_Async_Tasks() + { + //Arrange + + var jobObject = GetRequiredService(); + jobObject.ExecutedValues.ShouldBeEmpty(); + + //Act + + _backgroundJobExecuter.Execute( + new JobExecutionContext( + ServiceProvider, + typeof(MyAsyncJob), + new MyAsyncJobArgs("42") + ) + ); + + //Assert + + jobObject.ExecutedValues.ShouldContain("42"); + } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobManager_Tests.cs b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobManager_Tests.cs index 2c00573bc7..3a84e38df1 100644 --- a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobManager_Tests.cs +++ b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobManager_Tests.cs @@ -23,5 +23,13 @@ namespace Volo.Abp.BackgroundJobs jobIdAsString.ShouldNotBe(default); (await _backgroundJobStore.FindAsync(Guid.Parse(jobIdAsString))).ShouldNotBeNull(); } + + [Fact] + public async Task Should_Store_Async_Jobs() + { + var jobIdAsString = await _backgroundJobManager.EnqueueAsync(new MyAsyncJobArgs("42")); + jobIdAsString.ShouldNotBe(default); + (await _backgroundJobStore.FindAsync(Guid.Parse(jobIdAsString))).ShouldNotBeNull(); + } } } diff --git a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/MyAsyncJob.cs b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/MyAsyncJob.cs new file mode 100644 index 0000000000..a728d85deb --- /dev/null +++ b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/MyAsyncJob.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.BackgroundJobs +{ + public class MyAsyncJob : AsyncBackgroundJob, ISingletonDependency + { + public List ExecutedValues { get; } = new List(); + + public override Task ExecuteAsync(MyAsyncJobArgs args) + { + ExecutedValues.Add(args.Value); + + return Task.CompletedTask; + } + } +} diff --git a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/MyAsyncJobArgs.cs b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/MyAsyncJobArgs.cs new file mode 100644 index 0000000000..7a12d2a925 --- /dev/null +++ b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/MyAsyncJobArgs.cs @@ -0,0 +1,17 @@ +namespace Volo.Abp.BackgroundJobs +{ + public class MyAsyncJobArgs + { + public string Value { get; set; } + + public MyAsyncJobArgs() + { + + } + + public MyAsyncJobArgs(string value) + { + Value = value; + } + } +} \ No newline at end of file From ba2b790f2ce1be04216beb8155242590a31c5fc8 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 13 Dec 2019 10:53:07 +0800 Subject: [PATCH 005/105] Use MinifyGeneratedScript option to minify script. --- .../AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs | 9 +++++++++ .../AspNetCore/Mvc/AbpAspNetCoreMvcOptions.cs | 2 ++ ...pplicationConfigurationScriptController.cs | 19 +++++++++++++------ .../AbpServiceProxyScriptController.cs | 15 +++++++++++++-- .../ServiceProxyGenerationModel.cs | 4 +--- .../Http/ProxyScripting/ProxyScriptManager.cs | 8 ++------ .../ProxyScripting/ProxyScriptingModel.cs | 5 +---- 7 files changed, 41 insertions(+), 21 deletions(-) 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 ebc086dee6..06ce49551b 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 @@ -12,6 +12,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; +using Microsoft.Extensions.Hosting; using Volo.Abp.ApiVersioning; using Volo.Abp.AspNetCore.Mvc.Conventions; using Volo.Abp.AspNetCore.Mvc.DependencyInjection; @@ -64,6 +65,14 @@ namespace Volo.Abp.AspNetCore.Mvc options.IgnoredInterfaces.AddIfNotContains(typeof(IActionFilter)); }); + context.Services.PostConfigure(options => + { + if (options.MinifyGeneratedScript == null) + { + options.MinifyGeneratedScript = context.Services.GetHostingEnvironment().IsProduction(); + } + }); + var mvcCoreBuilder = context.Services.AddMvcCore(); context.Services.ExecutePreConfiguredActions(mvcCoreBuilder); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcOptions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcOptions.cs index fb29e17496..55d5512c6a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcOptions.cs @@ -4,6 +4,8 @@ namespace Volo.Abp.AspNetCore.Mvc { public class AbpAspNetCoreMvcOptions { + public bool? MinifyGeneratedScript { get; set; } + public AbpConventionalControllerOptions ConventionalControllers { get; } public AbpAspNetCoreMvcOptions() diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs index bce46bab44..5dcd68f1f7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs @@ -2,9 +2,11 @@ using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using Volo.Abp.Auditing; using Volo.Abp.Http; using Volo.Abp.Json; +using Volo.Abp.Minify.Scripts; namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations { @@ -15,23 +17,28 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations { private readonly IAbpApplicationConfigurationAppService _configurationAppService; private readonly IJsonSerializer _jsonSerializer; + private readonly AbpAspNetCoreMvcOptions _options; + private readonly IJavascriptMinifier _javascriptMinifier; public AbpApplicationConfigurationScriptController( IAbpApplicationConfigurationAppService configurationAppService, - IJsonSerializer jsonSerializer) + IJsonSerializer jsonSerializer, + IOptions options, + IJavascriptMinifier javascriptMinifier) { _configurationAppService = configurationAppService; _jsonSerializer = jsonSerializer; + _options = options.Value; + _javascriptMinifier = javascriptMinifier; } [HttpGet] [Produces(MimeTypes.Application.Javascript, MimeTypes.Text.Plain)] public async Task Get() { - return Content( - CreateAbpExtendScript( - await _configurationAppService.GetAsync() - ), + var script = CreateAbpExtendScript(await _configurationAppService.GetAsync()); + + return Content(_options.MinifyGeneratedScript == true ? _javascriptMinifier.Minify(script) : script, MimeTypes.Application.Javascript ); } @@ -42,7 +49,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations script.AppendLine("(function(){"); script.AppendLine(); - script.AppendLine($"$.extend(true, abp, {_jsonSerializer.Serialize(config, indented: Debugger.IsAttached)})"); + script.AppendLine($"$.extend(true, abp, {_jsonSerializer.Serialize(config, indented: true)})"); script.AppendLine(); script.AppendLine("abp.event.trigger('abp.configurationInitialized');"); script.AppendLine(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxyScriptController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxyScriptController.cs index b94e5c6a92..3263075bad 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxyScriptController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxyScriptController.cs @@ -1,7 +1,9 @@ using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using Volo.Abp.Auditing; using Volo.Abp.Http; using Volo.Abp.Http.ProxyScripting; +using Volo.Abp.Minify.Scripts; namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting { @@ -11,10 +13,16 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting public class AbpServiceProxyScriptController : AbpController { private readonly IProxyScriptManager _proxyScriptManager; + private readonly AbpAspNetCoreMvcOptions _options; + private readonly IJavascriptMinifier _javascriptMinifier; - public AbpServiceProxyScriptController(IProxyScriptManager proxyScriptManager) + public AbpServiceProxyScriptController(IProxyScriptManager proxyScriptManager, + IOptions options, + IJavascriptMinifier javascriptMinifier) { _proxyScriptManager = proxyScriptManager; + _options = options.Value; + _javascriptMinifier = javascriptMinifier; } [HttpGet] @@ -22,7 +30,10 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting public ActionResult GetAll(ServiceProxyGenerationModel model) { model.Normalize(); - return Content(_proxyScriptManager.GetScript(model.CreateOptions()), MimeTypes.Application.Javascript); + + var script = _proxyScriptManager.GetScript(model.CreateOptions()); + return Content(_options.MinifyGeneratedScript == true ? _javascriptMinifier.Minify(script) : script, + MimeTypes.Application.Javascript); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/ServiceProxyGenerationModel.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/ServiceProxyGenerationModel.cs index 20dae137e7..5cc9a0a3c5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/ServiceProxyGenerationModel.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/ServiceProxyGenerationModel.cs @@ -11,8 +11,6 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting public bool UseCache { get; set; } - public bool Minify { get; set; } - public string Modules { get; set; } public string Controllers { get; set; } @@ -34,7 +32,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting public ProxyScriptingModel CreateOptions() { - var options = new ProxyScriptingModel(Type, UseCache, Minify); + var options = new ProxyScriptingModel(Type, UseCache); if (!Modules.IsNullOrEmpty()) { diff --git a/framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptManager.cs b/framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptManager.cs index 858b78a57f..a3df2c70a2 100644 --- a/framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptManager.cs +++ b/framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptManager.cs @@ -18,21 +18,18 @@ namespace Volo.Abp.Http.ProxyScripting private readonly IJsonSerializer _jsonSerializer; private readonly IProxyScriptManagerCache _cache; private readonly AbpApiProxyScriptingOptions _options; - private readonly IJavascriptMinifier _javascriptMinifier; public ProxyScriptManager( IApiDescriptionModelProvider modelProvider, IServiceProvider serviceProvider, IJsonSerializer jsonSerializer, IProxyScriptManagerCache cache, - IOptions options, - IJavascriptMinifier javascriptMinifier) + IOptions options) { _modelProvider = modelProvider; _serviceProvider = serviceProvider; _jsonSerializer = jsonSerializer; _cache = cache; - _javascriptMinifier = javascriptMinifier; _options = options.Value; } @@ -67,8 +64,7 @@ namespace Volo.Abp.Http.ProxyScripting using (var scope = _serviceProvider.CreateScope()) { - var script = scope.ServiceProvider.GetRequiredService(generatorType).As().CreateScript(apiModel); - return scriptingModel.Minify ? _javascriptMinifier.Minify(script) : script; + return scope.ServiceProvider.GetRequiredService(generatorType).As().CreateScript(apiModel); } } diff --git a/framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptingModel.cs b/framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptingModel.cs index 6815c01ce5..5ab85a781b 100644 --- a/framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptingModel.cs +++ b/framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptingModel.cs @@ -8,8 +8,6 @@ namespace Volo.Abp.Http.ProxyScripting public bool UseCache { get; set; } - public bool Minify { get; set; } - public string[] Modules { get; set; } public string[] Controllers { get; set; } @@ -18,11 +16,10 @@ namespace Volo.Abp.Http.ProxyScripting public IDictionary Properties { get; set; } - public ProxyScriptingModel(string generatorType, bool useCache = true, bool minify = false) + public ProxyScriptingModel(string generatorType, bool useCache = true) { GeneratorType = generatorType; UseCache = useCache; - Minify = minify; Properties = new Dictionary(); } From 41db38b2b3634a4041b2a9ffaa42b60984a319b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 22:54:21 +0300 Subject: [PATCH 006/105] bump FluentValidation 8.5.0 to 8.6.0 --- .../Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj b/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj index ffd81d0789..5510af3e25 100644 --- a/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj +++ b/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj @@ -14,7 +14,7 @@ - + From 27be8db921b496fc32a3c892a8a436c9072965be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:05:14 +0300 Subject: [PATCH 007/105] bump Hangfire.AspNetCore 1.7.6 to 1.7.8 --- framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj | 2 +- .../Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj b/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj index 867565f395..c87b39d494 100644 --- a/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj +++ b/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj @@ -14,7 +14,7 @@ - + diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj index 3c2388a914..3490b31f67 100644 --- a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj +++ b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj @@ -6,7 +6,7 @@ - + From 8b4277a14cd0406febff8b133680a931caba983d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:13:10 +0300 Subject: [PATCH 008/105] bump IdentityModel 4.0.0 to 4.1.1 --- .../src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj b/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj index 0d8ef11967..886e092fdd 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj +++ b/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj @@ -14,7 +14,7 @@ - + From 46c1b5225174eeb17c005cec1f0e8dc0d5d6c6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:16:09 +0300 Subject: [PATCH 009/105] bump Microsoft.AspNetCore.Mvc.Versioning 4.0.0 to 4.1.1 --- .../src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d4affa5fca..61e4be0abb 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 @@ -25,7 +25,7 @@ - + From d4b5e0b688560cc7208eef153f77bb8e394ca916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:18:56 +0300 Subject: [PATCH 010/105] bump Microsoft.CodeAnalysis.CSharp 3.3.1 to 3.4.0 --- framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj index 46f3d32d6a..ead12c9e10 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj +++ b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj @@ -18,7 +18,7 @@ - + From 7a088fc68af07b5082f4d233d6c40fcadee5b999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:21:50 +0300 Subject: [PATCH 011/105] bump Microsoft.NET.Test.Sdk 16.3.0 to 16.4.0 --- framework/test/AbpTestBase/AbpTestBase.csproj | 2 +- .../Volo.Abp.AspNetCore.Authentication.OAuth.Tests.csproj | 2 +- .../Volo.Abp.AspNetCore.MultiTenancy.Tests.csproj | 2 +- .../Volo.Abp.AspNetCore.Mvc.Tests.csproj | 2 +- .../Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj | 2 +- .../Volo.Abp.AspNetCore.Mvc.UI.Tests.csproj | 2 +- .../Volo.Abp.AspNetCore.Mvc.Versioning.Tests.csproj | 2 +- .../Volo.Abp.AspNetCore.Tests/Volo.Abp.AspNetCore.Tests.csproj | 2 +- .../test/Volo.Abp.Auditing.Tests/Volo.Abp.Auditing.Tests.csproj | 2 +- .../Volo.Abp.Authorization.Tests.csproj | 2 +- .../Volo.Abp.AutoMapper.Tests/Volo.Abp.AutoMapper.Tests.csproj | 2 +- .../test/Volo.Abp.Autofac.Tests/Volo.Abp.Autofac.Tests.csproj | 2 +- .../Volo.Abp.BackgroundJobs.Tests.csproj | 2 +- .../test/Volo.Abp.Caching.Tests/Volo.Abp.Caching.Tests.csproj | 2 +- .../Volo.Abp.Castle.Core.Tests.csproj | 2 +- .../test/Volo.Abp.Cli.Core.Tests/Volo.Abp.Cli.Core.Tests.csproj | 2 +- framework/test/Volo.Abp.Core.Tests/Volo.Abp.Core.Tests.csproj | 2 +- .../test/Volo.Abp.Dapper.Tests/Volo.Abp.Dapper.Tests.csproj | 2 +- framework/test/Volo.Abp.Data.Tests/Volo.Abp.Data.Tests.csproj | 2 +- framework/test/Volo.Abp.Ddd.Tests/Volo.Abp.Ddd.Tests.csproj | 2 +- .../test/Volo.Abp.Emailing.Tests/Volo.Abp.Emailing.Tests.csproj | 2 +- .../Volo.Abp.EntityFrameworkCore.Tests.csproj | 2 +- .../test/Volo.Abp.EventBus.Tests/Volo.Abp.EventBus.Tests.csproj | 2 +- .../test/Volo.Abp.Features.Tests/Volo.Abp.Features.Tests.csproj | 2 +- .../Volo.Abp.FluentValidation.Tests.csproj | 2 +- .../Volo.Abp.Http.Client.Tests.csproj | 2 +- framework/test/Volo.Abp.Ldap.Tests/Volo.Abp.Ldap.Tests.csproj | 2 +- .../Volo.Abp.Localization.Tests.csproj | 2 +- .../test/Volo.Abp.MailKit.Tests/Volo.Abp.MailKit.Tests.csproj | 2 +- .../test/Volo.Abp.MemoryDb.Tests/Volo.Abp.MemoryDb.Tests.csproj | 2 +- .../test/Volo.Abp.Minify.Tests/Volo.Abp.Minify.Tests.csproj | 2 +- .../test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.MultiTenancy.Tests.csproj | 2 +- .../Volo.Abp.ObjectMapping.Tests.csproj | 2 +- .../test/Volo.Abp.Security.Tests/Volo.Abp.Security.Tests.csproj | 2 +- .../Volo.Abp.Serialization.Tests.csproj | 2 +- .../test/Volo.Abp.Settings.Tests/Volo.Abp.Settings.Tests.csproj | 2 +- .../Volo.Abp.Specifications.Tests.csproj | 2 +- .../test/Volo.Abp.TestApp.Tests/Volo.Abp.TestApp.Tests.csproj | 2 +- framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj | 2 +- .../Volo.Abp.UI.Navigation.Tests.csproj | 2 +- framework/test/Volo.Abp.Uow.Tests/Volo.Abp.Uow.Tests.csproj | 2 +- .../Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj | 2 +- .../Volo.Abp.VirtualFileSystem.Tests.csproj | 2 +- .../Acme.BookStore.Application.Tests.csproj | 2 +- .../Acme.BookStore.Domain.Tests.csproj | 2 +- .../Acme.BookStore.EntityFrameworkCore.Tests.csproj | 2 +- .../test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj | 2 +- .../Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj | 2 +- .../MyCompanyName.MyProjectName.Application.Tests.csproj | 2 +- .../MyCompanyName.MyProjectName.Domain.Tests.csproj | 2 +- ...MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj | 2 +- .../MyCompanyName.MyProjectName.MongoDB.Tests.csproj | 2 +- .../MyCompanyName.MyProjectName.TestBase.csproj | 2 +- .../MyCompanyName.MyProjectName.Web.Tests.csproj | 2 +- .../MyCompanyName.MyProjectName.Application.Tests.csproj | 2 +- .../MyCompanyName.MyProjectName.Domain.Tests.csproj | 2 +- ...MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj | 2 +- .../MyCompanyName.MyProjectName.MongoDB.Tests.csproj | 2 +- .../MyCompanyName.MyProjectName.TestBase.csproj | 2 +- 60 files changed, 60 insertions(+), 60 deletions(-) diff --git a/framework/test/AbpTestBase/AbpTestBase.csproj b/framework/test/AbpTestBase/AbpTestBase.csproj index 082da83b39..566bfde770 100644 --- a/framework/test/AbpTestBase/AbpTestBase.csproj +++ b/framework/test/AbpTestBase/AbpTestBase.csproj @@ -14,7 +14,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.Authentication.OAuth.Tests/Volo.Abp.AspNetCore.Authentication.OAuth.Tests.csproj b/framework/test/Volo.Abp.AspNetCore.Authentication.OAuth.Tests/Volo.Abp.AspNetCore.Authentication.OAuth.Tests.csproj index ff7db73875..2e6a7187fd 100644 --- a/framework/test/Volo.Abp.AspNetCore.Authentication.OAuth.Tests/Volo.Abp.AspNetCore.Authentication.OAuth.Tests.csproj +++ b/framework/test/Volo.Abp.AspNetCore.Authentication.OAuth.Tests/Volo.Abp.AspNetCore.Authentication.OAuth.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo.Abp.AspNetCore.MultiTenancy.Tests.csproj b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo.Abp.AspNetCore.MultiTenancy.Tests.csproj index bcaf6a68f2..06b6fbcd94 100644 --- a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo.Abp.AspNetCore.MultiTenancy.Tests.csproj +++ b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo.Abp.AspNetCore.MultiTenancy.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo.Abp.AspNetCore.Mvc.Tests.csproj b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo.Abp.AspNetCore.Mvc.Tests.csproj index ae4730d930..4dad128d56 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo.Abp.AspNetCore.Mvc.Tests.csproj +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo.Abp.AspNetCore.Mvc.Tests.csproj @@ -20,7 +20,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj index 8db66c0178..8a76a15f5d 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo.Abp.AspNetCore.Mvc.UI.Tests.csproj b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo.Abp.AspNetCore.Mvc.UI.Tests.csproj index 909cdbd25e..0a19e5dbdf 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo.Abp.AspNetCore.Mvc.UI.Tests.csproj +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo.Abp.AspNetCore.Mvc.UI.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo.Abp.AspNetCore.Mvc.Versioning.Tests.csproj b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo.Abp.AspNetCore.Mvc.Versioning.Tests.csproj index 91171a08d3..9ed9312919 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo.Abp.AspNetCore.Mvc.Versioning.Tests.csproj +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo.Abp.AspNetCore.Mvc.Versioning.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.Tests/Volo.Abp.AspNetCore.Tests.csproj b/framework/test/Volo.Abp.AspNetCore.Tests/Volo.Abp.AspNetCore.Tests.csproj index 789b8ba6df..dd8b1fc805 100644 --- a/framework/test/Volo.Abp.AspNetCore.Tests/Volo.Abp.AspNetCore.Tests.csproj +++ b/framework/test/Volo.Abp.AspNetCore.Tests/Volo.Abp.AspNetCore.Tests.csproj @@ -25,7 +25,7 @@ - + diff --git a/framework/test/Volo.Abp.Auditing.Tests/Volo.Abp.Auditing.Tests.csproj b/framework/test/Volo.Abp.Auditing.Tests/Volo.Abp.Auditing.Tests.csproj index b8b1033e51..770ad82870 100644 --- a/framework/test/Volo.Abp.Auditing.Tests/Volo.Abp.Auditing.Tests.csproj +++ b/framework/test/Volo.Abp.Auditing.Tests/Volo.Abp.Auditing.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo.Abp.Authorization.Tests.csproj b/framework/test/Volo.Abp.Authorization.Tests/Volo.Abp.Authorization.Tests.csproj index b137b0a2db..5abc0fc670 100644 --- a/framework/test/Volo.Abp.Authorization.Tests/Volo.Abp.Authorization.Tests.csproj +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo.Abp.Authorization.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/framework/test/Volo.Abp.AutoMapper.Tests/Volo.Abp.AutoMapper.Tests.csproj b/framework/test/Volo.Abp.AutoMapper.Tests/Volo.Abp.AutoMapper.Tests.csproj index 171f67c481..4bf0661800 100644 --- a/framework/test/Volo.Abp.AutoMapper.Tests/Volo.Abp.AutoMapper.Tests.csproj +++ b/framework/test/Volo.Abp.AutoMapper.Tests/Volo.Abp.AutoMapper.Tests.csproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.Autofac.Tests/Volo.Abp.Autofac.Tests.csproj b/framework/test/Volo.Abp.Autofac.Tests/Volo.Abp.Autofac.Tests.csproj index 4f8f97807d..bbbee3bbbb 100644 --- a/framework/test/Volo.Abp.Autofac.Tests/Volo.Abp.Autofac.Tests.csproj +++ b/framework/test/Volo.Abp.Autofac.Tests/Volo.Abp.Autofac.Tests.csproj @@ -14,7 +14,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo.Abp.BackgroundJobs.Tests.csproj b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo.Abp.BackgroundJobs.Tests.csproj index e9a9fbd131..b352c05455 100644 --- a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo.Abp.BackgroundJobs.Tests.csproj +++ b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo.Abp.BackgroundJobs.Tests.csproj @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.Caching.Tests/Volo.Abp.Caching.Tests.csproj b/framework/test/Volo.Abp.Caching.Tests/Volo.Abp.Caching.Tests.csproj index 0b127786ed..4301d8c1f4 100644 --- a/framework/test/Volo.Abp.Caching.Tests/Volo.Abp.Caching.Tests.csproj +++ b/framework/test/Volo.Abp.Caching.Tests/Volo.Abp.Caching.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/framework/test/Volo.Abp.Castle.Core.Tests/Volo.Abp.Castle.Core.Tests.csproj b/framework/test/Volo.Abp.Castle.Core.Tests/Volo.Abp.Castle.Core.Tests.csproj index 8c7129239d..9911775a60 100644 --- a/framework/test/Volo.Abp.Castle.Core.Tests/Volo.Abp.Castle.Core.Tests.csproj +++ b/framework/test/Volo.Abp.Castle.Core.Tests/Volo.Abp.Castle.Core.Tests.csproj @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.Cli.Core.Tests/Volo.Abp.Cli.Core.Tests.csproj b/framework/test/Volo.Abp.Cli.Core.Tests/Volo.Abp.Cli.Core.Tests.csproj index ef7fc3e52d..76de07406a 100644 --- a/framework/test/Volo.Abp.Cli.Core.Tests/Volo.Abp.Cli.Core.Tests.csproj +++ b/framework/test/Volo.Abp.Cli.Core.Tests/Volo.Abp.Cli.Core.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.Core.Tests/Volo.Abp.Core.Tests.csproj b/framework/test/Volo.Abp.Core.Tests/Volo.Abp.Core.Tests.csproj index 1171b49e52..5a5d49e9e0 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo.Abp.Core.Tests.csproj +++ b/framework/test/Volo.Abp.Core.Tests/Volo.Abp.Core.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.Dapper.Tests/Volo.Abp.Dapper.Tests.csproj b/framework/test/Volo.Abp.Dapper.Tests/Volo.Abp.Dapper.Tests.csproj index 8dde99ead9..33bdd870e2 100644 --- a/framework/test/Volo.Abp.Dapper.Tests/Volo.Abp.Dapper.Tests.csproj +++ b/framework/test/Volo.Abp.Dapper.Tests/Volo.Abp.Dapper.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/framework/test/Volo.Abp.Data.Tests/Volo.Abp.Data.Tests.csproj b/framework/test/Volo.Abp.Data.Tests/Volo.Abp.Data.Tests.csproj index fca4da8664..9e7cb21644 100644 --- a/framework/test/Volo.Abp.Data.Tests/Volo.Abp.Data.Tests.csproj +++ b/framework/test/Volo.Abp.Data.Tests/Volo.Abp.Data.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.Ddd.Tests/Volo.Abp.Ddd.Tests.csproj b/framework/test/Volo.Abp.Ddd.Tests/Volo.Abp.Ddd.Tests.csproj index 03179dc0aa..6c7bcc9ca5 100644 --- a/framework/test/Volo.Abp.Ddd.Tests/Volo.Abp.Ddd.Tests.csproj +++ b/framework/test/Volo.Abp.Ddd.Tests/Volo.Abp.Ddd.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.Emailing.Tests/Volo.Abp.Emailing.Tests.csproj b/framework/test/Volo.Abp.Emailing.Tests/Volo.Abp.Emailing.Tests.csproj index 754c635ec1..3a1b803370 100644 --- a/framework/test/Volo.Abp.Emailing.Tests/Volo.Abp.Emailing.Tests.csproj +++ b/framework/test/Volo.Abp.Emailing.Tests/Volo.Abp.Emailing.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo.Abp.EntityFrameworkCore.Tests.csproj b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo.Abp.EntityFrameworkCore.Tests.csproj index 41c244d81d..a01e3d111a 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo.Abp.EntityFrameworkCore.Tests.csproj +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo.Abp.EntityFrameworkCore.Tests.csproj @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo.Abp.EventBus.Tests.csproj b/framework/test/Volo.Abp.EventBus.Tests/Volo.Abp.EventBus.Tests.csproj index a3888064d2..6a7a017f4e 100644 --- a/framework/test/Volo.Abp.EventBus.Tests/Volo.Abp.EventBus.Tests.csproj +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo.Abp.EventBus.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/framework/test/Volo.Abp.Features.Tests/Volo.Abp.Features.Tests.csproj b/framework/test/Volo.Abp.Features.Tests/Volo.Abp.Features.Tests.csproj index 37922295f7..7cf1656de6 100644 --- a/framework/test/Volo.Abp.Features.Tests/Volo.Abp.Features.Tests.csproj +++ b/framework/test/Volo.Abp.Features.Tests/Volo.Abp.Features.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/framework/test/Volo.Abp.FluentValidation.Tests/Volo.Abp.FluentValidation.Tests.csproj b/framework/test/Volo.Abp.FluentValidation.Tests/Volo.Abp.FluentValidation.Tests.csproj index 97ee01d8a8..7f62578e7d 100644 --- a/framework/test/Volo.Abp.FluentValidation.Tests/Volo.Abp.FluentValidation.Tests.csproj +++ b/framework/test/Volo.Abp.FluentValidation.Tests/Volo.Abp.FluentValidation.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/framework/test/Volo.Abp.Http.Client.Tests/Volo.Abp.Http.Client.Tests.csproj b/framework/test/Volo.Abp.Http.Client.Tests/Volo.Abp.Http.Client.Tests.csproj index 8fd7c79dc6..db0f9d45bf 100644 --- a/framework/test/Volo.Abp.Http.Client.Tests/Volo.Abp.Http.Client.Tests.csproj +++ b/framework/test/Volo.Abp.Http.Client.Tests/Volo.Abp.Http.Client.Tests.csproj @@ -11,7 +11,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.Ldap.Tests/Volo.Abp.Ldap.Tests.csproj b/framework/test/Volo.Abp.Ldap.Tests/Volo.Abp.Ldap.Tests.csproj index d427434983..8f803774b2 100644 --- a/framework/test/Volo.Abp.Ldap.Tests/Volo.Abp.Ldap.Tests.csproj +++ b/framework/test/Volo.Abp.Ldap.Tests/Volo.Abp.Ldap.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo.Abp.Localization.Tests.csproj b/framework/test/Volo.Abp.Localization.Tests/Volo.Abp.Localization.Tests.csproj index db81c344da..b3afc78948 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo.Abp.Localization.Tests.csproj +++ b/framework/test/Volo.Abp.Localization.Tests/Volo.Abp.Localization.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/framework/test/Volo.Abp.MailKit.Tests/Volo.Abp.MailKit.Tests.csproj b/framework/test/Volo.Abp.MailKit.Tests/Volo.Abp.MailKit.Tests.csproj index ff98717569..b8f417d384 100644 --- a/framework/test/Volo.Abp.MailKit.Tests/Volo.Abp.MailKit.Tests.csproj +++ b/framework/test/Volo.Abp.MailKit.Tests/Volo.Abp.MailKit.Tests.csproj @@ -11,7 +11,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.MemoryDb.Tests/Volo.Abp.MemoryDb.Tests.csproj b/framework/test/Volo.Abp.MemoryDb.Tests/Volo.Abp.MemoryDb.Tests.csproj index a1991f0dd4..ad478b062a 100644 --- a/framework/test/Volo.Abp.MemoryDb.Tests/Volo.Abp.MemoryDb.Tests.csproj +++ b/framework/test/Volo.Abp.MemoryDb.Tests/Volo.Abp.MemoryDb.Tests.csproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.Minify.Tests/Volo.Abp.Minify.Tests.csproj b/framework/test/Volo.Abp.Minify.Tests/Volo.Abp.Minify.Tests.csproj index d4d2e1503a..5d07377aa1 100644 --- a/framework/test/Volo.Abp.Minify.Tests/Volo.Abp.Minify.Tests.csproj +++ b/framework/test/Volo.Abp.Minify.Tests/Volo.Abp.Minify.Tests.csproj @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj b/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj index ae65b55f85..cc1cb52a96 100644 --- a/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.MultiTenancy.Tests/Volo.Abp.MultiTenancy.Tests.csproj b/framework/test/Volo.Abp.MultiTenancy.Tests/Volo.Abp.MultiTenancy.Tests.csproj index c29e447d5a..808b58409e 100644 --- a/framework/test/Volo.Abp.MultiTenancy.Tests/Volo.Abp.MultiTenancy.Tests.csproj +++ b/framework/test/Volo.Abp.MultiTenancy.Tests/Volo.Abp.MultiTenancy.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.ObjectMapping.Tests/Volo.Abp.ObjectMapping.Tests.csproj b/framework/test/Volo.Abp.ObjectMapping.Tests/Volo.Abp.ObjectMapping.Tests.csproj index a135aea89d..a77a4e3301 100644 --- a/framework/test/Volo.Abp.ObjectMapping.Tests/Volo.Abp.ObjectMapping.Tests.csproj +++ b/framework/test/Volo.Abp.ObjectMapping.Tests/Volo.Abp.ObjectMapping.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.Security.Tests/Volo.Abp.Security.Tests.csproj b/framework/test/Volo.Abp.Security.Tests/Volo.Abp.Security.Tests.csproj index d757747ab3..7688e0c040 100644 --- a/framework/test/Volo.Abp.Security.Tests/Volo.Abp.Security.Tests.csproj +++ b/framework/test/Volo.Abp.Security.Tests/Volo.Abp.Security.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.Serialization.Tests/Volo.Abp.Serialization.Tests.csproj b/framework/test/Volo.Abp.Serialization.Tests/Volo.Abp.Serialization.Tests.csproj index eacec7ce44..c973b4fcd1 100644 --- a/framework/test/Volo.Abp.Serialization.Tests/Volo.Abp.Serialization.Tests.csproj +++ b/framework/test/Volo.Abp.Serialization.Tests/Volo.Abp.Serialization.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.Settings.Tests/Volo.Abp.Settings.Tests.csproj b/framework/test/Volo.Abp.Settings.Tests/Volo.Abp.Settings.Tests.csproj index 11656d5a8e..183b0b6c81 100644 --- a/framework/test/Volo.Abp.Settings.Tests/Volo.Abp.Settings.Tests.csproj +++ b/framework/test/Volo.Abp.Settings.Tests/Volo.Abp.Settings.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/framework/test/Volo.Abp.Specifications.Tests/Volo.Abp.Specifications.Tests.csproj b/framework/test/Volo.Abp.Specifications.Tests/Volo.Abp.Specifications.Tests.csproj index 09d2b84dfe..6b836d2efe 100644 --- a/framework/test/Volo.Abp.Specifications.Tests/Volo.Abp.Specifications.Tests.csproj +++ b/framework/test/Volo.Abp.Specifications.Tests/Volo.Abp.Specifications.Tests.csproj @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/framework/test/Volo.Abp.TestApp.Tests/Volo.Abp.TestApp.Tests.csproj b/framework/test/Volo.Abp.TestApp.Tests/Volo.Abp.TestApp.Tests.csproj index f5cc2747a9..1d54a745ab 100644 --- a/framework/test/Volo.Abp.TestApp.Tests/Volo.Abp.TestApp.Tests.csproj +++ b/framework/test/Volo.Abp.TestApp.Tests/Volo.Abp.TestApp.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj b/framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj index 63adeac3d2..522d166014 100644 --- a/framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj +++ b/framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj @@ -14,7 +14,7 @@ - + diff --git a/framework/test/Volo.Abp.UI.Navigation.Tests/Volo.Abp.UI.Navigation.Tests.csproj b/framework/test/Volo.Abp.UI.Navigation.Tests/Volo.Abp.UI.Navigation.Tests.csproj index 412610301f..51beb181a1 100644 --- a/framework/test/Volo.Abp.UI.Navigation.Tests/Volo.Abp.UI.Navigation.Tests.csproj +++ b/framework/test/Volo.Abp.UI.Navigation.Tests/Volo.Abp.UI.Navigation.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.Uow.Tests/Volo.Abp.Uow.Tests.csproj b/framework/test/Volo.Abp.Uow.Tests/Volo.Abp.Uow.Tests.csproj index ee6dd78e4c..256dd07ed6 100644 --- a/framework/test/Volo.Abp.Uow.Tests/Volo.Abp.Uow.Tests.csproj +++ b/framework/test/Volo.Abp.Uow.Tests/Volo.Abp.Uow.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj b/framework/test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj index b86adccff8..acde722180 100644 --- a/framework/test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj +++ b/framework/test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo.Abp.VirtualFileSystem.Tests.csproj b/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo.Abp.VirtualFileSystem.Tests.csproj index 6d65a8ebe6..63617f36c0 100644 --- a/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo.Abp.VirtualFileSystem.Tests.csproj +++ b/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo.Abp.VirtualFileSystem.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj b/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj index 096acccff8..01f80db3bd 100644 --- a/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj +++ b/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/BookStore/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj b/samples/BookStore/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj index ca492da8bb..af4d93ed74 100644 --- a/samples/BookStore/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj +++ b/samples/BookStore/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/BookStore/test/Acme.BookStore.EntityFrameworkCore.Tests/Acme.BookStore.EntityFrameworkCore.Tests.csproj b/samples/BookStore/test/Acme.BookStore.EntityFrameworkCore.Tests/Acme.BookStore.EntityFrameworkCore.Tests.csproj index 21d8844f5c..b326d0ccf5 100644 --- a/samples/BookStore/test/Acme.BookStore.EntityFrameworkCore.Tests/Acme.BookStore.EntityFrameworkCore.Tests.csproj +++ b/samples/BookStore/test/Acme.BookStore.EntityFrameworkCore.Tests/Acme.BookStore.EntityFrameworkCore.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/BookStore/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj b/samples/BookStore/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj index bbf3deca11..516e550f01 100644 --- a/samples/BookStore/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj +++ b/samples/BookStore/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj @@ -15,7 +15,7 @@ - + diff --git a/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj b/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj index ab49f4cf81..30f34edd0d 100644 --- a/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj +++ b/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj index 1d065f1fe6..c23b6af8d5 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Domain.Tests/MyCompanyName.MyProjectName.Domain.Tests.csproj b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Domain.Tests/MyCompanyName.MyProjectName.Domain.Tests.csproj index 5f6be193cf..12f900e989 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Domain.Tests/MyCompanyName.MyProjectName.Domain.Tests.csproj +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Domain.Tests/MyCompanyName.MyProjectName.Domain.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj index 00c50c4bdd..ad2d6683a1 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj index d9b15fd8a7..caab5d1c24 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyCompanyName.MyProjectName.TestBase.csproj b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyCompanyName.MyProjectName.TestBase.csproj index c8e6f8d59d..b1f6aa363f 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyCompanyName.MyProjectName.TestBase.csproj +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyCompanyName.MyProjectName.TestBase.csproj @@ -15,7 +15,7 @@ - + diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyCompanyName.MyProjectName.Web.Tests.csproj b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyCompanyName.MyProjectName.Web.Tests.csproj index 799552c60c..92649a5877 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyCompanyName.MyProjectName.Web.Tests.csproj +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyCompanyName.MyProjectName.Web.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj index a44ac7015b..3aab1f8ff9 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.Domain.Tests/MyCompanyName.MyProjectName.Domain.Tests.csproj b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.Domain.Tests/MyCompanyName.MyProjectName.Domain.Tests.csproj index e0aaa16705..fec1bbe88b 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.Domain.Tests/MyCompanyName.MyProjectName.Domain.Tests.csproj +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.Domain.Tests/MyCompanyName.MyProjectName.Domain.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj index fea6af2075..e45d914ca5 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj index 909865ef5b..6ad7da064f 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyCompanyName.MyProjectName.TestBase.csproj b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyCompanyName.MyProjectName.TestBase.csproj index 3e8d16ea56..0345987266 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyCompanyName.MyProjectName.TestBase.csproj +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyCompanyName.MyProjectName.TestBase.csproj @@ -8,7 +8,7 @@ - + From 6d64b72eb9c7999f58dbe6ab6f9524c0fae9eba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:23:21 +0300 Subject: [PATCH 012/105] bump MongoDB.Driver 2.9.2 to 2.10.0 --- framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj b/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj index 9f07fb9346..5cf143f99a 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj +++ b/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj @@ -14,7 +14,7 @@ - + From efccd9801fb9f670bc4aa9df25a7c7558a2de328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:24:47 +0300 Subject: [PATCH 013/105] bump Newtonsoft.Json 12.0.2 to 12.0.3 --- framework/src/Volo.Abp.Json/Volo.Abp.Json.csproj | 4 ++-- .../src/Volo.Abp.Localization/Volo.Abp.Localization.csproj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.Json/Volo.Abp.Json.csproj b/framework/src/Volo.Abp.Json/Volo.Abp.Json.csproj index 8964f2f4fe..d5407991c1 100644 --- a/framework/src/Volo.Abp.Json/Volo.Abp.Json.csproj +++ b/framework/src/Volo.Abp.Json/Volo.Abp.Json.csproj @@ -1,4 +1,4 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj index 65ceed101e..5a8cac61ee 100644 --- a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj +++ b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj @@ -18,7 +18,7 @@ - + From 388ec86755a8f8e65801f2cbbca08d45c8d28f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:26:11 +0300 Subject: [PATCH 014/105] bump NuGet.Versioning 5.3.0 to 5.4.0 --- framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj index ead12c9e10..9bf24d834b 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj +++ b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj @@ -15,7 +15,7 @@ - + From 55f84b59a2b8375462d00fe48f0f5694656b9d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:29:04 +0300 Subject: [PATCH 015/105] bump Scriban 2.1.0 to 2.1.1 --- framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj | 2 +- modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj index 5ed32e6961..41f5193eb7 100644 --- a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj +++ b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj @@ -19,7 +19,7 @@ - + diff --git a/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj b/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj index 9577e4a500..9eed7db601 100644 --- a/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj +++ b/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj @@ -19,7 +19,7 @@ - + From 198d9e826047c553ff2d84e1891ae9a01ac54eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:29:31 +0300 Subject: [PATCH 016/105] bump Pomelo.EntityFrameworkCore.MySql 3.0.0 to 3.0.1 --- .../Volo.Abp.EntityFrameworkCore.MySQL.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo.Abp.EntityFrameworkCore.MySQL.csproj b/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo.Abp.EntityFrameworkCore.MySQL.csproj index b7f6fb276a..b63a2ae7cb 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo.Abp.EntityFrameworkCore.MySQL.csproj +++ b/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo.Abp.EntityFrameworkCore.MySQL.csproj @@ -18,7 +18,7 @@ - + From b5891ffc773b449fbfce6cdac049b37fcaabaad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:30:35 +0300 Subject: [PATCH 017/105] bump System.Collections.Immutable 1.6.0 to 1.7.0 --- framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj b/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj index 3eee02f0ac..42c60785ba 100644 --- a/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj +++ b/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj @@ -12,7 +12,7 @@ - + From 146bc59595e7776f1eca4e64db4c81d976680bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:31:33 +0300 Subject: [PATCH 018/105] bump System.Security.Permissions 4.6.0 to 4.7.0 --- framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj index 9bf24d834b..8fbd17b0f1 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj +++ b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj @@ -17,7 +17,7 @@ - + From 68754b62ec45a1396f7ba8642516bc0a15c18c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:37:03 +0300 Subject: [PATCH 019/105] bump Microsoft.NET.Test.Sdk 16.2.0 to 16.4.0 --- .../Volo.Abp.Account.Application.Tests.csproj | 2 +- .../Volo.Abp.AuditLogging.EntityFrameworkCore.Tests.csproj | 2 +- .../Volo.Abp.AuditLogging.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.AuditLogging.TestBase.csproj | 2 +- .../Volo.Abp.AuditLogging.Tests.csproj | 2 +- .../Volo.Abp.BackgroundJobs.Domain.Tests.csproj | 2 +- .../Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests.csproj | 2 +- .../Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.BackgroundJobs.TestBase.csproj | 2 +- .../Volo.Blogging.Application.Tests.csproj | 2 +- .../Volo.Blogging.Domain.Tests.csproj | 2 +- .../Volo.Blogging.EntityFrameworkCore.Tests.csproj | 2 +- .../Volo.Blogging.MongoDB.Tests.csproj | 2 +- .../test/Volo.Blogging.TestBase/Volo.Blogging.TestBase.csproj | 2 +- .../Volo.Docs.Admin.Application.Tests.csproj | 2 +- .../Volo.Docs.Application.Tests.csproj | 2 +- .../test/Volo.Docs.Domain.Tests/Volo.Docs.Domain.Tests.csproj | 2 +- .../Volo.Docs.EntityFrameworkCore.Tests.csproj | 2 +- .../test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj | 2 +- modules/docs/test/Volo.Docs.TestBase/Volo.Docs.TestBase.csproj | 2 +- .../Volo.Abp.FeatureManagement.Application.Tests.csproj | 2 +- .../Volo.Abp.FeatureManagement.Domain.Tests.csproj | 2 +- .../Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests.csproj | 2 +- .../Volo.Abp.FeatureManagement.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.FeatureManagement.TestBase.csproj | 2 +- .../Volo.Abp.Identity.Application.Tests.csproj | 2 +- .../Volo.Abp.Identity.Domain.Tests.csproj | 2 +- .../Volo.Abp.Identity.EntityFrameworkCore.Tests.csproj | 2 +- .../Volo.Abp.Identity.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.Identity.TestBase.csproj | 2 +- .../Volo.Abp.IdentityServer.Domain.Tests.csproj | 2 +- .../Volo.Abp.IdentityServer.EntityFrameworkCore.Tests.csproj | 2 +- .../Volo.Abp.IdentityServer.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.IdentityServer.TestBase.csproj | 2 +- .../Volo.Abp.PermissionManagement.Application.Tests.csproj | 2 +- ...lo.Abp.PermissionManagement.EntityFrameworkCore.Tests.csproj | 2 +- .../Volo.Abp.PermissionManagement.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.PermissionManagement.TestBase.csproj | 2 +- .../Volo.Abp.PermissionManagement.Tests.csproj | 2 +- .../Volo.Abp.SettingManagement.EntityFrameworkCore.Tests.csproj | 2 +- .../Volo.Abp.SettingManagement.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.SettingManagement.TestBase.csproj | 2 +- .../Volo.Abp.SettingManagement.Tests.csproj | 2 +- .../Volo.Abp.TenantManagement.Application.Tests.csproj | 2 +- .../Volo.Abp.TenantManagement.Domain.Tests.csproj | 2 +- .../Volo.Abp.TenantManagement.EntityFrameworkCore.Tests.csproj | 2 +- .../Volo.Abp.TenantManagement.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.TenantManagement.TestBase.csproj | 2 +- .../Acme.BookStore.Application.Tests.csproj | 2 +- .../Acme.BookStore.Domain.Tests.csproj | 2 +- .../Acme.BookStore.MongoDB.Tests.csproj | 2 +- .../test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj | 2 +- .../Acme.BookStore.Application.Tests.csproj | 2 +- .../Acme.BookStore.Domain.Tests.csproj | 2 +- .../Acme.BookStore.EntityFrameworkCore.Tests.csproj | 2 +- .../test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj | 2 +- .../Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj | 2 +- .../Acme.BookStore.BookManagement.Application.Tests.csproj | 2 +- .../Acme.BookStore.BookManagement.Domain.Tests.csproj | 2 +- ...me.BookStore.BookManagement.EntityFrameworkCore.Tests.csproj | 2 +- .../Acme.BookStore.BookManagement.MongoDB.Tests.csproj | 2 +- .../Acme.BookStore.BookManagement.TestBase.csproj | 2 +- .../DashboardDemo.Application.Tests.csproj | 2 +- .../DashboardDemo.Domain.Tests.csproj | 2 +- .../DashboardDemo.EntityFrameworkCore.Tests.csproj | 2 +- .../test/DashboardDemo.TestBase/DashboardDemo.TestBase.csproj | 2 +- .../test/DashboardDemo.Web.Tests/DashboardDemo.Web.Tests.csproj | 2 +- .../ProductManagement.Application.Tests.csproj | 2 +- .../ProductManagement.Domain.Tests.csproj | 2 +- .../ProductManagement.EntityFrameworkCore.Tests.csproj | 2 +- .../ProductManagement.TestBase.csproj | 2 +- 71 files changed, 71 insertions(+), 71 deletions(-) diff --git a/modules/account/test/Volo.Abp.Account.Application.Tests/Volo.Abp.Account.Application.Tests.csproj b/modules/account/test/Volo.Abp.Account.Application.Tests/Volo.Abp.Account.Application.Tests.csproj index c8b85dcaee..e8d3f84ead 100644 --- a/modules/account/test/Volo.Abp.Account.Application.Tests/Volo.Abp.Account.Application.Tests.csproj +++ b/modules/account/test/Volo.Abp.Account.Application.Tests/Volo.Abp.Account.Application.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests.csproj b/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests.csproj index 27d4817501..8ee9a2e2f6 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests.csproj +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj index 37eaac2693..6ccaf0d9b0 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo.Abp.AuditLogging.TestBase.csproj b/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo.Abp.AuditLogging.TestBase.csproj index 7068fcf8e5..eff6ddc14b 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo.Abp.AuditLogging.TestBase.csproj +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo.Abp.AuditLogging.TestBase.csproj @@ -14,7 +14,7 @@ - + diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo.Abp.AuditLogging.Tests.csproj b/modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo.Abp.AuditLogging.Tests.csproj index ccaef6bd0e..31a70aa5b1 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo.Abp.AuditLogging.Tests.csproj +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo.Abp.AuditLogging.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.Domain.Tests/Volo.Abp.BackgroundJobs.Domain.Tests.csproj b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.Domain.Tests/Volo.Abp.BackgroundJobs.Domain.Tests.csproj index 917a1b1146..c7d43a8e71 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.Domain.Tests/Volo.Abp.BackgroundJobs.Domain.Tests.csproj +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.Domain.Tests/Volo.Abp.BackgroundJobs.Domain.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests.csproj b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests.csproj index 81998369e0..25434f3b06 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests.csproj +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj index 3802e0091c..d0d3caf58d 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo.Abp.BackgroundJobs.TestBase.csproj b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo.Abp.BackgroundJobs.TestBase.csproj index 445d3652ac..e6d7131439 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo.Abp.BackgroundJobs.TestBase.csproj +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo.Abp.BackgroundJobs.TestBase.csproj @@ -14,7 +14,7 @@ - + diff --git a/modules/blogging/test/Volo.Blogging.Application.Tests/Volo.Blogging.Application.Tests.csproj b/modules/blogging/test/Volo.Blogging.Application.Tests/Volo.Blogging.Application.Tests.csproj index 7b2e893ce6..473f1442c8 100644 --- a/modules/blogging/test/Volo.Blogging.Application.Tests/Volo.Blogging.Application.Tests.csproj +++ b/modules/blogging/test/Volo.Blogging.Application.Tests/Volo.Blogging.Application.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/blogging/test/Volo.Blogging.Domain.Tests/Volo.Blogging.Domain.Tests.csproj b/modules/blogging/test/Volo.Blogging.Domain.Tests/Volo.Blogging.Domain.Tests.csproj index 0a8e38a5dc..dbc49033d3 100644 --- a/modules/blogging/test/Volo.Blogging.Domain.Tests/Volo.Blogging.Domain.Tests.csproj +++ b/modules/blogging/test/Volo.Blogging.Domain.Tests/Volo.Blogging.Domain.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo.Blogging.EntityFrameworkCore.Tests.csproj b/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo.Blogging.EntityFrameworkCore.Tests.csproj index a82999e3a1..8b92f8b67b 100644 --- a/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo.Blogging.EntityFrameworkCore.Tests.csproj +++ b/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo.Blogging.EntityFrameworkCore.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj index c02eb49044..498b728ecf 100644 --- a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj +++ b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/blogging/test/Volo.Blogging.TestBase/Volo.Blogging.TestBase.csproj b/modules/blogging/test/Volo.Blogging.TestBase/Volo.Blogging.TestBase.csproj index 35d576a8c6..cd2ea5e009 100644 --- a/modules/blogging/test/Volo.Blogging.TestBase/Volo.Blogging.TestBase.csproj +++ b/modules/blogging/test/Volo.Blogging.TestBase/Volo.Blogging.TestBase.csproj @@ -12,7 +12,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo.Docs.Admin.Application.Tests.csproj b/modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo.Docs.Admin.Application.Tests.csproj index 28eb762481..1063314379 100644 --- a/modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo.Docs.Admin.Application.Tests.csproj +++ b/modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo.Docs.Admin.Application.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.Application.Tests/Volo.Docs.Application.Tests.csproj b/modules/docs/test/Volo.Docs.Application.Tests/Volo.Docs.Application.Tests.csproj index 6ce42e6d8e..4b86efc543 100644 --- a/modules/docs/test/Volo.Docs.Application.Tests/Volo.Docs.Application.Tests.csproj +++ b/modules/docs/test/Volo.Docs.Application.Tests/Volo.Docs.Application.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.Domain.Tests/Volo.Docs.Domain.Tests.csproj b/modules/docs/test/Volo.Docs.Domain.Tests/Volo.Docs.Domain.Tests.csproj index 6b4a73e803..ea4e45c897 100644 --- a/modules/docs/test/Volo.Docs.Domain.Tests/Volo.Docs.Domain.Tests.csproj +++ b/modules/docs/test/Volo.Docs.Domain.Tests/Volo.Docs.Domain.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.EntityFrameworkCore.Tests/Volo.Docs.EntityFrameworkCore.Tests.csproj b/modules/docs/test/Volo.Docs.EntityFrameworkCore.Tests/Volo.Docs.EntityFrameworkCore.Tests.csproj index 2a0b4d6d22..c17dc2c2da 100644 --- a/modules/docs/test/Volo.Docs.EntityFrameworkCore.Tests/Volo.Docs.EntityFrameworkCore.Tests.csproj +++ b/modules/docs/test/Volo.Docs.EntityFrameworkCore.Tests/Volo.Docs.EntityFrameworkCore.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj index 1d1953d9b9..938c1dd7bd 100644 --- a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj +++ b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.TestBase/Volo.Docs.TestBase.csproj b/modules/docs/test/Volo.Docs.TestBase/Volo.Docs.TestBase.csproj index bc767d2094..4b007dde24 100644 --- a/modules/docs/test/Volo.Docs.TestBase/Volo.Docs.TestBase.csproj +++ b/modules/docs/test/Volo.Docs.TestBase/Volo.Docs.TestBase.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo.Abp.FeatureManagement.Application.Tests.csproj b/modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo.Abp.FeatureManagement.Application.Tests.csproj index e155dc4425..ef81b4b9ea 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo.Abp.FeatureManagement.Application.Tests.csproj +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo.Abp.FeatureManagement.Application.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo.Abp.FeatureManagement.Domain.Tests.csproj b/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo.Abp.FeatureManagement.Domain.Tests.csproj index 80e20e1c81..585f399d3e 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo.Abp.FeatureManagement.Domain.Tests.csproj +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo.Abp.FeatureManagement.Domain.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests.csproj b/modules/feature-management/test/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests.csproj index 2c84ab25bb..8a8b62a666 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests.csproj +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj index 8c217b529c..fdc4a750fa 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo.Abp.FeatureManagement.TestBase.csproj b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo.Abp.FeatureManagement.TestBase.csproj index 21d4cbc76c..ca00d3ddf1 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo.Abp.FeatureManagement.TestBase.csproj +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo.Abp.FeatureManagement.TestBase.csproj @@ -14,7 +14,7 @@ - + diff --git a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo.Abp.Identity.Application.Tests.csproj b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo.Abp.Identity.Application.Tests.csproj index 46ced70f5a..58a34d0198 100644 --- a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo.Abp.Identity.Application.Tests.csproj +++ b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo.Abp.Identity.Application.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo.Abp.Identity.Domain.Tests.csproj b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo.Abp.Identity.Domain.Tests.csproj index 2c9ecaef14..59614115e4 100644 --- a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo.Abp.Identity.Domain.Tests.csproj +++ b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo.Abp.Identity.Domain.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo.Abp.Identity.EntityFrameworkCore.Tests.csproj b/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo.Abp.Identity.EntityFrameworkCore.Tests.csproj index 988d327a6d..5e01379951 100644 --- a/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo.Abp.Identity.EntityFrameworkCore.Tests.csproj +++ b/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo.Abp.Identity.EntityFrameworkCore.Tests.csproj @@ -20,7 +20,7 @@ - + diff --git a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj index 8c70ffe772..3b2c6c925d 100644 --- a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj +++ b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo.Abp.Identity.TestBase.csproj b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo.Abp.Identity.TestBase.csproj index 306ee09327..71bf7d84c0 100644 --- a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo.Abp.Identity.TestBase.csproj +++ b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo.Abp.Identity.TestBase.csproj @@ -19,7 +19,7 @@ - + diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo.Abp.IdentityServer.Domain.Tests.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo.Abp.IdentityServer.Domain.Tests.csproj index fa53edcd89..ce12bb92eb 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo.Abp.IdentityServer.Domain.Tests.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo.Abp.IdentityServer.Domain.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests.csproj index 915709e8b7..4876a42c56 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj index 2aba61db0d..36081d867b 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo.Abp.IdentityServer.TestBase.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo.Abp.IdentityServer.TestBase.csproj index 60e98e6d29..c02b7d5c13 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo.Abp.IdentityServer.TestBase.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo.Abp.IdentityServer.TestBase.csproj @@ -19,7 +19,7 @@ - + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo.Abp.PermissionManagement.Application.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo.Abp.PermissionManagement.Application.Tests.csproj index c17b20f355..92cd6ddd5d 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo.Abp.PermissionManagement.Application.Tests.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo.Abp.PermissionManagement.Application.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests.csproj index f1510b8f17..c3e5d1d750 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests.csproj @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj index 140772eadc..76058626cb 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo.Abp.PermissionManagement.TestBase.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo.Abp.PermissionManagement.TestBase.csproj index 49dfaf8af7..ae6afc0cbf 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo.Abp.PermissionManagement.TestBase.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo.Abp.PermissionManagement.TestBase.csproj @@ -18,7 +18,7 @@ - + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo.Abp.PermissionManagement.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo.Abp.PermissionManagement.Tests.csproj index 889a464c81..c9a10af869 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo.Abp.PermissionManagement.Tests.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo.Abp.PermissionManagement.Tests.csproj @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests.csproj b/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests.csproj index a6ddba5616..1a04328983 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests.csproj +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj index 8a1c723db4..08f8292f00 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo.Abp.SettingManagement.TestBase.csproj b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo.Abp.SettingManagement.TestBase.csproj index bfa3355d60..d847419296 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo.Abp.SettingManagement.TestBase.csproj +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo.Abp.SettingManagement.TestBase.csproj @@ -18,7 +18,7 @@ - + diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo.Abp.SettingManagement.Tests.csproj b/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo.Abp.SettingManagement.Tests.csproj index f358429196..7f99e1ae2c 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo.Abp.SettingManagement.Tests.csproj +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo.Abp.SettingManagement.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.Application.Tests/Volo.Abp.TenantManagement.Application.Tests.csproj b/modules/tenant-management/test/Volo.Abp.TenantManagement.Application.Tests/Volo.Abp.TenantManagement.Application.Tests.csproj index b177b0e3aa..65498d6f38 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.Application.Tests/Volo.Abp.TenantManagement.Application.Tests.csproj +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.Application.Tests/Volo.Abp.TenantManagement.Application.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.Domain.Tests/Volo.Abp.TenantManagement.Domain.Tests.csproj b/modules/tenant-management/test/Volo.Abp.TenantManagement.Domain.Tests/Volo.Abp.TenantManagement.Domain.Tests.csproj index 448dca7f18..8dd16201cb 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.Domain.Tests/Volo.Abp.TenantManagement.Domain.Tests.csproj +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.Domain.Tests/Volo.Abp.TenantManagement.Domain.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests.csproj b/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests.csproj index 8b1f523d22..528fd9e4e9 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests.csproj +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj index 527aaeaf0c..51111f0cd1 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo.Abp.TenantManagement.TestBase.csproj b/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo.Abp.TenantManagement.TestBase.csproj index cea0e714b8..e1978abcce 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo.Abp.TenantManagement.TestBase.csproj +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo.Abp.TenantManagement.TestBase.csproj @@ -18,7 +18,7 @@ - + diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj index 37e33c50a1..ae2a3df88f 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj index 5353e38c90..f8845ac4dd 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/Acme.BookStore.MongoDB.Tests.csproj b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/Acme.BookStore.MongoDB.Tests.csproj index 4095bd3463..32341270d7 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/Acme.BookStore.MongoDB.Tests.csproj +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/Acme.BookStore.MongoDB.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj index c445951e20..7493c31929 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj @@ -15,7 +15,7 @@ - + diff --git a/samples/BookStore-Modular/application/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj b/samples/BookStore-Modular/application/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj index 37e33c50a1..ae2a3df88f 100644 --- a/samples/BookStore-Modular/application/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj +++ b/samples/BookStore-Modular/application/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/BookStore-Modular/application/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj b/samples/BookStore-Modular/application/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj index 91e90ac007..1f9b387058 100644 --- a/samples/BookStore-Modular/application/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj +++ b/samples/BookStore-Modular/application/test/Acme.BookStore.Domain.Tests/Acme.BookStore.Domain.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/BookStore-Modular/application/test/Acme.BookStore.EntityFrameworkCore.Tests/Acme.BookStore.EntityFrameworkCore.Tests.csproj b/samples/BookStore-Modular/application/test/Acme.BookStore.EntityFrameworkCore.Tests/Acme.BookStore.EntityFrameworkCore.Tests.csproj index 1eeaa9c847..dd2137ad06 100644 --- a/samples/BookStore-Modular/application/test/Acme.BookStore.EntityFrameworkCore.Tests/Acme.BookStore.EntityFrameworkCore.Tests.csproj +++ b/samples/BookStore-Modular/application/test/Acme.BookStore.EntityFrameworkCore.Tests/Acme.BookStore.EntityFrameworkCore.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/BookStore-Modular/application/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj b/samples/BookStore-Modular/application/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj index c445951e20..7493c31929 100644 --- a/samples/BookStore-Modular/application/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj +++ b/samples/BookStore-Modular/application/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj @@ -15,7 +15,7 @@ - + diff --git a/samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj b/samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj index b52ad58df0..df1197d3b2 100644 --- a/samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj +++ b/samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.Application.Tests/Acme.BookStore.BookManagement.Application.Tests.csproj b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.Application.Tests/Acme.BookStore.BookManagement.Application.Tests.csproj index db8ed539a9..c0441db54c 100644 --- a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.Application.Tests/Acme.BookStore.BookManagement.Application.Tests.csproj +++ b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.Application.Tests/Acme.BookStore.BookManagement.Application.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.Domain.Tests/Acme.BookStore.BookManagement.Domain.Tests.csproj b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.Domain.Tests/Acme.BookStore.BookManagement.Domain.Tests.csproj index f4165bc4f6..de67d2e56e 100644 --- a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.Domain.Tests/Acme.BookStore.BookManagement.Domain.Tests.csproj +++ b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.Domain.Tests/Acme.BookStore.BookManagement.Domain.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.EntityFrameworkCore.Tests/Acme.BookStore.BookManagement.EntityFrameworkCore.Tests.csproj b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.EntityFrameworkCore.Tests/Acme.BookStore.BookManagement.EntityFrameworkCore.Tests.csproj index 89e31207d9..a262f7fe57 100644 --- a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.EntityFrameworkCore.Tests/Acme.BookStore.BookManagement.EntityFrameworkCore.Tests.csproj +++ b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.EntityFrameworkCore.Tests/Acme.BookStore.BookManagement.EntityFrameworkCore.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.MongoDB.Tests/Acme.BookStore.BookManagement.MongoDB.Tests.csproj b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.MongoDB.Tests/Acme.BookStore.BookManagement.MongoDB.Tests.csproj index 627243a1c9..eea1c76030 100644 --- a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.MongoDB.Tests/Acme.BookStore.BookManagement.MongoDB.Tests.csproj +++ b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.MongoDB.Tests/Acme.BookStore.BookManagement.MongoDB.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.TestBase/Acme.BookStore.BookManagement.TestBase.csproj b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.TestBase/Acme.BookStore.BookManagement.TestBase.csproj index f981181684..81698d278f 100644 --- a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.TestBase/Acme.BookStore.BookManagement.TestBase.csproj +++ b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.TestBase/Acme.BookStore.BookManagement.TestBase.csproj @@ -8,7 +8,7 @@ - + diff --git a/samples/DashboardDemo/test/DashboardDemo.Application.Tests/DashboardDemo.Application.Tests.csproj b/samples/DashboardDemo/test/DashboardDemo.Application.Tests/DashboardDemo.Application.Tests.csproj index 68bac55053..66ac6f7698 100644 --- a/samples/DashboardDemo/test/DashboardDemo.Application.Tests/DashboardDemo.Application.Tests.csproj +++ b/samples/DashboardDemo/test/DashboardDemo.Application.Tests/DashboardDemo.Application.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/DashboardDemo/test/DashboardDemo.Domain.Tests/DashboardDemo.Domain.Tests.csproj b/samples/DashboardDemo/test/DashboardDemo.Domain.Tests/DashboardDemo.Domain.Tests.csproj index 3991177506..28f2ae7aee 100644 --- a/samples/DashboardDemo/test/DashboardDemo.Domain.Tests/DashboardDemo.Domain.Tests.csproj +++ b/samples/DashboardDemo/test/DashboardDemo.Domain.Tests/DashboardDemo.Domain.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/DashboardDemo/test/DashboardDemo.EntityFrameworkCore.Tests/DashboardDemo.EntityFrameworkCore.Tests.csproj b/samples/DashboardDemo/test/DashboardDemo.EntityFrameworkCore.Tests/DashboardDemo.EntityFrameworkCore.Tests.csproj index 0389134bf3..2d4e5d409e 100644 --- a/samples/DashboardDemo/test/DashboardDemo.EntityFrameworkCore.Tests/DashboardDemo.EntityFrameworkCore.Tests.csproj +++ b/samples/DashboardDemo/test/DashboardDemo.EntityFrameworkCore.Tests/DashboardDemo.EntityFrameworkCore.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemo.TestBase.csproj b/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemo.TestBase.csproj index d260d752d6..ad7db1ac7e 100644 --- a/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemo.TestBase.csproj +++ b/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemo.TestBase.csproj @@ -15,7 +15,7 @@ - + diff --git a/samples/DashboardDemo/test/DashboardDemo.Web.Tests/DashboardDemo.Web.Tests.csproj b/samples/DashboardDemo/test/DashboardDemo.Web.Tests/DashboardDemo.Web.Tests.csproj index 459f19781b..91bf825be1 100644 --- a/samples/DashboardDemo/test/DashboardDemo.Web.Tests/DashboardDemo.Web.Tests.csproj +++ b/samples/DashboardDemo/test/DashboardDemo.Web.Tests/DashboardDemo.Web.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/ProductManagement.Application.Tests.csproj b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/ProductManagement.Application.Tests.csproj index 79453da466..6e2e2fcd0f 100644 --- a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/ProductManagement.Application.Tests.csproj +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/ProductManagement.Application.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement.Domain.Tests.csproj b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement.Domain.Tests.csproj index adc5771d8e..4ba80b1a97 100644 --- a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement.Domain.Tests.csproj +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement.Domain.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/ProductManagement.EntityFrameworkCore.Tests.csproj b/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/ProductManagement.EntityFrameworkCore.Tests.csproj index cc92913f55..6a10664e46 100644 --- a/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/ProductManagement.EntityFrameworkCore.Tests.csproj +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/ProductManagement.EntityFrameworkCore.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj index 9a88d726ac..d91687ffea 100644 --- a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj @@ -13,7 +13,7 @@ - + From 1f5e3666043ea7e27fe4c38b9fd3837a90a7c29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:39:08 +0300 Subject: [PATCH 020/105] bump Mongo2Go 2.2.11 to 2.2.12 --- .../Volo.Abp.AuditLogging.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj | 2 +- .../Volo.Blogging.MongoDB.Tests.csproj | 2 +- .../test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.FeatureManagement.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.Identity.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.IdentityServer.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.PermissionManagement.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.SettingManagement.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.TenantManagement.MongoDB.Tests.csproj | 2 +- .../Volo.Abp.Users.MongoDB.Tests.csproj | 2 +- .../Acme.BookStore.MongoDB.Tests.csproj | 2 +- .../Acme.BookStore.BookManagement.MongoDB.Tests.csproj | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj index 6ccaf0d9b0..b5c7084cf2 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj index d0d3caf58d..faece9ea33 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj index 498b728ecf..cc46eead03 100644 --- a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj +++ b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj index 938c1dd7bd..3a8d3cb7d9 100644 --- a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj +++ b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj index fdc4a750fa..37ebd8aa4a 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj index 3b2c6c925d..22edeae68a 100644 --- a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj +++ b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj @@ -20,7 +20,7 @@ - + diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj index 36081d867b..6459a4c307 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj @@ -20,7 +20,7 @@ - + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj index 76058626cb..1f66b07cf5 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj index 08f8292f00..791758698d 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj index 51111f0cd1..8cd0fbdae2 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo.Abp.Users.MongoDB.Tests.csproj b/modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo.Abp.Users.MongoDB.Tests.csproj index 2ba192fe5f..5a5fdebd93 100644 --- a/modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo.Abp.Users.MongoDB.Tests.csproj +++ b/modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo.Abp.Users.MongoDB.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/Acme.BookStore.MongoDB.Tests.csproj b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/Acme.BookStore.MongoDB.Tests.csproj index 32341270d7..df57cc47c2 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/Acme.BookStore.MongoDB.Tests.csproj +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.MongoDB.Tests/Acme.BookStore.MongoDB.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.MongoDB.Tests/Acme.BookStore.BookManagement.MongoDB.Tests.csproj b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.MongoDB.Tests/Acme.BookStore.BookManagement.MongoDB.Tests.csproj index eea1c76030..6bface97bf 100644 --- a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.MongoDB.Tests/Acme.BookStore.BookManagement.MongoDB.Tests.csproj +++ b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.MongoDB.Tests/Acme.BookStore.BookManagement.MongoDB.Tests.csproj @@ -9,7 +9,7 @@ - + From 5ded1f255520a0653eba0741ec51df688078cdf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:43:53 +0300 Subject: [PATCH 021/105] bump NSubstitute to 4.2.1 --- .../Volo.Abp.AuditLogging.TestBase.csproj | 2 +- .../Volo.Abp.BackgroundJobs.TestBase.csproj | 2 +- .../test/Volo.Blogging.TestBase/Volo.Blogging.TestBase.csproj | 2 +- modules/docs/test/Volo.Docs.TestBase/Volo.Docs.TestBase.csproj | 2 +- .../Volo.Abp.FeatureManagement.TestBase.csproj | 2 +- .../Volo.Abp.Identity.TestBase.csproj | 2 +- .../Volo.Abp.PermissionManagement.TestBase.csproj | 2 +- .../Volo.Abp.SettingManagement.TestBase.csproj | 2 +- .../Volo.Abp.TenantManagement.TestBase.csproj | 2 +- .../Volo.Abp.Users.Tests.Shared.csproj | 2 +- .../test/DashboardDemo.TestBase/DashboardDemo.TestBase.csproj | 2 +- .../ProductManagement.TestBase.csproj | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo.Abp.AuditLogging.TestBase.csproj b/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo.Abp.AuditLogging.TestBase.csproj index eff6ddc14b..157301aecb 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo.Abp.AuditLogging.TestBase.csproj +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo.Abp.AuditLogging.TestBase.csproj @@ -15,7 +15,7 @@ - + diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo.Abp.BackgroundJobs.TestBase.csproj b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo.Abp.BackgroundJobs.TestBase.csproj index e6d7131439..538f9376fb 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo.Abp.BackgroundJobs.TestBase.csproj +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo.Abp.BackgroundJobs.TestBase.csproj @@ -15,7 +15,7 @@ - + diff --git a/modules/blogging/test/Volo.Blogging.TestBase/Volo.Blogging.TestBase.csproj b/modules/blogging/test/Volo.Blogging.TestBase/Volo.Blogging.TestBase.csproj index cd2ea5e009..bdc6873c3a 100644 --- a/modules/blogging/test/Volo.Blogging.TestBase/Volo.Blogging.TestBase.csproj +++ b/modules/blogging/test/Volo.Blogging.TestBase/Volo.Blogging.TestBase.csproj @@ -13,7 +13,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.TestBase/Volo.Docs.TestBase.csproj b/modules/docs/test/Volo.Docs.TestBase/Volo.Docs.TestBase.csproj index 4b007dde24..aeed82e1dd 100644 --- a/modules/docs/test/Volo.Docs.TestBase/Volo.Docs.TestBase.csproj +++ b/modules/docs/test/Volo.Docs.TestBase/Volo.Docs.TestBase.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo.Abp.FeatureManagement.TestBase.csproj b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo.Abp.FeatureManagement.TestBase.csproj index ca00d3ddf1..571adf02c8 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo.Abp.FeatureManagement.TestBase.csproj +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo.Abp.FeatureManagement.TestBase.csproj @@ -15,7 +15,7 @@ - + diff --git a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo.Abp.Identity.TestBase.csproj b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo.Abp.Identity.TestBase.csproj index 71bf7d84c0..de9dc07587 100644 --- a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo.Abp.Identity.TestBase.csproj +++ b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo.Abp.Identity.TestBase.csproj @@ -20,7 +20,7 @@ - + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo.Abp.PermissionManagement.TestBase.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo.Abp.PermissionManagement.TestBase.csproj index ae6afc0cbf..ba8c20e337 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo.Abp.PermissionManagement.TestBase.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo.Abp.PermissionManagement.TestBase.csproj @@ -19,7 +19,7 @@ - + diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo.Abp.SettingManagement.TestBase.csproj b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo.Abp.SettingManagement.TestBase.csproj index d847419296..75f44e1ca3 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo.Abp.SettingManagement.TestBase.csproj +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo.Abp.SettingManagement.TestBase.csproj @@ -19,7 +19,7 @@ - + diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo.Abp.TenantManagement.TestBase.csproj b/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo.Abp.TenantManagement.TestBase.csproj index e1978abcce..89b9c1aae2 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo.Abp.TenantManagement.TestBase.csproj +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo.Abp.TenantManagement.TestBase.csproj @@ -19,7 +19,7 @@ - + diff --git a/modules/users/test/Volo.Abp.Users.Tests.Shared/Volo.Abp.Users.Tests.Shared.csproj b/modules/users/test/Volo.Abp.Users.Tests.Shared/Volo.Abp.Users.Tests.Shared.csproj index 4aeb17b9c5..ececb4eddd 100644 --- a/modules/users/test/Volo.Abp.Users.Tests.Shared/Volo.Abp.Users.Tests.Shared.csproj +++ b/modules/users/test/Volo.Abp.Users.Tests.Shared/Volo.Abp.Users.Tests.Shared.csproj @@ -21,7 +21,7 @@ - + diff --git a/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemo.TestBase.csproj b/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemo.TestBase.csproj index ad7db1ac7e..fc0fe296f5 100644 --- a/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemo.TestBase.csproj +++ b/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemo.TestBase.csproj @@ -16,7 +16,7 @@ - + diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj index d91687ffea..7d0ffde718 100644 --- a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj @@ -14,7 +14,7 @@ - + From 20b14205ec61acbfeed8859c37feef50da97e8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:48:55 +0300 Subject: [PATCH 022/105] bump Serilog.Sinks.File 4.0.0 to 4.1.0 --- .../app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj | 2 +- .../Volo.Blogging.Application/Volo.Blogging.Application.csproj | 2 +- .../Volo.ClientSimulation.Demo.csproj | 2 +- modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj | 2 +- .../Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj | 2 +- .../Acme.BookStore.HttpApi.Host.csproj | 2 +- .../Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj | 2 +- .../src/Acme.BookStore.Web/Acme.BookStore.Web.csproj | 2 +- .../Acme.BookStore.BookManagement.HttpApi.Host.csproj | 2 +- .../Acme.BookStore.BookManagement.IdentityServer.csproj | 2 +- .../Acme.BookStore.BookManagement.Web.Host.csproj | 2 +- .../Acme.BookStore.BookManagement.Web.Unified.csproj | 2 +- .../Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj | 2 +- .../BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj | 2 +- .../DashboardDemo.DbMigrator/DashboardDemo.DbMigrator.csproj | 2 +- .../src/DashboardDemo.Web/DashboardDemo.Web.csproj | 2 +- .../applications/AuthServer.Host/AuthServer.Host.csproj | 2 +- .../BackendAdminApp.Host/BackendAdminApp.Host.csproj | 2 +- .../applications/ConsoleClientDemo/ConsoleClientDemo.csproj | 2 +- .../applications/PublicWebSite.Host/PublicWebSite.Host.csproj | 2 +- .../BackendAdminAppGateway.Host.csproj | 2 +- .../gateways/InternalGateway.Host/InternalGateway.Host.csproj | 2 +- .../PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj | 2 +- .../BloggingService.Host/BloggingService.Host.csproj | 2 +- .../IdentityService.Host/IdentityService.Host.csproj | 2 +- .../ProductService.Host/ProductService.Host.csproj | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj b/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj index b0aa8c1183..c1bb7c8a85 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj +++ b/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj @@ -13,7 +13,7 @@ - + diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj b/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj index 95682a2a9e..a162d644df 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj +++ b/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj @@ -10,7 +10,7 @@ - + diff --git a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj index e69e3146c7..8544cf6cff 100644 --- a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj +++ b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj @@ -9,7 +9,7 @@ - + diff --git a/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj b/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj index ae50728391..ef8fc992e3 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj +++ b/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj @@ -15,7 +15,7 @@ - + diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj index e5d3d64aef..93dd5d112b 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj @@ -20,7 +20,7 @@ - + diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj index bd6a1fb86a..5ae1c6fd4f 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj @@ -11,7 +11,7 @@ - + diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj b/samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj index 8e66b5c321..1d97d62f42 100644 --- a/samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj +++ b/samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj @@ -20,7 +20,7 @@ - + diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj b/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj index 88626cc10b..95f3607ab0 100644 --- a/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj +++ b/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj @@ -33,7 +33,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Acme.BookStore.BookManagement.HttpApi.Host.csproj b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Acme.BookStore.BookManagement.HttpApi.Host.csproj index 78548f8822..cc7b77c983 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Acme.BookStore.BookManagement.HttpApi.Host.csproj +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Acme.BookStore.BookManagement.HttpApi.Host.csproj @@ -11,7 +11,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Acme.BookStore.BookManagement.IdentityServer.csproj b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Acme.BookStore.BookManagement.IdentityServer.csproj index cbb6d3592a..49875e0980 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Acme.BookStore.BookManagement.IdentityServer.csproj +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Acme.BookStore.BookManagement.IdentityServer.csproj @@ -9,7 +9,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Acme.BookStore.BookManagement.Web.Host.csproj b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Acme.BookStore.BookManagement.Web.Host.csproj index f66c9dba9f..0534b56365 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Acme.BookStore.BookManagement.Web.Host.csproj +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Acme.BookStore.BookManagement.Web.Host.csproj @@ -11,7 +11,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Acme.BookStore.BookManagement.Web.Unified.csproj b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Acme.BookStore.BookManagement.Web.Unified.csproj index f8202a26d6..9fb034d5fe 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Acme.BookStore.BookManagement.Web.Unified.csproj +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Acme.BookStore.BookManagement.Web.Unified.csproj @@ -11,7 +11,7 @@ - + diff --git a/samples/BookStore/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj b/samples/BookStore/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj index b13f4bb668..6003aa8be2 100644 --- a/samples/BookStore/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj +++ b/samples/BookStore/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj @@ -24,7 +24,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj index cdf23d260a..8ab1856779 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj +++ b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj @@ -24,7 +24,7 @@ - + diff --git a/samples/DashboardDemo/src/DashboardDemo.DbMigrator/DashboardDemo.DbMigrator.csproj b/samples/DashboardDemo/src/DashboardDemo.DbMigrator/DashboardDemo.DbMigrator.csproj index 342472c60f..9b5dd44bb2 100644 --- a/samples/DashboardDemo/src/DashboardDemo.DbMigrator/DashboardDemo.DbMigrator.csproj +++ b/samples/DashboardDemo/src/DashboardDemo.DbMigrator/DashboardDemo.DbMigrator.csproj @@ -18,7 +18,7 @@ - + diff --git a/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj b/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj index b5b158c074..8198fe148a 100644 --- a/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj +++ b/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj @@ -32,7 +32,7 @@ - + diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj b/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj index 6b0902118a..337657a831 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj index 8f844d4fe7..911593b16a 100644 --- a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj +++ b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj b/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj index 3958486141..6b8283bddf 100644 --- a/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj +++ b/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj @@ -6,7 +6,7 @@ - + diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSite.Host.csproj b/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSite.Host.csproj index 7ab6319f56..5574e33b3b 100644 --- a/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSite.Host.csproj +++ b/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSite.Host.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj index 706a77693a..3ee01c5696 100644 --- a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj +++ b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj b/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj index 6bce8966b5..ce97d9c91e 100644 --- a/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj +++ b/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj index d4e2c73bad..599b07e966 100644 --- a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj +++ b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj index 60a294f223..ef6ada68b0 100644 --- a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj +++ b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityService.Host.csproj b/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityService.Host.csproj index cd5f965f1e..18b07ae6db 100644 --- a/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityService.Host.csproj +++ b/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityService.Host.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/MicroserviceDemo/microservices/ProductService.Host/ProductService.Host.csproj b/samples/MicroserviceDemo/microservices/ProductService.Host/ProductService.Host.csproj index 07e02bbc70..6bf9e04e7b 100644 --- a/samples/MicroserviceDemo/microservices/ProductService.Host/ProductService.Host.csproj +++ b/samples/MicroserviceDemo/microservices/ProductService.Host/ProductService.Host.csproj @@ -13,7 +13,7 @@ - + From bce64d2f4a196cfd8882a0686a57cf98a0e2570e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:53:21 +0300 Subject: [PATCH 023/105] bump Markdig.Signed to 0.18.0 --- modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj b/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj index 9eed7db601..2adfb50de0 100644 --- a/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj +++ b/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj @@ -18,7 +18,7 @@ - + From bf76b8f8dda50cb258deb05992a844e37935b207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Fri, 13 Dec 2019 23:55:59 +0300 Subject: [PATCH 024/105] bump octokit 0.29.0 to 0.36.0 --- modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj | 2 +- modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestBase.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj index b7f28a876b..9de0a675ea 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj +++ b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj @@ -16,7 +16,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestBase.cs b/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestBase.cs index e8b7fa0126..6073b65e03 100644 --- a/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestBase.cs +++ b/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestBase.cs @@ -32,6 +32,7 @@ namespace Volo.Docs "https://api.github.com/repos/abpframework/abp/releases/16293679/assets", "https://uploads.github.com/repos/abpframework/abp/releases/16293679/assets{?name,label}", 16293679, + "", "0.15.0", "master", "0.15.0", From 2b19e859a11954f3ced33f524f3708a8c7f8ec54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Sat, 14 Dec 2019 00:03:38 +0300 Subject: [PATCH 025/105] bump IdentityServer4 and IdentityServer4.AspNetIdentity 3.0.0 to 3.0.2 --- .../Volo.Abp.IdentityServer.Domain.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj index 798f2e360c..70d0fbcba7 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj @@ -23,8 +23,8 @@ - - + + From 5d4160e09518bb9bb429149d231d5bfd0b2eb1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Sat, 14 Dec 2019 00:20:33 +0300 Subject: [PATCH 026/105] bump IdentityServer4.AccessTokenValidation 3.0.1 --- .../Acme.BookStore.HttpApi.Host.csproj | 2 +- .../src/Acme.BookStore.Web/Acme.BookStore.Web.csproj | 2 +- .../Acme.BookStore.BookManagement.HttpApi.Host.csproj | 2 +- .../Acme.BookStore.BookManagement.IdentityServer.csproj | 2 +- .../BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj | 2 +- .../src/DashboardDemo.Web/DashboardDemo.Web.csproj | 2 +- .../BackendAdminAppGateway.Host.csproj | 2 +- .../gateways/InternalGateway.Host/InternalGateway.Host.csproj | 2 +- .../PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj | 2 +- .../BloggingService.Host/BloggingService.Host.csproj | 2 +- .../IdentityService.Host/IdentityService.Host.csproj | 2 +- .../ProductService.Host/ProductService.Host.csproj | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj index 5ae1c6fd4f..46638e1958 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj @@ -14,7 +14,7 @@ - + diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj b/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj index 95f3607ab0..b71bc65d91 100644 --- a/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj +++ b/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj @@ -36,7 +36,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Acme.BookStore.BookManagement.HttpApi.Host.csproj b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Acme.BookStore.BookManagement.HttpApi.Host.csproj index cc7b77c983..db35047e19 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Acme.BookStore.BookManagement.HttpApi.Host.csproj +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Acme.BookStore.BookManagement.HttpApi.Host.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Acme.BookStore.BookManagement.IdentityServer.csproj b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Acme.BookStore.BookManagement.IdentityServer.csproj index 49875e0980..c0eebd425a 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Acme.BookStore.BookManagement.IdentityServer.csproj +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Acme.BookStore.BookManagement.IdentityServer.csproj @@ -11,7 +11,7 @@ - + diff --git a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj index 8ab1856779..153b6f38e3 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj +++ b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj @@ -29,7 +29,7 @@ - + diff --git a/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj b/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj index 8198fe148a..466a7359bc 100644 --- a/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj +++ b/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj @@ -34,7 +34,7 @@ - + diff --git a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj index 3ee01c5696..9d2d4c3cae 100644 --- a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj +++ b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj @@ -17,7 +17,7 @@ - + diff --git a/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj b/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj index ce97d9c91e..8d7d8bf135 100644 --- a/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj +++ b/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj @@ -17,7 +17,7 @@ - + diff --git a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj index 599b07e966..2c01555e87 100644 --- a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj +++ b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj @@ -17,7 +17,7 @@ - + diff --git a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj index ef6ada68b0..5a9c5375d0 100644 --- a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj +++ b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj @@ -16,7 +16,7 @@ - + diff --git a/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityService.Host.csproj b/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityService.Host.csproj index 18b07ae6db..09e91582ab 100644 --- a/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityService.Host.csproj +++ b/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityService.Host.csproj @@ -16,7 +16,7 @@ - + diff --git a/samples/MicroserviceDemo/microservices/ProductService.Host/ProductService.Host.csproj b/samples/MicroserviceDemo/microservices/ProductService.Host/ProductService.Host.csproj index 6bf9e04e7b..f871ed5983 100644 --- a/samples/MicroserviceDemo/microservices/ProductService.Host/ProductService.Host.csproj +++ b/samples/MicroserviceDemo/microservices/ProductService.Host/ProductService.Host.csproj @@ -16,7 +16,7 @@ - + From ddacb68246c0efb075668a862cfa64bec8d683be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Tu=CC=88ken?= Date: Sat, 14 Dec 2019 00:25:12 +0300 Subject: [PATCH 027/105] bump Serilog.Extensions.Logging 3.0.1 --- .../Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj | 2 +- .../Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj | 2 +- .../DashboardDemo.DbMigrator/DashboardDemo.DbMigrator.csproj | 2 +- .../applications/ConsoleClientDemo/ConsoleClientDemo.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj index 93dd5d112b..9b7543cf7f 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj @@ -19,7 +19,7 @@ - + diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj b/samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj index 1d97d62f42..7b08e55bda 100644 --- a/samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj +++ b/samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj @@ -19,7 +19,7 @@ - + diff --git a/samples/DashboardDemo/src/DashboardDemo.DbMigrator/DashboardDemo.DbMigrator.csproj b/samples/DashboardDemo/src/DashboardDemo.DbMigrator/DashboardDemo.DbMigrator.csproj index 9b5dd44bb2..cb4d1b1604 100644 --- a/samples/DashboardDemo/src/DashboardDemo.DbMigrator/DashboardDemo.DbMigrator.csproj +++ b/samples/DashboardDemo/src/DashboardDemo.DbMigrator/DashboardDemo.DbMigrator.csproj @@ -17,7 +17,7 @@ - + diff --git a/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj b/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj index 6b8283bddf..0e9b3e5faa 100644 --- a/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj +++ b/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj @@ -7,7 +7,7 @@ - + From 167c7428d880a600a0bb4a885e9a968f1050ad59 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 16 Dec 2019 13:33:46 +0300 Subject: [PATCH 028/105] role pages pagination application and mvc --- .../Volo/Abp/Identity/IIdentityRoleAppService.cs | 2 +- .../Volo/Abp/Identity/IdentityRoleAppService.cs | 10 +++++++--- .../Volo/Abp/Identity/IdentityRoleController.cs | 4 ++-- .../Pages/Identity/Roles/index.js | 7 ++++--- .../Pages/Identity/Users/CreateModal.cshtml.cs | 6 +++++- .../Pages/Identity/Users/EditModal.cshtml.cs | 6 +++++- .../Volo/Abp/Identity/IdentityRoleAppService_Tests.cs | 6 +++++- 7 files changed, 29 insertions(+), 12 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs index 3fec60599d..0f573634a4 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs @@ -8,7 +8,7 @@ namespace Volo.Abp.Identity { public interface IIdentityRoleAppService : IApplicationService { - Task> GetListAsync(); + Task> GetListAsync(PagedAndSortedResultRequestDto input); Task CreateAsync(IdentityRoleCreateDto input); 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 0c1750f2fb..f2b902d271 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 @@ -28,11 +28,15 @@ namespace Volo.Abp.Identity ); } - public virtual async Task> GetListAsync() + public virtual async Task> GetListAsync(PagedAndSortedResultRequestDto input) { - var list = await _roleRepository.GetListAsync(); + var list = await _roleRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount); + var totalCount = await _roleRepository.GetCountAsync(); - return new ListResultDto(ObjectMapper.Map, List>(list)); + return new PagedResultDto( + totalCount, + ObjectMapper.Map, List>(list) + ); } [Authorize(IdentityPermissions.Roles.Create)] diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs index 35ec928f5c..09760109d0 100644 --- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs @@ -20,9 +20,9 @@ namespace Volo.Abp.Identity } [HttpGet] - public virtual Task> GetListAsync() + public virtual Task> GetListAsync(PagedAndSortedResultRequestDto input) { - return _roleAppService.GetListAsync(); + return _roleAppService.GetListAsync(input); } [HttpGet] diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js index 6127dfe9c1..eb0892338c 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js @@ -14,9 +14,10 @@ var _dataTable = _$table.DataTable(abp.libs.datatables.normalizeConfiguration({ order: [[1, "asc"]], - searching:false, - paging:false, - info:false, + searching: false, + processing: true, + serverSide: true, + paging: true, ajax: abp.libs.datatables.createAjax(_identityRoleAppService.getList), columnDefs: [ { diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs index 3c5451208a..21e7702814 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs @@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Application.Dtos; namespace Volo.Abp.Identity.Web.Pages.Identity.Users { @@ -27,7 +28,10 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users { UserInfo = new UserInfoViewModel(); - var roleDtoList = await _identityRoleAppService.GetListAsync(); + var roleDtoList = await _identityRoleAppService.GetListAsync(new PagedAndSortedResultRequestDto + { + MaxResultCount = int.MaxValue + }); Roles = ObjectMapper.Map, AssignedRoleViewModel[]>(roleDtoList.Items); diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs index 364a1b4049..3bedfaeda2 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs @@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Entities; namespace Volo.Abp.Identity.Web.Pages.Identity.Users @@ -30,7 +31,10 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users UserInfo = ObjectMapper.Map(await _identityUserAppService.GetAsync(id)); Roles = ObjectMapper.Map, AssignedRoleViewModel[]>( - (await _identityRoleAppService.GetListAsync()).Items + (await _identityRoleAppService.GetListAsync(new PagedAndSortedResultRequestDto + { + MaxResultCount = int.MaxValue + })).Items ); var userRoleNames = (await _identityUserAppService.GetRolesAsync(UserInfo.Id)).Items.Select(r => r.Name).ToList(); diff --git a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs index 03e872271f..b05142c912 100644 --- a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs +++ b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using Xunit; using Shouldly; +using Volo.Abp.Application.Dtos; namespace Volo.Abp.Identity { @@ -38,7 +39,10 @@ namespace Volo.Abp.Identity { //Act - var result = await _roleAppService.GetListAsync(); + var result = await _roleAppService.GetListAsync(new PagedAndSortedResultRequestDto + { + MaxResultCount = int.MaxValue + }); //Assert From 8ed4b5f9dc07dc6353b7d00f14b454fcf75f4fe5 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 17 Dec 2019 14:59:01 +0300 Subject: [PATCH 029/105] refactor(identity): change form build method name --- .../lib/components/roles/roles.component.ts | 8 +-- .../lib/components/users/users.component.html | 51 +++++++++++++++---- .../lib/components/users/users.component.ts | 8 +-- 3 files changed, 50 insertions(+), 17 deletions(-) diff --git a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts index 48bbe5964f..5c6a38e12c 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts +++ b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts @@ -1,7 +1,7 @@ import { ABP } from '@abp/ng.core'; import { ConfirmationService, Toaster } from '@abp/ng.theme.shared'; -import { Component, TemplateRef, ViewChild, OnInit, ContentChild, ElementRef } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { Select, Store } from '@ngxs/store'; import { Observable } from 'rxjs'; import { finalize, pluck } from 'rxjs/operators'; @@ -59,7 +59,7 @@ export class RolesComponent implements OnInit { this.get(); } - createForm() { + buildForm() { this.form = this.fb.group({ name: new FormControl({ value: this.selected.name || '', disabled: this.selected.isStatic }, [ Validators.required, @@ -71,7 +71,7 @@ export class RolesComponent implements OnInit { } openModal() { - this.createForm(); + this.buildForm(); this.isModalVisible = true; } diff --git a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html index 41d8244697..eab3339318 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html +++ b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html @@ -12,7 +12,8 @@ type="button" (click)="add()" > - {{ 'AbpIdentity::NewUser' | abpLocalization }} + + {{ 'AbpIdentity::NewUser' | abpLocalization }} @@ -59,12 +60,21 @@ {{ 'AbpIdentity::Actions' | abpLocalization }} {{ 'AbpIdentity::UserName' | abpLocalization }} - + {{ 'AbpIdentity::EmailAddress' | abpLocalization }} - + {{ 'AbpIdentity::PhoneNumber' | abpLocalization }} @@ -86,7 +96,11 @@ {{ 'AbpIdentity::Actions' | abpLocalization }}
-
@@ -142,7 +162,9 @@
- +
@@ -166,7 +188,12 @@
- +
@@ -210,7 +237,9 @@ [attr.id]="'roles-' + i" [formControl]="roleGroup.controls[roles[i].name]" /> - +
@@ -229,5 +258,9 @@ - + diff --git a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts index f258c5147b..b0cbacb324 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts +++ b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts @@ -1,14 +1,15 @@ import { ABP, ConfigState } from '@abp/ng.core'; import { ConfirmationService, Toaster } from '@abp/ng.theme.shared'; -import { Component, TemplateRef, TrackByFunction, ViewChild, OnInit } from '@angular/core'; +import { Component, OnInit, TemplateRef, TrackByFunction, ViewChild } from '@angular/core'; import { AbstractControl, FormArray, FormBuilder, + FormControl, FormGroup, Validators, - FormControl, } from '@angular/forms'; +import { PasswordRules, validatePassword } from '@ngx-validate/core'; import { Select, Store } from '@ngxs/store'; import { Observable } from 'rxjs'; import { finalize, pluck, switchMap, take } from 'rxjs/operators'; @@ -16,15 +17,14 @@ import snq from 'snq'; import { CreateUser, DeleteUser, + GetRoles, GetUserById, GetUserRoles, GetUsers, UpdateUser, - GetRoles, } from '../../actions/identity.actions'; import { Identity } from '../../models/identity'; import { IdentityState } from '../../states/identity.state'; -import { PasswordRules, validatePassword } from '@ngx-validate/core'; @Component({ selector: 'abp-users', templateUrl: './users.component.html', From a6ccc3320fa17a017325c24015616589a7255be0 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 19 Dec 2019 13:30:34 +0800 Subject: [PATCH 030/105] Add Razor support for mvc. Resolve #2420 --- .../Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj | 1 + .../Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj | 1 + .../Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj | 1 + .../Volo.Abp.AspNetCore.Mvc.UI.Packages.csproj | 1 + .../Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj | 1 + .../Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj | 1 + .../Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj | 1 + .../Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj | 1 + .../src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj | 1 + 9 files changed, 9 insertions(+) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj index f3556c1dbd..c6ad85408b 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj @@ -4,6 +4,7 @@ netcoreapp3.1 + true Volo.Abp.AspNetCore.Mvc.UI.Bootstrap Volo.Abp.AspNetCore.Mvc.UI.Bootstrap $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj index 8601c0e51d..a1b83cbaef 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj @@ -4,6 +4,7 @@ netcoreapp3.1 + true Volo.Abp.AspNetCore.Mvc.UI.Bundling Volo.Abp.AspNetCore.Mvc.UI.Bundling true diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj index 960fbd3205..7a31569dda 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj @@ -4,6 +4,7 @@ netcoreapp3.1 + true Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo.Abp.AspNetCore.Mvc.UI.Packages.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo.Abp.AspNetCore.Mvc.UI.Packages.csproj index 92937c38ce..7a86cbb464 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo.Abp.AspNetCore.Mvc.UI.Packages.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo.Abp.AspNetCore.Mvc.UI.Packages.csproj @@ -4,6 +4,7 @@ netcoreapp3.1 + true Volo.Abp.AspNetCore.Mvc.UI.Packages Volo.Abp.AspNetCore.Mvc.UI.Packages true diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj index f26bc29d7e..168ca481fd 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj @@ -4,6 +4,7 @@ netcoreapp3.1 + true Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj index c869ae2789..0962057909 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj @@ -4,6 +4,7 @@ netcoreapp3.1 + true Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj index d9651aca86..d26c12fc7a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj @@ -4,6 +4,7 @@ netcoreapp3.1 + true Volo.Abp.AspNetCore.Mvc.UI.Widgets Volo.Abp.AspNetCore.Mvc.UI.Widgets true diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj index aff29f8709..fb784efd44 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj @@ -4,6 +4,7 @@ netcoreapp3.1 + true Volo.Abp.AspNetCore.Mvc.UI Volo.Abp.AspNetCore.Mvc.UI $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; 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 d4affa5fca..9e8980367b 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 @@ -4,6 +4,7 @@ netcoreapp3.1 + true Volo.Abp.AspNetCore.Mvc Volo.Abp.AspNetCore.Mvc $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; From 0ae1d767d48ce13588e41893a0b926260c94ba41 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 20 Dec 2019 16:47:01 +0300 Subject: [PATCH 031/105] feature(core): add state actions to state services --- .../core/src/lib/services/config-state.service.ts | 14 ++++++++++++++ .../core/src/lib/services/profile-state.service.ts | 14 ++++++++++++++ .../core/src/lib/services/session-state.service.ts | 10 ++++++++++ 3 files changed, 38 insertions(+) diff --git a/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts index d238fd4734..877fdab0d3 100644 --- a/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngxs/store'; import { ConfigState } from '../states'; +import { GetAppConfiguration, PatchRouteByName, AddRoute } from '../actions/config.actions'; +import { ABP } from '../models'; @Injectable({ providedIn: 'root', @@ -47,4 +49,16 @@ export class ConfigStateService { getLocalization(...args: Parameters) { return this.store.selectSnapshot(ConfigState.getLocalization(...args)); } + + addData() { + return this.store.dispatch(new GetAppConfiguration()); + } + + patchRoute(name: string, newValue: Partial) { + return this.store.dispatch(new PatchRouteByName(name, newValue)); + } + + addRoute(payload: Omit) { + return this.store.dispatch(new AddRoute(payload)); + } } diff --git a/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts index 7dea8de2ea..372ce40e19 100644 --- a/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngxs/store'; import { ProfileState } from '../states'; +import { Profile } from '../models'; +import { GetProfile, UpdateProfile, ChangePassword } from '../actions'; @Injectable({ providedIn: 'root', @@ -11,4 +13,16 @@ export class ProfileStateService { getProfile() { return this.store.selectSnapshot(ProfileState.getProfile); } + + fetchProfile() { + return this.store.dispatch(new GetProfile()); + } + + updateProfile(payload: Profile.Response) { + return this.store.dispatch(new UpdateProfile(payload)); + } + + changePassword(payload: Profile.ChangePasswordRequest) { + return this.store.dispatch(new ChangePassword(payload)); + } } diff --git a/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts index b74a8ed397..af7261229e 100644 --- a/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngxs/store'; import { SessionState } from '../states'; +import { ABP } from '../models'; +import { SetLanguage, SetTenant } from '../actions'; @Injectable({ providedIn: 'root', @@ -15,4 +17,12 @@ export class SessionStateService { getTenant() { return this.store.selectSnapshot(SessionState.getTenant); } + + setLanguage(payload: string) { + return this.store.dispatch(new SetLanguage(payload)); + } + + setTenant(payload: ABP.BasicItem) { + return this.store.dispatch(new SetTenant(payload)); + } } From e2fb9384c47b1a3604a8eb00ce2d6850e6630936 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 20 Dec 2019 16:47:50 +0300 Subject: [PATCH 032/105] feature(feature-management): add state actions to state service --- .../lib/services/feature-management-state.service.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts b/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts index a40d0f6186..94f2f7fc6b 100644 --- a/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts +++ b/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngxs/store'; import { FeatureManagementState } from '../states'; +import { FeatureManagement } from '../models'; +import { GetFeatures, UpdateFeatures } from '../actions'; @Injectable({ providedIn: 'root', @@ -11,4 +13,12 @@ export class FeatureManagementStateService { getFeatures() { return this.store.selectSnapshot(FeatureManagementState.getFeatures); } + + fetchFeatures(payload: FeatureManagement.Provider) { + return this.store.dispatch(new GetFeatures(payload)); + } + + updateFeatures(payload: FeatureManagement.Provider & FeatureManagement.Features) { + return this.store.dispatch(new UpdateFeatures(payload)); + } } From b2e5362d835821a49a5ec0314eb1ead67cfd4832 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 20 Dec 2019 16:48:12 +0300 Subject: [PATCH 033/105] feature(identity): add actions to state service --- .../lib/services/identity-state.service.ts | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts b/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts index e5abe60fe9..746645e98d 100644 --- a/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts +++ b/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts @@ -1,5 +1,20 @@ +import { ABP } from '@abp/ng.core'; import { Injectable } from '@angular/core'; import { Store } from '@ngxs/store'; +import { + CreateRole, + CreateUser, + DeleteRole, + DeleteUser, + GetRoleById, + GetRoles, + GetUserById, + GetUsers, + UpdateRole, + UpdateUser, + GetUserRoles, +} from '../actions/identity.actions'; +import { Identity } from '../models/identity'; import { IdentityState } from '../states/identity.state'; @Injectable({ @@ -20,4 +35,48 @@ export class IdentityStateService { getUsersTotalCount() { return this.store.selectSnapshot(IdentityState.getUsersTotalCount); } + + fetchRoles(payload?: ABP.PageQueryParams) { + return this.store.dispatch(new GetRoles(payload)); + } + + fetchRole(payload: string) { + return this.store.dispatch(new GetRoleById(payload)); + } + + deleteRole(payload: string) { + return this.store.dispatch(new DeleteRole(payload)); + } + + createRole(payload: Identity.RoleSaveRequest) { + return this.store.dispatch(new CreateRole(payload)); + } + + updateRole(payload: Identity.RoleItem) { + return this.store.dispatch(new UpdateRole(payload)); + } + + fetchUsers(payload?: ABP.PageQueryParams) { + return this.store.dispatch(new GetUsers(payload)); + } + + fetchUser(payload: string) { + return this.store.dispatch(new GetUserById(payload)); + } + + deleteUser(payload: string) { + return this.store.dispatch(new DeleteUser(payload)); + } + + createUser(payload: Identity.UserSaveRequest) { + return this.store.dispatch(new CreateUser(payload)); + } + + updateUser(payload: Identity.UserItem) { + return this.store.dispatch(new UpdateUser(payload)); + } + + getUserRoles(payload: string) { + return this.store.dispatch(new GetUserRoles(payload)); + } } From 76c578a22415e2582b36c8897624d0903b7570d0 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 20 Dec 2019 17:04:20 +0300 Subject: [PATCH 034/105] fix(identity): correct parameter type --- .../identity/src/lib/services/identity-state.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts b/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts index 746645e98d..9448273c0c 100644 --- a/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts +++ b/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts @@ -72,7 +72,7 @@ export class IdentityStateService { return this.store.dispatch(new CreateUser(payload)); } - updateUser(payload: Identity.UserItem) { + updateUser(payload: Identity.UserSaveRequest & { id: string }) { return this.store.dispatch(new UpdateUser(payload)); } From efae782ccee7e89812d8415b27f81693785812c3 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 20 Dec 2019 17:06:07 +0300 Subject: [PATCH 035/105] feature(permission-management): add actions to state service --- .../services/permission-management-state.service.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts b/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts index a85d637c87..243926aaea 100644 --- a/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts +++ b/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngxs/store'; import { PermissionManagementState } from '../states/permission-management.state'; +import { PermissionManagement } from '../models'; +import { GetPermissions, UpdatePermissions } from '../actions'; @Injectable({ providedIn: 'root', @@ -14,4 +16,14 @@ export class PermissionManagementStateService { getEntityDisplayName() { return this.store.selectSnapshot(PermissionManagementState.getEntityDisplayName); } + + getPermissions(payload: PermissionManagement.GrantedProvider) { + return this.store.dispatch(new GetPermissions(payload)); + } + + updatePermissions( + payload: PermissionManagement.GrantedProvider & PermissionManagement.UpdateRequest, + ) { + return this.store.dispatch(new UpdatePermissions(payload)); + } } From 0114677c636d37d9322ac8bf867f21982d6e5a0e Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 20 Dec 2019 17:33:27 +0300 Subject: [PATCH 036/105] feature(tenant-management): add actions to state service --- .../tenant-management-state.service.ts | 23 +++++++++++++++++++ .../src/lib/states/tenant-management.state.ts | 6 ++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts b/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts index 442289a66f..e27e4b3d67 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts @@ -1,6 +1,9 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngxs/store'; import { TenantManagementState } from '../states/tenant-management.state'; +import { ABP } from '@abp/ng.core'; +import { GetTenants, GetTenantById, CreateTenant, UpdateTenant, DeleteTenant } from '../actions'; +import { TenantManagement } from '../models'; @Injectable({ providedIn: 'root', @@ -15,4 +18,24 @@ export class TenantManagementStateService { getTenantsTotalCount() { return this.store.selectSnapshot(TenantManagementState.getTenantsTotalCount); } + + getTenants(payload?: ABP.PageQueryParams) { + return this.store.dispatch(new GetTenants(payload)); + } + + getTenantById(payload: string) { + return this.store.dispatch(new GetTenantById(payload)); + } + + createTenant(payload: TenantManagement.AddRequest) { + return this.store.dispatch(new CreateTenant(payload)); + } + + updateTenant(payload: TenantManagement.UpdateRequest) { + return this.store.dispatch(new UpdateTenant(payload)); + } + + deleteTenant(payload: string) { + return this.store.dispatch(new DeleteTenant(payload)); + } } diff --git a/npm/ng-packs/packages/tenant-management/src/lib/states/tenant-management.state.ts b/npm/ng-packs/packages/tenant-management/src/lib/states/tenant-management.state.ts index c183cb48cc..bbd4a35d4f 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/states/tenant-management.state.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/states/tenant-management.state.ts @@ -1,15 +1,15 @@ +import { ABP } from '@abp/ng.core'; import { Action, Selector, State, StateContext } from '@ngxs/store'; -import { switchMap, tap } from 'rxjs/operators'; +import { tap } from 'rxjs/operators'; import { CreateTenant, DeleteTenant, - GetTenants, GetTenantById, + GetTenants, UpdateTenant, } from '../actions/tenant-management.actions'; import { TenantManagement } from '../models/tenant-management'; import { TenantManagementService } from '../services/tenant-management.service'; -import { ABP } from '@abp/ng.core'; @State({ name: 'TenantManagementState', From 447237426e69cf642820c435d6d03ffab2b2ea09 Mon Sep 17 00:00:00 2001 From: YinChang Date: Sun, 8 Dec 2019 17:43:23 +0800 Subject: [PATCH 037/105] modify several module's SettingDefinitionProvider to support multi-lingual --- .../Volo.Abp.Emailing.csproj | 10 ++++++ .../Volo/Abp/Emailing/AbpEmailingModule.cs | 10 ++++++ .../Volo/Abp/Emailing/EmailSettingProvider.cs | 24 ++++++++----- .../Emailing/Localization/EmailingResource.cs | 10 ++++++ .../Volo/Abp/Emailing/Localization/en.json | 23 ++++++++++++ .../Abp/Emailing/Localization/zh-Hans.json | 23 ++++++++++++ .../LocalizationSettingProvider.cs | 9 +++-- .../Resources/AbpValidation/en.json | 4 ++- .../Resources/AbpValidation/zh-Hans.json | 4 ++- .../Account/Localization/Resources/en.json | 6 +++- .../Localization/Resources/zh-Hans.json | 6 +++- .../AccountSettingDefinitionProvider.cs | 12 +++++-- .../Volo/Abp/Identity/Localization/en.json | 28 ++++++++++++++- .../Abp/Identity/Localization/zh-Hans.json | 29 ++++++++++++++- .../AbpIdentitySettingDefinitionProvider.cs | 35 +++++++++++-------- 15 files changed, 199 insertions(+), 34 deletions(-) create mode 100644 framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/EmailingResource.cs create mode 100644 framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/en.json create mode 100644 framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hans.json diff --git a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj index 5ed32e6961..51ba1544db 100644 --- a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj +++ b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj @@ -18,6 +18,16 @@
+ + + + + + + + + + diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs index 55ec63b9ac..b8195ecf09 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.BackgroundJobs; +using Volo.Abp.Emailing.Localization; using Volo.Abp.Emailing.Templates; using Volo.Abp.Localization; using Volo.Abp.Modularity; @@ -30,6 +31,15 @@ namespace Volo.Abp.Emailing options.FileSets.AddEmbedded(); }); + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes( + typeof(EmailingResource) + ).AddVirtualJson("/Volo/Abp/Emailing/Localization"); + }); + Configure(options => { options.AddJob(); diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSettingProvider.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSettingProvider.cs index 32d1fb8c1c..8e3ade25a9 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSettingProvider.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSettingProvider.cs @@ -1,3 +1,5 @@ +using Volo.Abp.Emailing.Localization; +using Volo.Abp.Localization; using Volo.Abp.Settings; namespace Volo.Abp.Emailing @@ -11,16 +13,20 @@ namespace Volo.Abp.Emailing public override void Define(ISettingDefinitionContext context) { context.Add( - new SettingDefinition(EmailSettingNames.Smtp.Host, "127.0.0.1"), - new SettingDefinition(EmailSettingNames.Smtp.Port, "25"), - new SettingDefinition(EmailSettingNames.Smtp.UserName), - new SettingDefinition(EmailSettingNames.Smtp.Password, isEncrypted: true), - new SettingDefinition(EmailSettingNames.Smtp.Domain), - new SettingDefinition(EmailSettingNames.Smtp.EnableSsl, "false"), - new SettingDefinition(EmailSettingNames.Smtp.UseDefaultCredentials, "true"), - new SettingDefinition(EmailSettingNames.DefaultFromAddress, "noreply@abp.io"), - new SettingDefinition(EmailSettingNames.DefaultFromDisplayName, "ABP application") + new SettingDefinition(EmailSettingNames.Smtp.Host, "127.0.0.1", L("DisplayName:Abp.Mailing.Smtp.Host"), L("Description:Abp.Mailing.Smtp.Host")), + new SettingDefinition(EmailSettingNames.Smtp.Port, "25", L("DisplayName:Abp.Mailing.Smtp.Port"), L("Description:Abp.Mailing.Smtp.Port")), + new SettingDefinition(EmailSettingNames.Smtp.UserName, displayName: L("DisplayName:Abp.Mailing.Smtp.UserName"), description: L("Description:Abp.Mailing.Smtp.UserName")), + new SettingDefinition(EmailSettingNames.Smtp.Password, displayName: L("DisplayName:Abp.Mailing.Smtp.Password"), description: L("Description:Abp.Mailing.Smtp.Password"), isEncrypted: true), + new SettingDefinition(EmailSettingNames.Smtp.Domain, displayName: L("DisplayName:Abp.Mailing.Smtp.Domain"), description: L("Description:Abp.Mailing.Smtp.Domain")), + new SettingDefinition(EmailSettingNames.Smtp.EnableSsl, "false", L("DisplayName:Abp.Mailing.Smtp.EnableSsl"), L("Description:Abp.Mailing.Smtp.EnableSsl")), + new SettingDefinition(EmailSettingNames.Smtp.UseDefaultCredentials, "true", L("DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials"), L("Description:Abp.Mailing.Smtp.UseDefaultCredentials")), + new SettingDefinition(EmailSettingNames.DefaultFromAddress, "noreply@abp.io", L("DisplayName:Abp.Mailing.DefaultFromAddress"), L("Description:Abp.Mailing.DefaultFromAddress")), + new SettingDefinition(EmailSettingNames.DefaultFromDisplayName, "ABP application", L("DisplayName:Abp.Mailing.DefaultFromDisplayName"), L("Description:Abp.Mailing.DefaultFromDisplayName")) ); } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/EmailingResource.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/EmailingResource.cs new file mode 100644 index 0000000000..3560c0db26 --- /dev/null +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/EmailingResource.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Localization; + +namespace Volo.Abp.Emailing.Localization +{ + [LocalizationResourceName("AbpEmailing")] + public class EmailingResource + { + + } +} diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/en.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/en.json new file mode 100644 index 0000000000..6fa4e626ff --- /dev/null +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/en.json @@ -0,0 +1,23 @@ +{ + "culture": "en", + "texts": { + "DisplayName:Abp.Mailing.DefaultFromAddress": "Default from address", + "DisplayName:Abp.Mailing.DefaultFromDisplayName": "Default from display name", + "DisplayName:Abp.Mailing.Smtp.Host": "Host", + "DisplayName:Abp.Mailing.Smtp.Port": "Port", + "DisplayName:Abp.Mailing.Smtp.UserName": "User name", + "DisplayName:Abp.Mailing.Smtp.Password": "Password", + "DisplayName:Abp.Mailing.Smtp.Domain": "Domain", + "DisplayName:Abp.Mailing.Smtp.EnableSsl": "Enable SSL", + "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Use default credentials", + "Description:Abp.Mailing.DefaultFromAddress": "The default from address", + "Description:Abp.Mailing.DefaultFromDisplayName": "The default from display name", + "Description:Abp.Mailing.Smtp.Host": "The name or IP address of the host used for SMTP transactions.", + "Description:Abp.Mailing.Smtp.Port": "The port used for SMTP transactions.", + "Description:Abp.Mailing.Smtp.UserName": "User name associated with the credentials.", + "Description:Abp.Mailing.Smtp.Password": "The password for the user name associated with the credentials.", + "Description:Abp.Mailing.Smtp.Domain": "The domain or computer name that verifies the credentials.", + "Description:Abp.Mailing.Smtp.EnableSsl": "Whether the SmtpClient uses Secure Sockets Layer (SSL) to encrypt the connection.", + "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "Whether the DefaultCredentials are sent with requests." + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hans.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hans.json new file mode 100644 index 0000000000..0e2d25bff1 --- /dev/null +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hans.json @@ -0,0 +1,23 @@ +{ + "culture": "zh-Hans", + "texts": { + "DisplayName:Abp.Mailing.DefaultFromAddress": "默认发件人地址", + "DisplayName:Abp.Mailing.DefaultFromDisplayName": "默认发件人名字", + "DisplayName:Abp.Mailing.Smtp.Host": "主机", + "DisplayName:Abp.Mailing.Smtp.Port": "端口", + "DisplayName:Abp.Mailing.Smtp.UserName": "用户名", + "DisplayName:Abp.Mailing.Smtp.Password": "密码", + "DisplayName:Abp.Mailing.Smtp.Domain": "域", + "DisplayName:Abp.Mailing.Smtp.EnableSsl": "启用SSL", + "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "使用默认凭据", + "Description:Abp.Mailing.DefaultFromAddress": "默认的发件人地址.", + "Description:Abp.Mailing.DefaultFromDisplayName": "默认的发件人名字.", + "Description:Abp.Mailing.Smtp.Host": "SMTP 事务的主机名或主机 IP 地址.", + "Description:Abp.Mailing.Smtp.Port": "SMTP 事务的端口.", + "Description:Abp.Mailing.Smtp.UserName": "凭据关联的用户名.", + "Description:Abp.Mailing.Smtp.Password": "凭据关联的用户名的密码.", + "Description:Abp.Mailing.Smtp.Domain": "验证凭据的域名或计算机名.", + "Description:Abp.Mailing.Smtp.EnableSsl": "指定 SmtpClient 是否使用安全套接字层 (SSL) 加密连接.", + "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "控制默认凭据是否随请求一起发送." + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationSettingProvider.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationSettingProvider.cs index c748156506..8b0ef51029 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationSettingProvider.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationSettingProvider.cs @@ -1,4 +1,5 @@ -using Volo.Abp.Settings; +using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Settings; namespace Volo.Abp.Localization { @@ -7,8 +8,12 @@ namespace Volo.Abp.Localization public override void Define(ISettingDefinitionContext context) { context.Add( - new SettingDefinition(LocalizationSettingNames.DefaultLanguage, "en", isVisibleToClients: true) + new SettingDefinition(LocalizationSettingNames.DefaultLanguage, "en", L("DisplayName:Abp.Localization.DefaultLanguage"), L("Description:Abp.Localization.DefaultLanguage"), isVisibleToClients: true) ); } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/en.json b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/en.json index b6ff1bb26c..417dfcd8c9 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/en.json +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/en.json @@ -29,6 +29,8 @@ "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "This field must be a string with a maximum length of {0}.", "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "This field must be a string with a minimum length of {1} and a maximum length of {0}.", "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "This field is not a valid fully-qualified http, https, or ftp URL.", - "ThisFieldIsInvalid.": "This field is invalid." + "ThisFieldIsInvalid.": "This field is invalid.", + "DisplayName:Abp.Localization.DefaultLanguage": "Default language", + "Description:Abp.Localization.DefaultLanguage": "The default language of the application." } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json index d56c893c38..3731d6d01e 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json @@ -29,6 +29,8 @@ "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "字段必须是长度为{0}的字符串.", "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "字段必须是最小长度为{1}并且最大长度{*}的字符串.", "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "字段{0}不是有效的完全限定的http,https或ftp URL.", - "ThisFieldIsInvalid.": "字段是无效值." + "ThisFieldIsInvalid.": "字段是无效值.", + "DisplayName:Abp.Localization.DefaultLanguage": "默认语言", + "Description:Abp.Localization.DefaultLanguage": "应用程序默认语言." } } \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json index bc507158b1..1f8c0f2eca 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json @@ -35,6 +35,10 @@ "PasswordChanged": "Password changed", "NewPasswordConfirmFailed": "Please confirm the new password.", "Manage": "Manage", - "ManageYourProfile": "Manage your profile" + "ManageYourProfile": "Manage your profile", + "DisplayName:Abp.Account.IsSelfRegistrationEnabled": "Is self-registration enabled", + "Description:Abp.Account.IsSelfRegistrationEnabled": "Whether a user can register the account by him or herself.", + "DisplayName:Abp.Account.EnableLocalLogin": "Authenticate with a local account", + "Description:Abp.Account.EnableLocalLogin": "Indicates if Server will allow users to authenticate with a local account." } } \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json index 1db38474ae..044041f026 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json @@ -35,6 +35,10 @@ "PasswordChanged": "修改密码", "NewPasswordConfirmFailed": "请确认新密码", "Manage": "管理", - "ManageYourProfile": "管理你的个人资料" + "ManageYourProfile": "管理你的个人资料", + "DisplayName:Abp.Account.IsSelfRegistrationEnabled": "启用自行注册", + "Description:Abp.Account.IsSelfRegistrationEnabled": "是否允许用户自行注册帐户.", + "DisplayName:Abp.Account.EnableLocalLogin": "使用本地帐户进行身份验证", + "Description:Abp.Account.EnableLocalLogin": "伺服器是否将允许用户使用本地帐户进行身份验证。" } } diff --git a/modules/account/src/Volo.Abp.Account.Web/Settings/AccountSettingDefinitionProvider.cs b/modules/account/src/Volo.Abp.Account.Web/Settings/AccountSettingDefinitionProvider.cs index be16fa7045..1a613704f7 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Settings/AccountSettingDefinitionProvider.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Settings/AccountSettingDefinitionProvider.cs @@ -1,4 +1,6 @@ -using Volo.Abp.Settings; +using Volo.Abp.Account.Localization; +using Volo.Abp.Localization; +using Volo.Abp.Settings; namespace Volo.Abp.Account.Web.Settings { @@ -7,12 +9,16 @@ namespace Volo.Abp.Account.Web.Settings public override void Define(ISettingDefinitionContext context) { context.Add( - new SettingDefinition(AccountSettingNames.IsSelfRegistrationEnabled, "true") + new SettingDefinition(AccountSettingNames.IsSelfRegistrationEnabled, "true", L("DisplayName:Abp.Account.IsSelfRegistrationEnabled"), L("Description:Abp.Account.IsSelfRegistrationEnabled")) ); context.Add( - new SettingDefinition(AccountSettingNames.EnableLocalLogin, "true") + new SettingDefinition(AccountSettingNames.EnableLocalLogin, "true", L("DisplayName:Abp.Account.EnableLocalLogin"), L("Description:Abp.Account.EnableLocalLogin")) ); } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json index 5b5927b9a1..e7a038fd57 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json @@ -71,6 +71,32 @@ "Permission:Delete": "Delete", "Permission:ChangePermissions": "Change permissions", "Permission:UserManagement": "User management", - "Permission:UserLookup": "User lookup" + "Permission:UserLookup": "User lookup", + "DisplayName:Abp.Identity.Password.RequiredLength": "Required length", + "DisplayName:Abp.Identity.Password.RequiredUniqueChars": "Required unique characters number", + "DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "Required non-alphanumeric character", + "DisplayName:Abp.Identity.Password.RequireLowercase": "Required lower case character", + "DisplayName:Abp.Identity.Password.RequireUppercase": "Required upper case character", + "DisplayName:Abp.Identity.Password.RequireDigit": "Required digit", + "DisplayName:Abp.Identity.Lockout.AllowedForNewUsers": "Allowed for new users", + "DisplayName:Abp.Identity.Lockout.LockoutDuration": "Lockout duration(seconds)", + "DisplayName:Abp.Identity.Lockout.MaxFailedAccessAttempts": "Max failed access attempts", + "DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail": "Require confirmed email", + "DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "Require confirmed phoneNumber", + "DisplayName:Abp.Identity.User.IsUserNameUpdateEnabled": "Is username update enabled", + "DisplayName:Abp.Identity.User.IsEmailUpdateEnabled": "Is email update enabled", + "Description:Abp.Identity.Password.RequiredLength": "The minimum length a password must be.", + "Description:Abp.Identity.Password.RequiredUniqueChars": "The minimum number of unique characters which a password must contain.", + "Description:Abp.Identity.Password.RequireNonAlphanumeric": "If passwords must contain a non-alphanumeric character.", + "Description:Abp.Identity.Password.RequireLowercase": "If passwords must contain a lower case ASCII character.", + "Description:Abp.Identity.Password.RequireUppercase": "If passwords must contain a upper case ASCII character.", + "Description:Abp.Identity.Password.RequireDigit": "If passwords must contain a digit.", + "Description:Abp.Identity.Lockout.AllowedForNewUsers": "Whether a new user can be locked out.", + "Description:Abp.Identity.Lockout.LockoutDuration": "The duration a user is locked out for when a lockout occurs.", + "Description:Abp.Identity.Lockout.MaxFailedAccessAttempts": "The number of failed access attempts allowed before a user is locked out, assuming lock out is enabled.", + "Description:Abp.Identity.SignIn.RequireConfirmedEmail": "Whether a confirmed email address is required to sign in.", + "Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "Whether a confirmed telephone number is required to sign in.", + "Description:Abp.Identity.User.IsUserNameUpdateEnabled": "Whether the username can be updated by the user.", + "Description:Abp.Identity.User.IsEmailUpdateEnabled": "Whether the email can be updated by the user." } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json index 28786b8767..f57029eb9e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json @@ -71,6 +71,33 @@ "Permission:Delete": "删除", "Permission:ChangePermissions": "更改权限", "Permission:UserManagement": "用户管理", - "Permission:UserLookup": "用户查询" + "Permission:UserLookup": "用户查询", + "DisplayName:Abp.Identity.Password.RequiredLength": "要求长度", + "DisplayName:Abp.Identity.Password.RequiredUniqueChars": "要求唯一字符数量", + "DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "要求非字母数字", + "DisplayName:Abp.Identity.Password.RequireLowercase": "要求小写字母", + "DisplayName:Abp.Identity.Password.RequireUppercase": "要求大写字母", + "DisplayName:Abp.Identity.Password.RequireDigit": "要求数字", + "DisplayName:Abp.Identity.Lockout.AllowedForNewUsers": "允许新用户", + "DisplayName:Abp.Identity.Lockout.LockoutDuration": "锁定时间(秒)", + "DisplayName:Abp.Identity.Lockout.MaxFailedAccessAttempts": "最大失败访问尝试次数", + "DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail": "要求验证的电子邮箱", + "DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "要求验证的电话号码", + "DisplayName:Abp.Identity.User.IsUserNameUpdateEnabled": "启用用户名更新", + "DisplayName:Abp.Identity.User.IsEmailUpdateEnabled": "启用电子邮箱更新", + "Description:Abp.Identity.Password.RequiredLength": "密码的最小长度.", + "Description:Abp.Identity.Password.RequiredUniqueChars": "密码必须包含唯一字符的数量.", + "Description:Abp.Identity.Password.RequireNonAlphanumeric": "密码是否必须包含非字母数字.", + "Description:Abp.Identity.Password.RequireLowercase": "密码是否必须包含小写字母.", + "Description:Abp.Identity.Password.RequireUppercase": "密码是否必须包含大写字母.", + "Description:Abp.Identity.Password.RequireDigit": "密码是否必须包含数字.", + "Description:Abp.Identity.Lockout.AllowedForNewUsers": "允许新用户被锁定.", + "Description:Abp.Identity.Lockout.LockoutDuration": "当锁定发生时用户被的锁定的时间(秒).", + "Description:Abp.Identity.Lockout.MaxFailedAccessAttempts": "如果启用锁定, 当用户被锁定前失败的访问尝试次数.", + "Description:Abp.Identity.SignIn.RequireConfirmedEmail": "登录时是否需要验证的电子邮箱.", + "Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "登录时是否需要验证的电话号码.", + "Description:Abp.Identity.User.IsUserNameUpdateEnabled": "是否允许用户更新用户名.", + "Description:Abp.Identity.User.IsEmailUpdateEnabled": "是否允许用户更新电子邮箱." + } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs index 0edeacf848..faf6c5b5dd 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs @@ -1,4 +1,6 @@ -using Volo.Abp.Identity.Settings; +using Volo.Abp.Identity.Localization; +using Volo.Abp.Identity.Settings; +using Volo.Abp.Localization; using Volo.Abp.Settings; namespace Volo.Abp.Identity @@ -8,23 +10,28 @@ namespace Volo.Abp.Identity public override void Define(ISettingDefinitionContext context) { context.Add( - new SettingDefinition(IdentitySettingNames.Password.RequiredLength, 6.ToString(), null, null, true), - new SettingDefinition(IdentitySettingNames.Password.RequiredUniqueChars, 1.ToString(), null, null, true), - new SettingDefinition(IdentitySettingNames.Password.RequireNonAlphanumeric, true.ToString(), null, null, true), - new SettingDefinition(IdentitySettingNames.Password.RequireLowercase, true.ToString(), null, null, true), - new SettingDefinition(IdentitySettingNames.Password.RequireUppercase, true.ToString(), null, null, true), - new SettingDefinition(IdentitySettingNames.Password.RequireDigit, true.ToString(), null, null, true), + new SettingDefinition(IdentitySettingNames.Password.RequiredLength, 6.ToString(), L("DisplayName:Abp.Identity.Password.RequiredLength"), L("Description:Abp.Identity.Password.RequiredLength"), true), + new SettingDefinition(IdentitySettingNames.Password.RequiredUniqueChars, 1.ToString(), L("DisplayName:Abp.Identity.Password.RequiredUniqueChars"), L("Description:Abp.Identity.Password.RequiredUniqueChars"), true), + new SettingDefinition(IdentitySettingNames.Password.RequireNonAlphanumeric, true.ToString(), L("DisplayName:Abp.Identity.Password.RequireNonAlphanumeric"), L("Description:Abp.Identity.Password.RequireNonAlphanumeric"), true), + new SettingDefinition(IdentitySettingNames.Password.RequireLowercase, true.ToString(), L("DisplayName:Abp.Identity.Password.RequireLowercase"), L("Description:Abp.Identity.Password.RequireLowercase"), true), + new SettingDefinition(IdentitySettingNames.Password.RequireUppercase, true.ToString(), L("DisplayName:Abp.Identity.Password.RequireUppercase"), L("Description:Abp.Identity.Password.RequireUppercase"), true), + new SettingDefinition(IdentitySettingNames.Password.RequireDigit, true.ToString(), L("DisplayName:Abp.Identity.Password.RequireDigit"), L("Description:Abp.Identity.Password.RequireDigit"), true), - new SettingDefinition(IdentitySettingNames.Lockout.AllowedForNewUsers, true.ToString(), null, null, true), - new SettingDefinition(IdentitySettingNames.Lockout.LockoutDuration, (5*60).ToString(), null, null, true), - new SettingDefinition(IdentitySettingNames.Lockout.MaxFailedAccessAttempts, 5.ToString(), null, null, true), + new SettingDefinition(IdentitySettingNames.Lockout.AllowedForNewUsers, true.ToString(), L("DisplayName:Abp.Identity.Lockout.AllowedForNewUsers"), L("Description:Abp.Identity.Lockout.AllowedForNewUsers"), true), + new SettingDefinition(IdentitySettingNames.Lockout.LockoutDuration, (5*60).ToString(), L("DisplayName:Abp.Identity.Lockout.LockoutDuration"), L("Description:Abp.Identity.Lockout.LockoutDuration"), true), + new SettingDefinition(IdentitySettingNames.Lockout.MaxFailedAccessAttempts, 5.ToString(), L("DisplayName:Abp.Identity.Lockout.MaxFailedAccessAttempts"), L("Description:Abp.Identity.Lockout.MaxFailedAccessAttempts"), true), - new SettingDefinition(IdentitySettingNames.SignIn.RequireConfirmedEmail, false.ToString(), null, null, true), - new SettingDefinition(IdentitySettingNames.SignIn.RequireConfirmedPhoneNumber, false.ToString(), null, null, true), + new SettingDefinition(IdentitySettingNames.SignIn.RequireConfirmedEmail, false.ToString(), L("DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail"), L("Description:Abp.Identity.SignIn.RequireConfirmedEmail"), true), + new SettingDefinition(IdentitySettingNames.SignIn.RequireConfirmedPhoneNumber, false.ToString(), L("DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber"), L("Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber"), true), - new SettingDefinition(IdentitySettingNames.User.IsUserNameUpdateEnabled, true.ToString(), null, null, true), - new SettingDefinition(IdentitySettingNames.User.IsEmailUpdateEnabled, true.ToString(), null, null, true) + new SettingDefinition(IdentitySettingNames.User.IsUserNameUpdateEnabled, true.ToString(), L("DisplayName:Abp.Identity.User.IsUserNameUpdateEnabled"), L("Description:Abp.Identity.User.IsUserNameUpdateEnabled"), true), + new SettingDefinition(IdentitySettingNames.User.IsEmailUpdateEnabled, true.ToString(), L("DisplayName:Abp.Identity.User.IsEmailUpdateEnabled"), L("Description:Abp.Identity.User.IsEmailUpdateEnabled"), true) ); } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } } From 49a9eb0a0c2c52aa9739aab8aead9ddc0c835030 Mon Sep 17 00:00:00 2001 From: YinChang Date: Sat, 14 Dec 2019 08:33:48 +0800 Subject: [PATCH 038/105] configure embedded resources by wildcard --- framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj index 51ba1544db..aad33abfbc 100644 --- a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj +++ b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj @@ -19,13 +19,11 @@
- - + - - + From 9b502bd69afa7e7dcf67a3013de81a8eaaaadf62 Mon Sep 17 00:00:00 2001 From: YinChang Date: Mon, 16 Dec 2019 18:08:25 +0800 Subject: [PATCH 039/105] fix EmailingResource's Definition --- .../Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs index b8195ecf09..c2e29a7ff7 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs @@ -35,9 +35,7 @@ namespace Volo.Abp.Emailing { options.Resources .Add("en") - .AddBaseTypes( - typeof(EmailingResource) - ).AddVirtualJson("/Volo/Abp/Emailing/Localization"); + .AddVirtualJson("/Volo/Abp/Emailing/Localization"); }); Configure(options => From 97353bf5f9217abb6f6eb85a6d3cbea2713dad10 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 17 Dec 2019 17:41:54 +0800 Subject: [PATCH 040/105] Formatting code. --- .../Volo.Abp.Emailing.csproj | 3 - .../Volo/Abp/Emailing/EmailSettingProvider.cs | 60 ++++++++++-- .../LocalizationSettingProvider.cs | 7 +- .../AccountSettingDefinitionProvider.cs | 13 ++- .../AbpIdentitySettingDefinitionProvider.cs | 97 +++++++++++++++---- 5 files changed, 148 insertions(+), 32 deletions(-) diff --git a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj index aad33abfbc..1bd548e6c2 100644 --- a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj +++ b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj @@ -20,9 +20,6 @@ - - - diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSettingProvider.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSettingProvider.cs index 8e3ade25a9..0fb3402740 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSettingProvider.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSettingProvider.cs @@ -13,17 +13,59 @@ namespace Volo.Abp.Emailing public override void Define(ISettingDefinitionContext context) { context.Add( - new SettingDefinition(EmailSettingNames.Smtp.Host, "127.0.0.1", L("DisplayName:Abp.Mailing.Smtp.Host"), L("Description:Abp.Mailing.Smtp.Host")), - new SettingDefinition(EmailSettingNames.Smtp.Port, "25", L("DisplayName:Abp.Mailing.Smtp.Port"), L("Description:Abp.Mailing.Smtp.Port")), - new SettingDefinition(EmailSettingNames.Smtp.UserName, displayName: L("DisplayName:Abp.Mailing.Smtp.UserName"), description: L("Description:Abp.Mailing.Smtp.UserName")), - new SettingDefinition(EmailSettingNames.Smtp.Password, displayName: L("DisplayName:Abp.Mailing.Smtp.Password"), description: L("Description:Abp.Mailing.Smtp.Password"), isEncrypted: true), - new SettingDefinition(EmailSettingNames.Smtp.Domain, displayName: L("DisplayName:Abp.Mailing.Smtp.Domain"), description: L("Description:Abp.Mailing.Smtp.Domain")), - new SettingDefinition(EmailSettingNames.Smtp.EnableSsl, "false", L("DisplayName:Abp.Mailing.Smtp.EnableSsl"), L("Description:Abp.Mailing.Smtp.EnableSsl")), - new SettingDefinition(EmailSettingNames.Smtp.UseDefaultCredentials, "true", L("DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials"), L("Description:Abp.Mailing.Smtp.UseDefaultCredentials")), - new SettingDefinition(EmailSettingNames.DefaultFromAddress, "noreply@abp.io", L("DisplayName:Abp.Mailing.DefaultFromAddress"), L("Description:Abp.Mailing.DefaultFromAddress")), - new SettingDefinition(EmailSettingNames.DefaultFromDisplayName, "ABP application", L("DisplayName:Abp.Mailing.DefaultFromDisplayName"), L("Description:Abp.Mailing.DefaultFromDisplayName")) + new SettingDefinition( + EmailSettingNames.Smtp.Host, + "127.0.0.1", + L("DisplayName:Abp.Mailing.Smtp.Host"), + L("Description:Abp.Mailing.Smtp.Host")), + + new SettingDefinition(EmailSettingNames.Smtp.Port, + "25", + L("DisplayName:Abp.Mailing.Smtp.Port"), + L("Description:Abp.Mailing.Smtp.Port")), + + new SettingDefinition( + EmailSettingNames.Smtp.UserName, + displayName: L("DisplayName:Abp.Mailing.Smtp.UserName"), + description: L("Description:Abp.Mailing.Smtp.UserName")), + + new SettingDefinition( + EmailSettingNames.Smtp.Password, + displayName: + L("DisplayName:Abp.Mailing.Smtp.Password"), + description: L("Description:Abp.Mailing.Smtp.Password"), + isEncrypted: true), + + new SettingDefinition( + EmailSettingNames.Smtp.Domain, + displayName: L("DisplayName:Abp.Mailing.Smtp.Domain"), + description: L("Description:Abp.Mailing.Smtp.Domain")), + + new SettingDefinition( + EmailSettingNames.Smtp.EnableSsl, + "false", + L("DisplayName:Abp.Mailing.Smtp.EnableSsl"), + L("Description:Abp.Mailing.Smtp.EnableSsl")), + + new SettingDefinition( + EmailSettingNames.Smtp.UseDefaultCredentials, + "true", + L("DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials"), + L("Description:Abp.Mailing.Smtp.UseDefaultCredentials")), + + new SettingDefinition( + EmailSettingNames.DefaultFromAddress, + "noreply@abp.io", + L("DisplayName:Abp.Mailing.DefaultFromAddress"), + L("Description:Abp.Mailing.DefaultFromAddress")), + + new SettingDefinition(EmailSettingNames.DefaultFromDisplayName, + "ABP application", + L("DisplayName:Abp.Mailing.DefaultFromDisplayName"), + L("Description:Abp.Mailing.DefaultFromDisplayName")) ); } + private static LocalizableString L(string name) { return LocalizableString.Create(name); diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationSettingProvider.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationSettingProvider.cs index 8b0ef51029..14afe69dac 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationSettingProvider.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationSettingProvider.cs @@ -8,9 +8,14 @@ namespace Volo.Abp.Localization public override void Define(ISettingDefinitionContext context) { context.Add( - new SettingDefinition(LocalizationSettingNames.DefaultLanguage, "en", L("DisplayName:Abp.Localization.DefaultLanguage"), L("Description:Abp.Localization.DefaultLanguage"), isVisibleToClients: true) + new SettingDefinition(LocalizationSettingNames.DefaultLanguage, + "en", + L("DisplayName:Abp.Localization.DefaultLanguage"), + L("Description:Abp.Localization.DefaultLanguage"), + isVisibleToClients: true) ); } + private static LocalizableString L(string name) { return LocalizableString.Create(name); diff --git a/modules/account/src/Volo.Abp.Account.Web/Settings/AccountSettingDefinitionProvider.cs b/modules/account/src/Volo.Abp.Account.Web/Settings/AccountSettingDefinitionProvider.cs index 1a613704f7..53c2df6fbd 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Settings/AccountSettingDefinitionProvider.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Settings/AccountSettingDefinitionProvider.cs @@ -9,13 +9,22 @@ namespace Volo.Abp.Account.Web.Settings public override void Define(ISettingDefinitionContext context) { context.Add( - new SettingDefinition(AccountSettingNames.IsSelfRegistrationEnabled, "true", L("DisplayName:Abp.Account.IsSelfRegistrationEnabled"), L("Description:Abp.Account.IsSelfRegistrationEnabled")) + new SettingDefinition( + AccountSettingNames.IsSelfRegistrationEnabled, + "true", + L("DisplayName:Abp.Account.IsSelfRegistrationEnabled"), + L("Description:Abp.Account.IsSelfRegistrationEnabled")) ); context.Add( - new SettingDefinition(AccountSettingNames.EnableLocalLogin, "true", L("DisplayName:Abp.Account.EnableLocalLogin"), L("Description:Abp.Account.EnableLocalLogin")) + new SettingDefinition( + AccountSettingNames.EnableLocalLogin, + "true", + L("DisplayName:Abp.Account.EnableLocalLogin"), + L("Description:Abp.Account.EnableLocalLogin")) ); } + private static LocalizableString L(string name) { return LocalizableString.Create(name); diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs index faf6c5b5dd..efae6e467a 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs @@ -10,28 +10,91 @@ namespace Volo.Abp.Identity public override void Define(ISettingDefinitionContext context) { context.Add( - new SettingDefinition(IdentitySettingNames.Password.RequiredLength, 6.ToString(), L("DisplayName:Abp.Identity.Password.RequiredLength"), L("Description:Abp.Identity.Password.RequiredLength"), true), - new SettingDefinition(IdentitySettingNames.Password.RequiredUniqueChars, 1.ToString(), L("DisplayName:Abp.Identity.Password.RequiredUniqueChars"), L("Description:Abp.Identity.Password.RequiredUniqueChars"), true), - new SettingDefinition(IdentitySettingNames.Password.RequireNonAlphanumeric, true.ToString(), L("DisplayName:Abp.Identity.Password.RequireNonAlphanumeric"), L("Description:Abp.Identity.Password.RequireNonAlphanumeric"), true), - new SettingDefinition(IdentitySettingNames.Password.RequireLowercase, true.ToString(), L("DisplayName:Abp.Identity.Password.RequireLowercase"), L("Description:Abp.Identity.Password.RequireLowercase"), true), - new SettingDefinition(IdentitySettingNames.Password.RequireUppercase, true.ToString(), L("DisplayName:Abp.Identity.Password.RequireUppercase"), L("Description:Abp.Identity.Password.RequireUppercase"), true), - new SettingDefinition(IdentitySettingNames.Password.RequireDigit, true.ToString(), L("DisplayName:Abp.Identity.Password.RequireDigit"), L("Description:Abp.Identity.Password.RequireDigit"), true), - - new SettingDefinition(IdentitySettingNames.Lockout.AllowedForNewUsers, true.ToString(), L("DisplayName:Abp.Identity.Lockout.AllowedForNewUsers"), L("Description:Abp.Identity.Lockout.AllowedForNewUsers"), true), - new SettingDefinition(IdentitySettingNames.Lockout.LockoutDuration, (5*60).ToString(), L("DisplayName:Abp.Identity.Lockout.LockoutDuration"), L("Description:Abp.Identity.Lockout.LockoutDuration"), true), - new SettingDefinition(IdentitySettingNames.Lockout.MaxFailedAccessAttempts, 5.ToString(), L("DisplayName:Abp.Identity.Lockout.MaxFailedAccessAttempts"), L("Description:Abp.Identity.Lockout.MaxFailedAccessAttempts"), true), - - new SettingDefinition(IdentitySettingNames.SignIn.RequireConfirmedEmail, false.ToString(), L("DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail"), L("Description:Abp.Identity.SignIn.RequireConfirmedEmail"), true), - new SettingDefinition(IdentitySettingNames.SignIn.RequireConfirmedPhoneNumber, false.ToString(), L("DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber"), L("Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber"), true), - - new SettingDefinition(IdentitySettingNames.User.IsUserNameUpdateEnabled, true.ToString(), L("DisplayName:Abp.Identity.User.IsUserNameUpdateEnabled"), L("Description:Abp.Identity.User.IsUserNameUpdateEnabled"), true), - new SettingDefinition(IdentitySettingNames.User.IsEmailUpdateEnabled, true.ToString(), L("DisplayName:Abp.Identity.User.IsEmailUpdateEnabled"), L("Description:Abp.Identity.User.IsEmailUpdateEnabled"), true) + new SettingDefinition( + IdentitySettingNames.Password.RequiredLength, + 6.ToString(), + L("DisplayName:Abp.Identity.Password.RequiredLength"), + L("Description:Abp.Identity.Password.RequiredLength"), + true), + + new SettingDefinition( + IdentitySettingNames.Password.RequiredUniqueChars, + 1.ToString(), + L("DisplayName:Abp.Identity.Password.RequiredUniqueChars"), + L("Description:Abp.Identity.Password.RequiredUniqueChars"), + true), + + new SettingDefinition( + IdentitySettingNames.Password.RequireNonAlphanumeric, + true.ToString(), + L("DisplayName:Abp.Identity.Password.RequireNonAlphanumeric"), + L("Description:Abp.Identity.Password.RequireNonAlphanumeric"), + true), + + new SettingDefinition( + IdentitySettingNames.Password.RequireLowercase, + true.ToString(), L("DisplayName:Abp.Identity.Password.RequireLowercase"), + L("Description:Abp.Identity.Password.RequireLowercase"), + true), + + new SettingDefinition( + IdentitySettingNames.Password.RequireUppercase, + true.ToString(), L("DisplayName:Abp.Identity.Password.RequireUppercase"), + L("Description:Abp.Identity.Password.RequireUppercase"), + true), + + new SettingDefinition( + IdentitySettingNames.Password.RequireDigit, + true.ToString(), L("DisplayName:Abp.Identity.Password.RequireDigit"), + L("Description:Abp.Identity.Password.RequireDigit"), + true), + + new SettingDefinition( + IdentitySettingNames.Lockout.AllowedForNewUsers, + true.ToString(), L("DisplayName:Abp.Identity.Lockout.AllowedForNewUsers"), + L("Description:Abp.Identity.Lockout.AllowedForNewUsers"), + true), + + new SettingDefinition( + IdentitySettingNames.Lockout.LockoutDuration, + (5*60).ToString(), L("DisplayName:Abp.Identity.Lockout.LockoutDuration"), + L("Description:Abp.Identity.Lockout.LockoutDuration"), + true), + + new SettingDefinition( + IdentitySettingNames.Lockout.MaxFailedAccessAttempts, + 5.ToString(), L("DisplayName:Abp.Identity.Lockout.MaxFailedAccessAttempts"), + L("Description:Abp.Identity.Lockout.MaxFailedAccessAttempts"), + true), + + new SettingDefinition( + IdentitySettingNames.SignIn.RequireConfirmedEmail, + false.ToString(), L("DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail"), + L("Description:Abp.Identity.SignIn.RequireConfirmedEmail"), + true), + new SettingDefinition( + IdentitySettingNames.SignIn.RequireConfirmedPhoneNumber, + false.ToString(), L("DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber"), + L("Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber"), + true), + + new SettingDefinition( + IdentitySettingNames.User.IsUserNameUpdateEnabled, + true.ToString(), L("DisplayName:Abp.Identity.User.IsUserNameUpdateEnabled"), + L("Description:Abp.Identity.User.IsUserNameUpdateEnabled"), + true), + + new SettingDefinition( + IdentitySettingNames.User.IsEmailUpdateEnabled, + true.ToString(), L("DisplayName:Abp.Identity.User.IsEmailUpdateEnabled"), + L("Description:Abp.Identity.User.IsEmailUpdateEnabled"), + true) ); } + private static LocalizableString L(string name) { return LocalizableString.Create(name); } - } } From 87eb1891f5c1193f5b12c6d3ff2cc75d2c80fdc5 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 17 Dec 2019 17:52:32 +0800 Subject: [PATCH 041/105] Change some simplified Chinese translations. --- .../Abp/Localization/Resources/AbpValidation/zh-Hans.json | 4 ++-- .../Volo/Abp/Account/Localization/Resources/zh-Hans.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json index 3731d6d01e..5e535d5b67 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json @@ -29,8 +29,8 @@ "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "字段必须是长度为{0}的字符串.", "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "字段必须是最小长度为{1}并且最大长度{*}的字符串.", "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "字段{0}不是有效的完全限定的http,https或ftp URL.", - "ThisFieldIsInvalid.": "字段是无效值.", + "ThisFieldIsInvalid.": "该字段无效.", "DisplayName:Abp.Localization.DefaultLanguage": "默认语言", - "Description:Abp.Localization.DefaultLanguage": "应用程序默认语言." + "Description:Abp.Localization.DefaultLanguage": "应用程序的默认语言." } } \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json index 044041f026..391dee0531 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json @@ -39,6 +39,6 @@ "DisplayName:Abp.Account.IsSelfRegistrationEnabled": "启用自行注册", "Description:Abp.Account.IsSelfRegistrationEnabled": "是否允许用户自行注册帐户.", "DisplayName:Abp.Account.EnableLocalLogin": "使用本地帐户进行身份验证", - "Description:Abp.Account.EnableLocalLogin": "伺服器是否将允许用户使用本地帐户进行身份验证。" + "Description:Abp.Account.EnableLocalLogin": "服务器是否将允许用户使用本地帐户进行身份验证。" } } From 3ba06fe0227b86099f3aa718b5d3976bb0e4bbe0 Mon Sep 17 00:00:00 2001 From: YinChang Date: Sat, 21 Dec 2019 13:30:08 +0800 Subject: [PATCH 042/105] move AbpValidationResource to Volo.Abp.Validation from Volo.Abp.Localization --- .../Volo.Abp.Localization.csproj | 1 + .../Abp/Localization/AbpLocalizationModule.cs | 11 ++++++++-- .../AbpLocalizationResource.cs | 10 ++++++++++ .../Resources/AbpLocalization/en.json | 7 +++++++ .../Resources/AbpLocalization/zh-Hans.json | 7 +++++++ .../AbpValidation/AbpValidationResource.cs | 5 ++++- .../Volo.Abp.Validation.csproj | 8 +++++++- .../Abp/Validation/AbpValidationModule.cs | 20 +++++++++++++++++++ .../Localization/AbpValidationResource.cs | 10 ++++++++++ .../Volo/Abp/Validation/Localization}/cs.json | 0 .../Volo/Abp/Validation/Localization}/en.json | 4 +--- .../Volo/Abp/Validation/Localization}/es.json | 0 .../Volo/Abp/Validation/Localization}/pl.json | 0 .../Abp/Validation/Localization}/pt-BR.json | 0 .../Volo/Abp/Validation/Localization}/tr.json | 0 .../Volo/Abp/Validation/Localization}/vi.json | 0 .../Abp/Validation/Localization}/zh-Hans.json | 4 +--- 17 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/AbpLocalizationResource.cs create mode 100644 framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/en.json create mode 100644 framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/zh-Hans.json create mode 100644 framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/AbpValidationResource.cs rename framework/src/{Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation => Volo.Abp.Validation/Volo/Abp/Validation/Localization}/cs.json (100%) rename framework/src/{Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation => Volo.Abp.Validation/Volo/Abp/Validation/Localization}/en.json (93%) rename framework/src/{Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation => Volo.Abp.Validation/Volo/Abp/Validation/Localization}/es.json (100%) rename framework/src/{Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation => Volo.Abp.Validation/Volo/Abp/Validation/Localization}/pl.json (100%) rename framework/src/{Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation => Volo.Abp.Validation/Volo/Abp/Validation/Localization}/pt-BR.json (100%) rename framework/src/{Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation => Volo.Abp.Validation/Volo/Abp/Validation/Localization}/tr.json (100%) rename framework/src/{Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation => Volo.Abp.Validation/Volo/Abp/Validation/Localization}/vi.json (100%) rename framework/src/{Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation => Volo.Abp.Validation/Volo/Abp/Validation/Localization}/zh-Hans.json (93%) diff --git a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj index 65ceed101e..3bc8eafb11 100644 --- a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj +++ b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj @@ -14,6 +14,7 @@ + diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs index 60df66feec..175e3f9d12 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs @@ -1,4 +1,5 @@ -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Localization.Resources.AbpLocalization; +using Volo.Abp.Localization.Resources.AbpValidation; using Volo.Abp.Modularity; using Volo.Abp.Settings; using Volo.Abp.VirtualFileSystem; @@ -27,10 +28,16 @@ namespace Volo.Abp.Localization .Resources .Add("en"); + //TODO: Obsolete, Remove in the future version options .Resources .Add("en") - .AddVirtualJson("/Localization/Resources/AbpValidation"); + .AddVirtualJson("/Volo/Abp/Validation/Localization");//load from Volo.Abp.Validation + + options + .Resources + .Add("en") + .AddVirtualJson("/Localization/Resources/AbpLocalization"); }); } } diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/AbpLocalizationResource.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/AbpLocalizationResource.cs new file mode 100644 index 0000000000..abfd1688b7 --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/AbpLocalizationResource.cs @@ -0,0 +1,10 @@ +using System; + +namespace Volo.Abp.Localization.Resources.AbpLocalization +{ + [LocalizationResourceName("AbpLocalization")] + public class AbpLocalizationResource + { + + } +} diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/en.json b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/en.json new file mode 100644 index 0000000000..aee47a44b6 --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/en.json @@ -0,0 +1,7 @@ +{ + "culture": "en", + "texts": { + "DisplayName:Abp.Localization.DefaultLanguage": "Default language", + "Description:Abp.Localization.DefaultLanguage": "The default language of the application." + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/zh-Hans.json b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/zh-Hans.json new file mode 100644 index 0000000000..7167aac9fd --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/zh-Hans.json @@ -0,0 +1,7 @@ +{ + "culture": "zh-Hans", + "texts": { + "DisplayName:Abp.Localization.DefaultLanguage": "默认语言", + "Description:Abp.Localization.DefaultLanguage": "应用程序的默认语言." + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/AbpValidationResource.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/AbpValidationResource.cs index 667244886c..5d0151fe66 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/AbpValidationResource.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/AbpValidationResource.cs @@ -1,8 +1,11 @@ -namespace Volo.Abp.Localization.Resources.AbpValidation +using System; + +namespace Volo.Abp.Localization.Resources.AbpValidation { //TODO: Move to Volo.Abp.Validation! [LocalizationResourceName("AbpValidation")] + [Obsolete("This resource is obsolete.Use Volo.Abp.Validation.Localization.AbpValidationResource instead.", false)] public class AbpValidationResource { diff --git a/framework/src/Volo.Abp.Validation/Volo.Abp.Validation.csproj b/framework/src/Volo.Abp.Validation/Volo.Abp.Validation.csproj index c8cc738e98..9e1e81b1d9 100644 --- a/framework/src/Volo.Abp.Validation/Volo.Abp.Validation.csproj +++ b/framework/src/Volo.Abp.Validation/Volo.Abp.Validation.csproj @@ -1,4 +1,4 @@ - + @@ -13,8 +13,14 @@ + + + + + + diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/AbpValidationModule.cs b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/AbpValidationModule.cs index bb2d41f927..ad2be911de 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/AbpValidationModule.cs +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/AbpValidationModule.cs @@ -1,10 +1,16 @@ using System; using System.Collections.Generic; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Localization; using Volo.Abp.Modularity; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.Validation { + [DependsOn( + typeof(AbpLocalizationModule) + )] public class AbpValidationModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) @@ -12,6 +18,20 @@ namespace Volo.Abp.Validation context.Services.OnRegistred(ValidationInterceptorRegistrar.RegisterIfNeeded); AutoAddObjectValidationContributors(context.Services); } + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/Volo/Abp/Validation/Localization"); + }); + } private static void AutoAddObjectValidationContributors(IServiceCollection services) { diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/AbpValidationResource.cs b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/AbpValidationResource.cs new file mode 100644 index 0000000000..0de105747d --- /dev/null +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/AbpValidationResource.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Localization; + +namespace Volo.Abp.Validation.Localization +{ + [LocalizationResourceName("AbpValidation")] + public class AbpValidationResource + { + + } +} diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/cs.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/cs.json similarity index 100% rename from framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/cs.json rename to framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/cs.json diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/en.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/en.json similarity index 93% rename from framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/en.json rename to framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/en.json index 417dfcd8c9..b6ff1bb26c 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/en.json +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/en.json @@ -29,8 +29,6 @@ "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "This field must be a string with a maximum length of {0}.", "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "This field must be a string with a minimum length of {1} and a maximum length of {0}.", "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "This field is not a valid fully-qualified http, https, or ftp URL.", - "ThisFieldIsInvalid.": "This field is invalid.", - "DisplayName:Abp.Localization.DefaultLanguage": "Default language", - "Description:Abp.Localization.DefaultLanguage": "The default language of the application." + "ThisFieldIsInvalid.": "This field is invalid." } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/es.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json similarity index 100% rename from framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/es.json rename to framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/pl.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pl.json similarity index 100% rename from framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/pl.json rename to framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pl.json diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/pt-BR.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pt-BR.json similarity index 100% rename from framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/pt-BR.json rename to framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pt-BR.json diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/tr.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/tr.json similarity index 100% rename from framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/tr.json rename to framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/tr.json diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/vi.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/vi.json similarity index 100% rename from framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/vi.json rename to framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/vi.json diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/zh-Hans.json similarity index 93% rename from framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json rename to framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/zh-Hans.json index 5e535d5b67..ac0c014967 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/zh-Hans.json +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/zh-Hans.json @@ -29,8 +29,6 @@ "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "字段必须是长度为{0}的字符串.", "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "字段必须是最小长度为{1}并且最大长度{*}的字符串.", "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "字段{0}不是有效的完全限定的http,https或ftp URL.", - "ThisFieldIsInvalid.": "该字段无效.", - "DisplayName:Abp.Localization.DefaultLanguage": "默认语言", - "Description:Abp.Localization.DefaultLanguage": "应用程序的默认语言." + "ThisFieldIsInvalid.": "该字段无效." } } \ No newline at end of file From 88a1c08ee144a1aef7f6bf2b72f8148a5276e2be Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Sun, 22 Dec 2019 17:37:57 +0300 Subject: [PATCH 043/105] add login/logout commands. --- docs/en/CLI.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/en/CLI.md b/docs/en/CLI.md index 57bda25004..a1d3d51138 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -128,6 +128,24 @@ abp update [options] * `--npm`: Only updates NPM packages. * `--nuget`: Only updates NuGet packages. +### login + +Some features of the CLI requires to be logged in to abp.io platform. To login with your username write + +```bash +abp login +``` + +Notice that, a new login with an already active session, will kill the previous session and creates a new one. + +### logout + +Logs you out by removing the session token from your computer. + +``` +abp logout +``` + ### help Writes basic usage information of the CLI. From 1af300ba18929fa76d5a49edb565d12548ea4127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 23 Dec 2019 08:55:50 +0300 Subject: [PATCH 044/105] Add cancellationToken to IPermissionGrantRepository --- .../IPermissionGrantRepository.cs | 14 +++++++++++-- .../EfCorePermissionGrantRepository.cs | 20 ++++++++++++++----- .../MongoDb/MongoPermissionGrantRepository.cs | 17 ++++++++++++---- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionGrantRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionGrantRepository.cs index 886d546073..8c0beffd1a 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionGrantRepository.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionGrantRepository.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; @@ -7,8 +8,17 @@ namespace Volo.Abp.PermissionManagement { public interface IPermissionGrantRepository : IBasicRepository { - Task FindAsync(string name, string providerName, string providerKey); + Task FindAsync( + string name, + string providerName, + string providerKey, + CancellationToken cancellationToken = default + ); - Task> GetListAsync(string providerName, string providerKey); + Task> GetListAsync( + string providerName, + string providerKey, + CancellationToken cancellationToken = default + ); } } \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGrantRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGrantRepository.cs index 413a960c7c..d8241d6f8f 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGrantRepository.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGrantRepository.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; @@ -8,7 +9,8 @@ using Volo.Abp.EntityFrameworkCore; namespace Volo.Abp.PermissionManagement.EntityFrameworkCore { - public class EfCorePermissionGrantRepository : EfCoreRepository, IPermissionGrantRepository + public class EfCorePermissionGrantRepository : EfCoreRepository, + IPermissionGrantRepository { public EfCorePermissionGrantRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) @@ -16,23 +18,31 @@ namespace Volo.Abp.PermissionManagement.EntityFrameworkCore } - public async Task FindAsync(string name, string providerName, string providerKey) + public async Task FindAsync( + string name, + string providerName, + string providerKey, + CancellationToken cancellationToken = default) { return await DbSet .FirstOrDefaultAsync(s => s.Name == name && s.ProviderName == providerName && - s.ProviderKey == providerKey + s.ProviderKey == providerKey, + GetCancellationToken(cancellationToken) ); } - public async Task> GetListAsync(string providerName, string providerKey) + public async Task> GetListAsync( + string providerName, + string providerKey, + CancellationToken cancellationToken = default) { return await DbSet .Where(s => s.ProviderName == providerName && s.ProviderKey == providerKey - ).ToListAsync(); + ).ToListAsync(GetCancellationToken(cancellationToken)); } } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGrantRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGrantRepository.cs index 70614c890d..67befaa717 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGrantRepository.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGrantRepository.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using MongoDB.Driver; using MongoDB.Driver.Linq; @@ -16,23 +17,31 @@ namespace Volo.Abp.PermissionManagement.MongoDB } - public async Task FindAsync(string name, string providerName, string providerKey) + public async Task FindAsync( + string name, + string providerName, + string providerKey, + CancellationToken cancellationToken = default) { return await GetMongoQueryable() .FirstOrDefaultAsync(s => s.Name == name && s.ProviderName == providerName && - s.ProviderKey == providerKey + s.ProviderKey == providerKey, + GetCancellationToken(cancellationToken) ); } - public async Task> GetListAsync(string providerName, string providerKey) + public async Task> GetListAsync( + string providerName, + string providerKey, + CancellationToken cancellationToken = default) { return await GetMongoQueryable() .Where(s => s.ProviderName == providerName && s.ProviderKey == providerKey - ).ToListAsync(); + ).ToListAsync(GetCancellationToken(cancellationToken)); } } } \ No newline at end of file From 2b2e0be51d9fb37188348f390b56df286de7a6bc Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 23 Dec 2019 10:37:16 +0300 Subject: [PATCH 045/105] fix(core): fix flattedRoutes manipulation --- npm/ng-packs/packages/core/src/lib/states/config.state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/states/config.state.ts b/npm/ng-packs/packages/core/src/lib/states/config.state.ts index a32a101de2..1e959b3e54 100644 --- a/npm/ng-packs/packages/core/src/lib/states/config.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/config.state.ts @@ -229,7 +229,7 @@ export class ConfigState { const index = flattedRoutes.findIndex(route => route.name === name); if (index > -1) { - flattedRoutes[index] = newValue as ABP.FullRoute; + flattedRoutes[index] = { ...flattedRoutes[index], ...newValue } as ABP.FullRoute; } return patchState({ From 8dd751bc215b6407a74c69e56229513d5bd56c88 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 23 Dec 2019 10:41:02 +0300 Subject: [PATCH 046/105] tests(core): add AddRotue tests --- .../core/src/lib/tests/config.state.spec.ts | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts index 1fd2e45b35..e811204883 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts @@ -373,6 +373,59 @@ describe('ConfigState', () => { url: '/', children: [{ path: 'dashboard', name: 'Dashboard', url: '/dashboard' }], }); + describe('#AddRoute', () => { + const newRoute = { + name: 'My new page', + iconClass: 'fa fa-dashboard', + path: 'page', + invisible: false, + order: 2, + requiredPolicy: 'MyProjectName::MyNewPage', + } as Omit; + + test('should add a new route', () => { + let patchStateArg; + + const patchState = jest.fn(s => (patchStateArg = s)); + const getState = jest.fn(() => clone(CONFIG_STATE_DATA)); + + state.addRoute({ patchState, getState } as any, new AddRoute(newRoute)); + + expect(patchStateArg.routes[CONFIG_STATE_DATA.routes.length]).toEqual({ + ...newRoute, + url: '/page', + }); + expect(patchStateArg.flattedRoutes[CONFIG_STATE_DATA.flattedRoutes.length]).toEqual( + patchStateArg.routes[CONFIG_STATE_DATA.routes.length], + ); + }); + + it('should add a new child route', () => { + let patchStateArg; + + const patchState = jest.fn(s => (patchStateArg = s)); + const getState = jest.fn(() => clone(CONFIG_STATE_DATA)); + + state.addRoute( + { patchState, getState } as any, + new AddRoute({ ...newRoute, parentName: 'AbpAccount::Login' }), + ); + + expect(patchStateArg.routes[1].children[0].children[0]).toEqual({ + ...newRoute, + parentName: 'AbpAccount::Login', + url: '/account/login/page', + }); + + expect(patchStateArg.flattedRoutes[CONFIG_STATE_DATA.flattedRoutes.length]).toEqual( + patchStateArg.routes[1].children[0].children[0], + ); + + expect( + patchStateArg.flattedRoutes[ + CONFIG_STATE_DATA.flattedRoutes.findIndex(route => route.name === 'AbpAccount::Login') + ], + ).toEqual(patchStateArg.routes[1].children[0]); }); }); }); From a7e44b739cf8338843cd2ef6a012150438906a92 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 23 Dec 2019 10:42:03 +0300 Subject: [PATCH 047/105] tests(core): fix tests in the config.state.spec --- .../core/src/lib/tests/config.state.spec.ts | 154 +++++++++--------- 1 file changed, 76 insertions(+), 78 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts index e811204883..635ca1d8b1 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts @@ -1,17 +1,12 @@ -import { - createServiceFactory, - SpectatorService, - SpyObject, -} from '@ngneat/spectator/jest'; +import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spectator/jest'; import { Store } from '@ngxs/store'; import { ReplaySubject, timer, Subject, of } from 'rxjs'; import { Config } from '../models/config'; -import { - ApplicationConfigurationService, - ConfigStateService, -} from '../services'; +import { ApplicationConfigurationService, ConfigStateService } from '../services'; import { ConfigState } from '../states'; -import { SetLanguage, PatchRouteByName } from '../actions'; +import { SetLanguage, PatchRouteByName, AddRoute } from '../actions'; +import clone from 'just-clone'; +import { ABP } from '../models'; export const CONFIG_STATE_DATA = { environment: { @@ -55,6 +50,7 @@ export const CONFIG_STATE_DATA = { name: 'AbpAccount::Login', order: 1, url: '/account/login', + parentName: 'AbpAccount::Menu:Account', }, ], url: '/account', @@ -68,10 +64,27 @@ export const CONFIG_STATE_DATA = { url: '/', }, { - name: '::Menu:Identity', - path: 'identity', - children: [], - url: '/identity', + name: 'AbpAccount::Menu:Account', + path: 'account', + invisible: true, + layout: 'application', + children: [ + { + path: 'login', + name: 'AbpAccount::Login', + order: 1, + url: '/account/login', + parentName: 'AbpAccount::Menu:Account', + }, + ], + url: '/account', + }, + { + path: 'login', + name: 'AbpAccount::Login', + order: 1, + url: '/account/login', + parentName: 'AbpAccount::Menu:Account', }, ], localization: { @@ -134,10 +147,7 @@ describe('ConfigState', () => { store = spectator.get(Store); service = spectator.service; appConfigService = spectator.get(ApplicationConfigurationService); - state = new ConfigState( - spectator.get(ApplicationConfigurationService), - store, - ); + state = new ConfigState(spectator.get(ApplicationConfigurationService), store); }); describe('#getAll', () => { @@ -165,16 +175,12 @@ describe('ConfigState', () => { describe('#getDeep', () => { it('should return deeper', () => { expect( - ConfigState.getDeep('environment.localization.defaultResourceName')( - CONFIG_STATE_DATA, - ), + ConfigState.getDeep('environment.localization.defaultResourceName')(CONFIG_STATE_DATA), ).toEqual(CONFIG_STATE_DATA.environment.localization.defaultResourceName); expect( - ConfigState.getDeep([ - 'environment', - 'localization', - 'defaultResourceName', - ])(CONFIG_STATE_DATA), + ConfigState.getDeep(['environment', 'localization', 'defaultResourceName'])( + CONFIG_STATE_DATA, + ), ).toEqual(CONFIG_STATE_DATA.environment.localization.defaultResourceName); expect(ConfigState.getDeep('test')(null)).toBeFalsy(); @@ -183,10 +189,10 @@ describe('ConfigState', () => { describe('#getRoute', () => { it('should return route', () => { - expect( - ConfigState.getRoute(null, '::Menu:Home')(CONFIG_STATE_DATA), - ).toEqual(CONFIG_STATE_DATA.flattedRoutes[0]); - expect(ConfigState.getRoute('identity')(CONFIG_STATE_DATA)).toEqual( + expect(ConfigState.getRoute(null, '::Menu:Home')(CONFIG_STATE_DATA)).toEqual( + CONFIG_STATE_DATA.flattedRoutes[0], + ); + expect(ConfigState.getRoute('account')(CONFIG_STATE_DATA)).toEqual( CONFIG_STATE_DATA.flattedRoutes[1], ); }); @@ -205,11 +211,7 @@ describe('ConfigState', () => { describe('#getSetting', () => { it('should return a setting', () => { - expect( - ConfigState.getSetting('Abp.Localization.DefaultLanguage')( - CONFIG_STATE_DATA, - ), - ).toEqual( + expect(ConfigState.getSetting('Abp.Localization.DefaultLanguage')(CONFIG_STATE_DATA)).toEqual( CONFIG_STATE_DATA.setting.values['Abp.Localization.DefaultLanguage'], ); }); @@ -217,9 +219,7 @@ describe('ConfigState', () => { describe('#getSettings', () => { it('should return settings', () => { - expect( - ConfigState.getSettings('Localization')(CONFIG_STATE_DATA), - ).toEqual({ + expect(ConfigState.getSettings('Localization')(CONFIG_STATE_DATA)).toEqual({ 'Abp.Localization.DefaultLanguage': 'en', }); @@ -231,45 +231,31 @@ describe('ConfigState', () => { describe('#getGrantedPolicy', () => { it('should return a granted policy', () => { - expect( - ConfigState.getGrantedPolicy('Abp.Identity')(CONFIG_STATE_DATA), - ).toBe(false); - expect( - ConfigState.getGrantedPolicy('Abp.Identity || Abp.Account')( - CONFIG_STATE_DATA, - ), - ).toBe(true); - expect( - ConfigState.getGrantedPolicy('Abp.Account && Abp.Identity')( - CONFIG_STATE_DATA, - ), - ).toBe(false); - expect( - ConfigState.getGrantedPolicy('Abp.Account &&')(CONFIG_STATE_DATA), - ).toBe(false); - expect( - ConfigState.getGrantedPolicy('|| Abp.Account')(CONFIG_STATE_DATA), - ).toBe(false); + expect(ConfigState.getGrantedPolicy('Abp.Identity')(CONFIG_STATE_DATA)).toBe(false); + expect(ConfigState.getGrantedPolicy('Abp.Identity || Abp.Account')(CONFIG_STATE_DATA)).toBe( + true, + ); + expect(ConfigState.getGrantedPolicy('Abp.Account && Abp.Identity')(CONFIG_STATE_DATA)).toBe( + false, + ); + expect(ConfigState.getGrantedPolicy('Abp.Account &&')(CONFIG_STATE_DATA)).toBe(false); + expect(ConfigState.getGrantedPolicy('|| Abp.Account')(CONFIG_STATE_DATA)).toBe(false); expect(ConfigState.getGrantedPolicy('')(CONFIG_STATE_DATA)).toBe(true); }); }); describe('#getLocalization', () => { it('should return a localization', () => { - expect( - ConfigState.getLocalization('AbpIdentity::Identity')(CONFIG_STATE_DATA), - ).toBe('identity'); + expect(ConfigState.getLocalization('AbpIdentity::Identity')(CONFIG_STATE_DATA)).toBe( + 'identity', + ); - expect( - ConfigState.getLocalization('AbpIdentity::NoIdentity')( - CONFIG_STATE_DATA, - ), - ).toBe('AbpIdentity::NoIdentity'); + expect(ConfigState.getLocalization('AbpIdentity::NoIdentity')(CONFIG_STATE_DATA)).toBe( + 'AbpIdentity::NoIdentity', + ); expect( - ConfigState.getLocalization({ key: '', defaultValue: 'default' })( - CONFIG_STATE_DATA, - ), + ConfigState.getLocalization({ key: '', defaultValue: 'default' })(CONFIG_STATE_DATA), ).toBe('default'); expect( @@ -290,9 +276,7 @@ describe('ConfigState', () => { }); expect(false).toBeTruthy(); // fail } catch (error) { - expect((error as Error).message).toContain( - 'Please check your environment', - ); + expect((error as Error).message).toContain('Please check your environment'); } }); }); @@ -328,11 +312,11 @@ describe('ConfigState', () => { }); describe('#PatchRouteByName', () => { - it('should should patch the route', () => { + it('should patch the route', () => { let patchStateArg; const patchState = jest.fn(s => (patchStateArg = s)); - const getState = jest.fn(() => CONFIG_STATE_DATA); + const getState = jest.fn(() => clone(CONFIG_STATE_DATA)); state.patchRoute( { patchState, getState } as any, @@ -347,17 +331,21 @@ describe('ConfigState', () => { name: 'Home', path: 'home', url: '/home', - children: [ - { path: 'dashboard', name: 'Dashboard', url: '/home/dashboard' }, - ], + children: [{ path: 'dashboard', name: 'Dashboard', url: '/home/dashboard' }], + }); + expect(patchStateArg.flattedRoutes[0]).toEqual({ + name: 'Home', + path: 'home', + url: '/home', + children: [{ path: 'dashboard', name: 'Dashboard', url: '/home/dashboard' }], }); }); - it('should should patch the route without path', () => { + it('should patch the route without path', () => { let patchStateArg; const patchState = jest.fn(s => (patchStateArg = s)); - const getState = jest.fn(() => CONFIG_STATE_DATA); + const getState = jest.fn(() => clone(CONFIG_STATE_DATA)); state.patchRoute( { patchState, getState } as any, @@ -373,6 +361,16 @@ describe('ConfigState', () => { url: '/', children: [{ path: 'dashboard', name: 'Dashboard', url: '/dashboard' }], }); + + expect(patchStateArg.flattedRoutes[0]).toEqual({ + name: 'Main', + path: '', + url: '/', + children: [{ path: 'dashboard', name: 'Dashboard', url: '/dashboard' }], + }); + }); + }); + describe('#AddRoute', () => { const newRoute = { name: 'My new page', From b124bb9deec4e424dd2480a35b41de2ded211835 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 23 Dec 2019 10:42:17 +0300 Subject: [PATCH 048/105] tests(core): add date-extensions.spec --- .../core/src/lib/tests/date-extensions.spec.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 npm/ng-packs/packages/core/src/lib/tests/date-extensions.spec.ts diff --git a/npm/ng-packs/packages/core/src/lib/tests/date-extensions.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/date-extensions.spec.ts new file mode 100644 index 0000000000..3d743ae003 --- /dev/null +++ b/npm/ng-packs/packages/core/src/lib/tests/date-extensions.spec.ts @@ -0,0 +1,17 @@ +import '../utils/date-extensions'; + +describe('DateExtensions', () => { + describe('#toLocalISOString', () => { + test('should able to use as date prototype', () => { + new Date().toLocalISOString(); + }); + + test('should return correct value', () => { + const now = new Date(); + const timezoneOffset = now.getTimezoneOffset(); + expect(now.toLocalISOString()).toEqual( + new Date(now.getTime() - timezoneOffset * 60000).toISOString(), + ); + }); + }); +}); From 7110b49f6cd6ef4c6cc18fd327392e34fa0689f4 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 23 Dec 2019 11:18:05 +0300 Subject: [PATCH 049/105] ci: update labeler --- .github/labeler.yml | 8 ++++++++ .github/workflows/labeler.yml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 2dded9549b..cb0c9cddbd 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,7 +1,15 @@ ui-angular: - npm/ng-packs/* - npm/ng-packs/**/* + - npm/ng-packs/**/**/* + - npm/ng-packs/**/**/**/* + - npm/ng-packs/**/**/**/**/* + - npm/ng-packs/**/**/**/**/**/* - templates/app/angular/* - templates/app/angular/**/* + - templates/app/angular/**/**/* + - templates/app/angular/**/**/**/* - templates/module/angular/* - templates/module/angular/**/* + - templates/module/angular/**/**/* + - templates/module/angular/**/**/**/* diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index a5cb109c96..b1ab143f46 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,7 +1,7 @@ name: Pull request labeler on: schedule: - - cron: '0 0 1 1 *' + - cron: '0 */2 * * *' jobs: labeler: runs-on: ubuntu-latest From 6cb06ac0e27dde1cc03395a7635dcba714e71caa Mon Sep 17 00:00:00 2001 From: Mehmet Erim <34455572+mehmet-erim@users.noreply.github.com> Date: Tue, 24 Dec 2019 09:11:27 +0300 Subject: [PATCH 050/105] Update labeler.yml --- .github/workflows/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index b1ab143f46..f24ba57949 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,7 +1,7 @@ name: Pull request labeler on: schedule: - - cron: '0 */2 * * *' + - cron: '0 12 */1 * *' jobs: labeler: runs-on: ubuntu-latest From 5449e2475b817ec34174c04c88a38f4060ce562e Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:46:48 +0300 Subject: [PATCH 051/105] refactor(core): change state service method names according to action names --- .../packages/core/src/lib/services/config-state.service.ts | 6 +++--- .../packages/core/src/lib/services/profile-state.service.ts | 6 +++--- .../packages/core/src/lib/services/session-state.service.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts index 877fdab0d3..4d555c72fd 100644 --- a/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts @@ -50,15 +50,15 @@ export class ConfigStateService { return this.store.selectSnapshot(ConfigState.getLocalization(...args)); } - addData() { + dispatchGetAppConfiguration() { return this.store.dispatch(new GetAppConfiguration()); } - patchRoute(name: string, newValue: Partial) { + dispatchPatchRouteByName(name: string, newValue: Partial) { return this.store.dispatch(new PatchRouteByName(name, newValue)); } - addRoute(payload: Omit) { + dispatchAddRoute(payload: Omit) { return this.store.dispatch(new AddRoute(payload)); } } diff --git a/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts index 372ce40e19..9c7567e11f 100644 --- a/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts @@ -14,15 +14,15 @@ export class ProfileStateService { return this.store.selectSnapshot(ProfileState.getProfile); } - fetchProfile() { + dispatchGetProfile() { return this.store.dispatch(new GetProfile()); } - updateProfile(payload: Profile.Response) { + dispatchUpdateProfile(payload: Profile.Response) { return this.store.dispatch(new UpdateProfile(payload)); } - changePassword(payload: Profile.ChangePasswordRequest) { + dispatchChangePassword(payload: Profile.ChangePasswordRequest) { return this.store.dispatch(new ChangePassword(payload)); } } diff --git a/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts index af7261229e..ccb1de9a12 100644 --- a/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts @@ -18,11 +18,11 @@ export class SessionStateService { return this.store.selectSnapshot(SessionState.getTenant); } - setLanguage(payload: string) { + dispatchSetLanguage(payload: string) { return this.store.dispatch(new SetLanguage(payload)); } - setTenant(payload: ABP.BasicItem) { + dispatchSetTenant(payload: ABP.BasicItem) { return this.store.dispatch(new SetTenant(payload)); } } From 2f3c43bb26cf0a3c4763c626bb8f4b441eee7dce Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:47:20 +0300 Subject: [PATCH 052/105] test(core): add missing tests for state services --- .../lib/tests/config-state.service.spec.ts | 18 ++++++++++++++++++ .../lib/tests/profile-state.service.spec.ts | 19 +++++++++++++++++++ .../lib/tests/session-state.service.spec.ts | 19 +++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts index 1b20a2889b..ec8fb3ce67 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts @@ -3,6 +3,7 @@ import { ConfigStateService } from '../services/config-state.service'; import { ConfigState } from '../states'; import { Store } from '@ngxs/store'; import { Config } from '../models/config'; +import * as ConfigActions from '../actions'; const CONFIG_STATE_DATA = { environment: { @@ -140,4 +141,21 @@ describe('ConfigStateService', () => { } }); }); + + test('should have a dispatch method for every ConfigState action', () => { + const reg = /(?<=dispatch)(\w+)(?=\()/gm; + ConfigStateService.toString() + .match(reg) + .forEach(fnName => { + expect(ConfigActions[fnName]).toBeTruthy(); + + const spy = jest.spyOn(store, 'dispatch'); + spy.mockClear(); + + const params = Array.from(new Array(ConfigActions[fnName].length)); + + service[`dispatch${fnName}`](...params); + expect(spy).toHaveBeenCalledWith(new ConfigActions[fnName](...params)); + }); + }); }); diff --git a/npm/ng-packs/packages/core/src/lib/tests/profile-state.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/profile-state.service.spec.ts index 3732d8000c..10db71f6c6 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/profile-state.service.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/profile-state.service.spec.ts @@ -2,6 +2,8 @@ import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spect import { ProfileStateService } from '../services/profile-state.service'; import { ProfileState } from '../states/profile.state'; import { Store } from '@ngxs/store'; +import * as ProfileActions from '../actions'; + describe('ProfileStateService', () => { let service: ProfileStateService; let spectator: SpectatorService; @@ -35,4 +37,21 @@ describe('ProfileStateService', () => { } }); }); + + test('should have a dispatch method for every ProfileState action', () => { + const reg = /(?<=dispatch)(\w+)(?=\()/gm; + ProfileStateService.toString() + .match(reg) + .forEach(fnName => { + expect(ProfileActions[fnName]).toBeTruthy(); + + const spy = jest.spyOn(store, 'dispatch'); + spy.mockClear(); + + const params = Array.from(new Array(ProfileActions[fnName].length)); + + service[`dispatch${fnName}`](...params); + expect(spy).toHaveBeenCalledWith(new ProfileActions[fnName](...params)); + }); + }); }); diff --git a/npm/ng-packs/packages/core/src/lib/tests/session-state.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/session-state.service.spec.ts index 40664f29b5..8bca7d1ae3 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/session-state.service.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/session-state.service.spec.ts @@ -2,6 +2,8 @@ import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spect import { SessionStateService } from '../services/session-state.service'; import { SessionState } from '../states/session.state'; import { Store } from '@ngxs/store'; +import * as SessionActions from '../actions'; + describe('SessionStateService', () => { let service: SessionStateService; let spectator: SpectatorService; @@ -35,4 +37,21 @@ describe('SessionStateService', () => { } }); }); + + test('should have a dispatch method for every sessionState action', () => { + const reg = /(?<=dispatch)(\w+)(?=\()/gm; + SessionStateService.toString() + .match(reg) + .forEach(fnName => { + expect(SessionActions[fnName]).toBeTruthy(); + + const spy = jest.spyOn(store, 'dispatch'); + spy.mockClear(); + + const params = Array.from(new Array(SessionActions[fnName].length)); + + service[`dispatch${fnName}`](...params); + expect(spy).toHaveBeenCalledWith(new SessionActions[fnName](...params)); + }); + }); }); From e673e0ddbc2c6647cdf0ab5f76283ace5f7a31a7 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:47:48 +0300 Subject: [PATCH 053/105] refactor(feature-management): change state service method names according to action names --- .../src/lib/services/feature-management-state.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts b/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts index 94f2f7fc6b..76521dcde1 100644 --- a/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts +++ b/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts @@ -14,11 +14,11 @@ export class FeatureManagementStateService { return this.store.selectSnapshot(FeatureManagementState.getFeatures); } - fetchFeatures(payload: FeatureManagement.Provider) { + dispatchGetFeatures(payload: FeatureManagement.Provider) { return this.store.dispatch(new GetFeatures(payload)); } - updateFeatures(payload: FeatureManagement.Provider & FeatureManagement.Features) { + dispatchUpdateFeatures(payload: FeatureManagement.Provider & FeatureManagement.Features) { return this.store.dispatch(new UpdateFeatures(payload)); } } From c32ee9b66a0b9264834886c639c54b0fa95f6609 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:48:23 +0300 Subject: [PATCH 054/105] test(feature-management): add missing test for state service --- .../feature-management-state.service.spec.ts | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/feature-management/src/lib/tests/feature-management-state.service.spec.ts b/npm/ng-packs/packages/feature-management/src/lib/tests/feature-management-state.service.spec.ts index 9e04806b7e..59dc3701a2 100644 --- a/npm/ng-packs/packages/feature-management/src/lib/tests/feature-management-state.service.spec.ts +++ b/npm/ng-packs/packages/feature-management/src/lib/tests/feature-management-state.service.spec.ts @@ -2,13 +2,17 @@ import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spect import { Store } from '@ngxs/store'; import { FeatureManagementStateService } from '../services/feature-management-state.service'; import { FeatureManagementState } from '../states'; +import * as FeatureManagementActions from '../actions'; describe('FeatureManagementStateService', () => { let service: FeatureManagementStateService; let spectator: SpectatorService; let store: SpyObject; - const createService = createServiceFactory({ service: FeatureManagementStateService, mocks: [Store] }); + const createService = createServiceFactory({ + service: FeatureManagementStateService, + mocks: [Store], + }); beforeEach(() => { spectator = createService(); service = spectator.service; @@ -37,4 +41,21 @@ describe('FeatureManagementStateService', () => { } }); }); + + test('should have a dispatch method for every FeatureManagementState action', () => { + const reg = /(?<=dispatch)(\w+)(?=\()/gm; + FeatureManagementStateService.toString() + .match(reg) + .forEach(fnName => { + expect(FeatureManagementActions[fnName]).toBeTruthy(); + + const spy = jest.spyOn(store, 'dispatch'); + spy.mockClear(); + + const params = Array.from(new Array(FeatureManagementActions[fnName].length)); + + service[`dispatch${fnName}`](...params); + expect(spy).toHaveBeenCalledWith(new FeatureManagementActions[fnName](...params)); + }); + }); }); From 3b2228e30e4d92503d79fadbb6ac3080ff429730 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:48:55 +0300 Subject: [PATCH 055/105] refactor(identity): change state service method names according to action names --- .../lib/services/identity-state.service.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts b/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts index 9448273c0c..91763a685f 100644 --- a/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts +++ b/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts @@ -36,47 +36,47 @@ export class IdentityStateService { return this.store.selectSnapshot(IdentityState.getUsersTotalCount); } - fetchRoles(payload?: ABP.PageQueryParams) { + dispatchGetRoles(payload?: ABP.PageQueryParams) { return this.store.dispatch(new GetRoles(payload)); } - fetchRole(payload: string) { + dispatchGetRoleById(payload: string) { return this.store.dispatch(new GetRoleById(payload)); } - deleteRole(payload: string) { + dispatchDeleteRole(payload: string) { return this.store.dispatch(new DeleteRole(payload)); } - createRole(payload: Identity.RoleSaveRequest) { + dispatchCreateRole(payload: Identity.RoleSaveRequest) { return this.store.dispatch(new CreateRole(payload)); } - updateRole(payload: Identity.RoleItem) { + dispatchUpdateRole(payload: Identity.RoleItem) { return this.store.dispatch(new UpdateRole(payload)); } - fetchUsers(payload?: ABP.PageQueryParams) { + dispatchGetUsers(payload?: ABP.PageQueryParams) { return this.store.dispatch(new GetUsers(payload)); } - fetchUser(payload: string) { + dispatchGetUserById(payload: string) { return this.store.dispatch(new GetUserById(payload)); } - deleteUser(payload: string) { + dispatchDeleteUser(payload: string) { return this.store.dispatch(new DeleteUser(payload)); } - createUser(payload: Identity.UserSaveRequest) { + dispatchCreateUser(payload: Identity.UserSaveRequest) { return this.store.dispatch(new CreateUser(payload)); } - updateUser(payload: Identity.UserSaveRequest & { id: string }) { + dispatchUpdateUser(payload: Identity.UserSaveRequest & { id: string }) { return this.store.dispatch(new UpdateUser(payload)); } - getUserRoles(payload: string) { + dispatchGetUserRoles(payload: string) { return this.store.dispatch(new GetUserRoles(payload)); } } From ce6b7e24808570474be32ed97bcd7c8f1587dc38 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:49:32 +0300 Subject: [PATCH 056/105] test(identity): add missing test for state service --- .../lib/tests/identity-state.service.spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/npm/ng-packs/packages/identity/src/lib/tests/identity-state.service.spec.ts b/npm/ng-packs/packages/identity/src/lib/tests/identity-state.service.spec.ts index 6d78aa950f..dcf3193eea 100644 --- a/npm/ng-packs/packages/identity/src/lib/tests/identity-state.service.spec.ts +++ b/npm/ng-packs/packages/identity/src/lib/tests/identity-state.service.spec.ts @@ -2,6 +2,8 @@ import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spect import { IdentityStateService } from '../services/identity-state.service'; import { IdentityState } from '../states/identity.state'; import { Store } from '@ngxs/store'; +import * as IdentityActions from '../actions/identity.actions'; + describe('IdentityStateService', () => { let service: IdentityStateService; let spectator: SpectatorService; @@ -36,4 +38,21 @@ describe('IdentityStateService', () => { } }); }); + + test('should have a dispatch method for every IdentityState action', () => { + const reg = /(?<=dispatch)(\w+)(?=\()/gm; + IdentityStateService.toString() + .match(reg) + .forEach(fnName => { + expect(IdentityActions[fnName]).toBeTruthy(); + + const spy = jest.spyOn(store, 'dispatch'); + spy.mockClear(); + + const params = Array.from(new Array(IdentityActions[fnName].length)); + + service[`dispatch${fnName}`](...params); + expect(spy).toHaveBeenCalledWith(new IdentityActions[fnName](...params)); + }); + }); }); From 998dba14b4a7ee12c2c0f05902a5e1b4a2042f31 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:49:47 +0300 Subject: [PATCH 057/105] refactor(permisison-management): change state service method names according to action names --- .../src/lib/services/permission-management-state.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts b/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts index 243926aaea..75cbefa479 100644 --- a/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts +++ b/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts @@ -17,11 +17,11 @@ export class PermissionManagementStateService { return this.store.selectSnapshot(PermissionManagementState.getEntityDisplayName); } - getPermissions(payload: PermissionManagement.GrantedProvider) { + dispatchGetPermissions(payload: PermissionManagement.GrantedProvider) { return this.store.dispatch(new GetPermissions(payload)); } - updatePermissions( + dispatchUpdatePermissions( payload: PermissionManagement.GrantedProvider & PermissionManagement.UpdateRequest, ) { return this.store.dispatch(new UpdatePermissions(payload)); From c1189ed8aa13dacf14fc1f054ffef2cf2740078b Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:50:07 +0300 Subject: [PATCH 058/105] test(permission-management): add missing test for state service --- ...ermission-management-state.service.spec.ts | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/permission-management/src/lib/tests/permission-management-state.service.spec.ts b/npm/ng-packs/packages/permission-management/src/lib/tests/permission-management-state.service.spec.ts index 65df916a0f..f1d344c7ac 100644 --- a/npm/ng-packs/packages/permission-management/src/lib/tests/permission-management-state.service.spec.ts +++ b/npm/ng-packs/packages/permission-management/src/lib/tests/permission-management-state.service.spec.ts @@ -2,13 +2,17 @@ import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spect import { PermissionManagementStateService } from '../services/permission-management-state.service'; import { PermissionManagementState } from '../states/permission-management.state'; import { Store } from '@ngxs/store'; +import * as PermissionManagementActions from '../actions'; describe('PermissionManagementStateService', () => { let service: PermissionManagementStateService; let spectator: SpectatorService; let store: SpyObject; - const createService = createServiceFactory({ service: PermissionManagementStateService, mocks: [Store] }); + const createService = createServiceFactory({ + service: PermissionManagementStateService, + mocks: [Store], + }); beforeEach(() => { spectator = createService(); service = spectator.service; @@ -36,4 +40,21 @@ describe('PermissionManagementStateService', () => { } }); }); + + test('should have a dispatch method for every PermissionManagementState action', () => { + const reg = /(?<=dispatch)(\w+)(?=\()/gm; + PermissionManagementStateService.toString() + .match(reg) + .forEach(fnName => { + expect(PermissionManagementActions[fnName]).toBeTruthy(); + + const spy = jest.spyOn(store, 'dispatch'); + spy.mockClear(); + + const params = Array.from(new Array(PermissionManagementActions[fnName].length)); + + service[`dispatch${fnName}`](...params); + expect(spy).toHaveBeenCalledWith(new PermissionManagementActions[fnName](...params)); + }); + }); }); From 0adcfef9109c87fb5fd148601e4816e7ffe83ce0 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:50:26 +0300 Subject: [PATCH 059/105] refactor(tenant-management): change state service method names according to action names --- .../lib/services/tenant-management-state.service.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts b/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts index e27e4b3d67..eafae7c2fb 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts @@ -19,23 +19,23 @@ export class TenantManagementStateService { return this.store.selectSnapshot(TenantManagementState.getTenantsTotalCount); } - getTenants(payload?: ABP.PageQueryParams) { + dispatchGetTenants(payload?: ABP.PageQueryParams) { return this.store.dispatch(new GetTenants(payload)); } - getTenantById(payload: string) { + dispatchGetTenantById(payload: string) { return this.store.dispatch(new GetTenantById(payload)); } - createTenant(payload: TenantManagement.AddRequest) { + dispatchCreateTenant(payload: TenantManagement.AddRequest) { return this.store.dispatch(new CreateTenant(payload)); } - updateTenant(payload: TenantManagement.UpdateRequest) { + dispatchUpdateTenant(payload: TenantManagement.UpdateRequest) { return this.store.dispatch(new UpdateTenant(payload)); } - deleteTenant(payload: string) { + dispatchDeleteTenant(payload: string) { return this.store.dispatch(new DeleteTenant(payload)); } } From e875433a57fe60115efc38eaaef94658014d0440 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:50:45 +0300 Subject: [PATCH 060/105] test(tenant-management): add missing test for state service --- .../tenant-management-state.service.spec.ts | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/tenant-management/src/lib/tests/tenant-management-state.service.spec.ts b/npm/ng-packs/packages/tenant-management/src/lib/tests/tenant-management-state.service.spec.ts index c5b40fb54b..bd9017a2c7 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/tests/tenant-management-state.service.spec.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/tests/tenant-management-state.service.spec.ts @@ -2,12 +2,17 @@ import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spect import { TenantManagementStateService } from '../services/tenant-management-state.service'; import { TenantManagementState } from '../states/tenant-management.state'; import { Store } from '@ngxs/store'; +import * as TenantManagementActions from '../actions'; + describe('TenantManagementStateService', () => { let service: TenantManagementStateService; let spectator: SpectatorService; let store: SpyObject; - const createService = createServiceFactory({ service: TenantManagementStateService, mocks: [Store] }); + const createService = createServiceFactory({ + service: TenantManagementStateService, + mocks: [Store], + }); beforeEach(() => { spectator = createService(); service = spectator.service; @@ -36,4 +41,21 @@ describe('TenantManagementStateService', () => { } }); }); + + test('should have a dispatch method for every TenantManagementState action', () => { + const reg = /(?<=dispatch)(\w+)(?=\()/gm; + TenantManagementStateService.toString() + .match(reg) + .forEach(fnName => { + expect(TenantManagementActions[fnName]).toBeTruthy(); + + const spy = jest.spyOn(store, 'dispatch'); + spy.mockClear(); + + const params = Array.from(new Array(TenantManagementActions[fnName].length)); + + service[`dispatch${fnName}`](...params); + expect(spy).toHaveBeenCalledWith(new TenantManagementActions[fnName](...params)); + }); + }); }); From f89bade3a61b1e901766e6d1c2d5cbd10ecb2cb2 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:51:57 +0300 Subject: [PATCH 061/105] feature(theme-basic): add state action dispatchers to state service --- .../src/lib/services/layout-state.service.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/npm/ng-packs/packages/theme-basic/src/lib/services/layout-state.service.ts b/npm/ng-packs/packages/theme-basic/src/lib/services/layout-state.service.ts index 92ab3d0c59..a68e97c32c 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/services/layout-state.service.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/services/layout-state.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngxs/store'; import { LayoutState } from '../states/layout.state'; +import { AddNavigationElement, RemoveNavigationElementByName } from '../actions'; +import { Layout } from '../models/layout'; @Injectable() export class LayoutStateService { @@ -9,4 +11,12 @@ export class LayoutStateService { getNavigationElements() { return this.store.selectSnapshot(LayoutState.getNavigationElements); } + + dispatchAddNavigationElement(payload: Layout.NavigationElement | Layout.NavigationElement[]) { + return this.store.dispatch(new AddNavigationElement(payload)); + } + + dispatchRemoveNavigationElementByName(name: string) { + return this.store.dispatch(new RemoveNavigationElementByName(name)); + } } From 4b115fb90d29841e2186949ddb264985b9ff487e Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:52:21 +0300 Subject: [PATCH 062/105] test(theme-basic): add missing test for state service --- .../lib/tests/layout-state.service.spec.ts | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/theme-basic/src/lib/tests/layout-state.service.spec.ts b/npm/ng-packs/packages/theme-basic/src/lib/tests/layout-state.service.spec.ts index 2a88a93f47..de4f489aaa 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/tests/layout-state.service.spec.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/tests/layout-state.service.spec.ts @@ -1,7 +1,8 @@ import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spectator/jest'; +import { Store } from '@ngxs/store'; +import * as LayoutActions from '../actions'; import { LayoutStateService } from '../services/layout-state.service'; import { LayoutState } from '../states/layout.state'; -import { Store } from '@ngxs/store'; describe('LayoutStateService', () => { let service: LayoutStateService; let spectator: SpectatorService; @@ -36,4 +37,21 @@ describe('LayoutStateService', () => { } }); }); + + test('should have a dispatch method for every LayoutState action', () => { + const reg = /(?<=dispatch)(\w+)(?=\()/gm; + LayoutStateService.toString() + .match(reg) + .forEach(fnName => { + expect(LayoutActions[fnName]).toBeTruthy(); + + const spy = jest.spyOn(store, 'dispatch'); + spy.mockClear(); + + const params = Array.from(new Array(LayoutActions[fnName].length)); + + service[`dispatch${fnName}`](...params); + expect(spy).toHaveBeenCalledWith(new LayoutActions[fnName](...params)); + }); + }); }); From 4459c62029cd8fc31b9d5a6b95513868b3ac3c96 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 10:53:23 +0300 Subject: [PATCH 063/105] style(theme-basic): reorder imports and beautify method parameters --- .../theme-basic/src/lib/states/layout.state.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/theme-basic/src/lib/states/layout.state.ts b/npm/ng-packs/packages/theme-basic/src/lib/states/layout.state.ts index 7fac67a036..1c90803638 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/states/layout.state.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/states/layout.state.ts @@ -1,8 +1,7 @@ -import { State, Action, StateContext, Selector } from '@ngxs/store'; +import { Action, Selector, State, StateContext } from '@ngxs/store'; +import snq from 'snq'; import { AddNavigationElement, RemoveNavigationElementByName } from '../actions/layout.actions'; import { Layout } from '../models/layout'; -import { TemplateRef } from '@angular/core'; -import snq from 'snq'; @State({ name: 'LayoutState', @@ -15,7 +14,10 @@ export class LayoutState { } @Action(AddNavigationElement) - layoutAddAction({ getState, patchState }: StateContext, { payload = [] }: AddNavigationElement) { + layoutAddAction( + { getState, patchState }: StateContext, + { payload = [] }: AddNavigationElement, + ) { let { navigationElements } = getState(); if (!Array.isArray(payload)) { @@ -44,7 +46,10 @@ export class LayoutState { } @Action(RemoveNavigationElementByName) - layoutRemoveAction({ getState, patchState }: StateContext, { name }: RemoveNavigationElementByName) { + layoutRemoveAction( + { getState, patchState }: StateContext, + { name }: RemoveNavigationElementByName, + ) { let { navigationElements } = getState(); const index = navigationElements.findIndex(element => element.name === name); From d30f5a7af60d6b1dfac16ea61d7d8b6715446e29 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 11:39:20 +0300 Subject: [PATCH 064/105] refactor(core): change state service dispatcher parameters --- .../core/src/lib/services/config-state.service.ts | 8 ++++---- .../core/src/lib/services/profile-state.service.ts | 8 ++++---- .../core/src/lib/services/session-state.service.ts | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts index 4d555c72fd..506b278634 100644 --- a/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts @@ -54,11 +54,11 @@ export class ConfigStateService { return this.store.dispatch(new GetAppConfiguration()); } - dispatchPatchRouteByName(name: string, newValue: Partial) { - return this.store.dispatch(new PatchRouteByName(name, newValue)); + dispatchPatchRouteByName(...args: ConstructorParameters) { + return this.store.dispatch(new PatchRouteByName(...args)); } - dispatchAddRoute(payload: Omit) { - return this.store.dispatch(new AddRoute(payload)); + dispatchAddRoute(...args: ConstructorParameters) { + return this.store.dispatch(new AddRoute(...args)); } } diff --git a/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts index 9c7567e11f..cd76c4bf03 100644 --- a/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts @@ -18,11 +18,11 @@ export class ProfileStateService { return this.store.dispatch(new GetProfile()); } - dispatchUpdateProfile(payload: Profile.Response) { - return this.store.dispatch(new UpdateProfile(payload)); + dispatchUpdateProfile(...args: ConstructorParameters) { + return this.store.dispatch(new UpdateProfile(...args)); } - dispatchChangePassword(payload: Profile.ChangePasswordRequest) { - return this.store.dispatch(new ChangePassword(payload)); + dispatchChangePassword(...args: ConstructorParameters) { + return this.store.dispatch(new ChangePassword(...args)); } } diff --git a/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts index ccb1de9a12..88b8f2df9b 100644 --- a/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts @@ -18,11 +18,11 @@ export class SessionStateService { return this.store.selectSnapshot(SessionState.getTenant); } - dispatchSetLanguage(payload: string) { - return this.store.dispatch(new SetLanguage(payload)); + dispatchSetLanguage(...args: ConstructorParameters) { + return this.store.dispatch(new SetLanguage(...args)); } - dispatchSetTenant(payload: ABP.BasicItem) { - return this.store.dispatch(new SetTenant(payload)); + dispatchSetTenant(...args: ConstructorParameters) { + return this.store.dispatch(new SetTenant(...args)); } } From d31474cc28737ad0798ed71c3422eb3b7fae8aa8 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 11:39:31 +0300 Subject: [PATCH 065/105] refactor(feature-management): change state service dispatcher parameters --- .../src/lib/services/feature-management-state.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts b/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts index 76521dcde1..79d7fbef34 100644 --- a/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts +++ b/npm/ng-packs/packages/feature-management/src/lib/services/feature-management-state.service.ts @@ -14,11 +14,11 @@ export class FeatureManagementStateService { return this.store.selectSnapshot(FeatureManagementState.getFeatures); } - dispatchGetFeatures(payload: FeatureManagement.Provider) { - return this.store.dispatch(new GetFeatures(payload)); + dispatchGetFeatures(...args: ConstructorParameters) { + return this.store.dispatch(new GetFeatures(...args)); } - dispatchUpdateFeatures(payload: FeatureManagement.Provider & FeatureManagement.Features) { - return this.store.dispatch(new UpdateFeatures(payload)); + dispatchUpdateFeatures(...args: ConstructorParameters) { + return this.store.dispatch(new UpdateFeatures(...args)); } } From 6f9422d8f254dccaa43fafc1eefe0b2d09b04619 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 11:39:39 +0300 Subject: [PATCH 066/105] refactor(identity): change state service dispatcher parameters --- .../lib/services/identity-state.service.ts | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts b/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts index 91763a685f..0fcb6d4014 100644 --- a/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts +++ b/npm/ng-packs/packages/identity/src/lib/services/identity-state.service.ts @@ -36,47 +36,47 @@ export class IdentityStateService { return this.store.selectSnapshot(IdentityState.getUsersTotalCount); } - dispatchGetRoles(payload?: ABP.PageQueryParams) { - return this.store.dispatch(new GetRoles(payload)); + dispatchGetRoles(...args: ConstructorParameters) { + return this.store.dispatch(new GetRoles(...args)); } - dispatchGetRoleById(payload: string) { - return this.store.dispatch(new GetRoleById(payload)); + dispatchGetRoleById(...args: ConstructorParameters) { + return this.store.dispatch(new GetRoleById(...args)); } - dispatchDeleteRole(payload: string) { - return this.store.dispatch(new DeleteRole(payload)); + dispatchDeleteRole(...args: ConstructorParameters) { + return this.store.dispatch(new DeleteRole(...args)); } - dispatchCreateRole(payload: Identity.RoleSaveRequest) { - return this.store.dispatch(new CreateRole(payload)); + dispatchCreateRole(...args: ConstructorParameters) { + return this.store.dispatch(new CreateRole(...args)); } - dispatchUpdateRole(payload: Identity.RoleItem) { - return this.store.dispatch(new UpdateRole(payload)); + dispatchUpdateRole(...args: ConstructorParameters) { + return this.store.dispatch(new UpdateRole(...args)); } - dispatchGetUsers(payload?: ABP.PageQueryParams) { - return this.store.dispatch(new GetUsers(payload)); + dispatchGetUsers(...args: ConstructorParameters) { + return this.store.dispatch(new GetUsers(...args)); } - dispatchGetUserById(payload: string) { - return this.store.dispatch(new GetUserById(payload)); + dispatchGetUserById(...args: ConstructorParameters) { + return this.store.dispatch(new GetUserById(...args)); } - dispatchDeleteUser(payload: string) { - return this.store.dispatch(new DeleteUser(payload)); + dispatchDeleteUser(...args: ConstructorParameters) { + return this.store.dispatch(new DeleteUser(...args)); } - dispatchCreateUser(payload: Identity.UserSaveRequest) { - return this.store.dispatch(new CreateUser(payload)); + dispatchCreateUser(...args: ConstructorParameters) { + return this.store.dispatch(new CreateUser(...args)); } - dispatchUpdateUser(payload: Identity.UserSaveRequest & { id: string }) { - return this.store.dispatch(new UpdateUser(payload)); + dispatchUpdateUser(...args: ConstructorParameters) { + return this.store.dispatch(new UpdateUser(...args)); } - dispatchGetUserRoles(payload: string) { - return this.store.dispatch(new GetUserRoles(payload)); + dispatchGetUserRoles(...args: ConstructorParameters) { + return this.store.dispatch(new GetUserRoles(...args)); } } From e0de527018fec0d2aa5737ce07f4adb42f194a83 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 11:39:51 +0300 Subject: [PATCH 067/105] refactor(permission-management): change state service dispatcher parameters --- .../services/permission-management-state.service.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts b/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts index 75cbefa479..1f372224ae 100644 --- a/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts +++ b/npm/ng-packs/packages/permission-management/src/lib/services/permission-management-state.service.ts @@ -17,13 +17,11 @@ export class PermissionManagementStateService { return this.store.selectSnapshot(PermissionManagementState.getEntityDisplayName); } - dispatchGetPermissions(payload: PermissionManagement.GrantedProvider) { - return this.store.dispatch(new GetPermissions(payload)); + dispatchGetPermissions(...args: ConstructorParameters) { + return this.store.dispatch(new GetPermissions(...args)); } - dispatchUpdatePermissions( - payload: PermissionManagement.GrantedProvider & PermissionManagement.UpdateRequest, - ) { - return this.store.dispatch(new UpdatePermissions(payload)); + dispatchUpdatePermissions(...args: ConstructorParameters) { + return this.store.dispatch(new UpdatePermissions(...args)); } } From 177f4ffe08876574578fb0abdb6dbc9fcaa0aa91 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 11:40:11 +0300 Subject: [PATCH 068/105] refactor(tenant-management): change state service dispatcher parameters --- .../tenant-management-state.service.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts b/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts index eafae7c2fb..4475bef141 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management-state.service.ts @@ -19,23 +19,23 @@ export class TenantManagementStateService { return this.store.selectSnapshot(TenantManagementState.getTenantsTotalCount); } - dispatchGetTenants(payload?: ABP.PageQueryParams) { - return this.store.dispatch(new GetTenants(payload)); + dispatchGetTenants(...args: ConstructorParameters) { + return this.store.dispatch(new GetTenants(...args)); } - dispatchGetTenantById(payload: string) { - return this.store.dispatch(new GetTenantById(payload)); + dispatchGetTenantById(...args: ConstructorParameters) { + return this.store.dispatch(new GetTenantById(...args)); } - dispatchCreateTenant(payload: TenantManagement.AddRequest) { - return this.store.dispatch(new CreateTenant(payload)); + dispatchCreateTenant(...args: ConstructorParameters) { + return this.store.dispatch(new CreateTenant(...args)); } - dispatchUpdateTenant(payload: TenantManagement.UpdateRequest) { - return this.store.dispatch(new UpdateTenant(payload)); + dispatchUpdateTenant(...args: ConstructorParameters) { + return this.store.dispatch(new UpdateTenant(...args)); } - dispatchDeleteTenant(payload: string) { - return this.store.dispatch(new DeleteTenant(payload)); + dispatchDeleteTenant(...args: ConstructorParameters) { + return this.store.dispatch(new DeleteTenant(...args)); } } From fdd73da7854200b92e647fd7349d9d1b2d607a5f Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 24 Dec 2019 11:40:26 +0300 Subject: [PATCH 069/105] refactor(theme-basic): change state service dispatcher parameters --- .../src/lib/services/layout-state.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/npm/ng-packs/packages/theme-basic/src/lib/services/layout-state.service.ts b/npm/ng-packs/packages/theme-basic/src/lib/services/layout-state.service.ts index a68e97c32c..f38c9c4361 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/services/layout-state.service.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/services/layout-state.service.ts @@ -12,11 +12,13 @@ export class LayoutStateService { return this.store.selectSnapshot(LayoutState.getNavigationElements); } - dispatchAddNavigationElement(payload: Layout.NavigationElement | Layout.NavigationElement[]) { - return this.store.dispatch(new AddNavigationElement(payload)); + dispatchAddNavigationElement(...args: ConstructorParameters) { + return this.store.dispatch(new AddNavigationElement(...args)); } - dispatchRemoveNavigationElementByName(name: string) { - return this.store.dispatch(new RemoveNavigationElementByName(name)); + dispatchRemoveNavigationElementByName( + ...args: ConstructorParameters + ) { + return this.store.dispatch(new RemoveNavigationElementByName(...args)); } } From 676a5c61acc01d255605eeffe537d7647b29b07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 11:56:14 +0300 Subject: [PATCH 070/105] Removed sync interception and sync repository methods. --- .../Volo/Abp/Auditing/AuditingInterceptor.cs | 27 ---- .../Authorization/AuthorizationInterceptor.cs | 7 - .../CastleAbpInterceptorAdapter.cs | 7 +- .../CastleAbpMethodInvocationAdapter.cs | 14 +- .../Volo/Abp/DynamicProxy/AbpInterceptor.cs | 12 +- .../Volo/Abp/DynamicProxy/IAbpInterceptor.cs | 2 - .../Abp/DynamicProxy/IAbpMethodInvocation.cs | 2 - .../Repositories/BasicRepositoryBase.cs | 70 ++-------- .../Domain/Repositories/IBasicRepository.cs | 42 ------ .../Repositories/IReadOnlyBasicRepository.cs | 31 ----- .../Abp/Domain/Repositories/IRepository.cs | 13 -- .../Abp/Domain/Repositories/RepositoryBase.cs | 55 +------- .../EntityFrameworkCore/EfCoreRepository.cs | 73 +---------- .../Volo/Abp/Features/FeatureInterceptor.cs | 13 -- .../DynamicHttpProxyInterceptor.cs | 25 ---- .../MemoryDb/MemoryDbRepository.cs | 79 ++++++------ .../Repositories/MongoDB/MongoDbRepository.cs | 120 ----------------- .../Volo/Abp/Uow/UnitOfWorkInterceptor.cs | 15 --- .../Abp/Validation/ValidationInterceptor.cs | 6 - ...ice_Tests.cs => PeopleAppService_Tests.cs} | 18 +-- .../Mvc/Uow/UnitOfWorkTestController.cs | 1 - .../Mvc/Versioning/App/v1/ITodoAppService.cs | 3 +- .../Mvc/Versioning/App/v1/TodoAppService.cs | 7 +- .../Mvc/Versioning/App/v2/ITodoAppService.cs | 3 +- .../Mvc/Versioning/App/v2/TodoAppService.cs | 7 +- .../Test/v1/TodoAppService_Tests.cs | 7 +- .../Test/v2/TodoAppService_Tests.cs | 7 +- .../Abp/Authorization/Authorization_Tests.cs | 10 +- .../TestServices/IMyAuthorizedService1.cs | 4 +- .../TestServices/MyAuthorizedService1.cs | 8 +- .../DynamicProxy/AbpInterceptionTestBase.cs | 94 ++------------ .../DynamicProxy/SimpleAsyncInterceptor.cs | 9 +- .../SimpleResultCacheTestInterceptor.cs | 11 +- .../Abp/DynamicProxy/SimpleSyncInterceptor.cs | 14 -- .../RepositoryRegistration_Tests.cs | 34 ++--- .../AbpEfCoreTestSecondContextModule.cs | 5 +- .../SecondContextTestDataBuilder.cs | 5 +- .../DbContext_Replace_Tests.cs | 15 ++- .../Abp/Features/ClassFeatureTestService.cs | 11 +- .../Abp/Features/FeatureInterceptor_Tests.cs | 12 +- ...plicationService_FluentValidation_Tests.cs | 45 +------ .../DynamicProxying/IRegularTestController.cs | 2 - .../PersonAppServiceClientProxy_Tests.cs | 12 +- .../DynamicProxying/RegularTestController.cs | 7 - .../RegularTestControllerClientProxy_Tests.cs | 6 - .../Repositories/Repository_Basic_Tests.cs | 8 +- .../Repository_Basic_Tests_With_Int_Pk.cs | 7 +- .../TestApp/Application/PeopleAppService.cs | 6 +- .../Volo/Abp/TestApp/TestAppModule.cs | 5 +- .../Volo/Abp/TestApp/TestDataBuilder.cs | 47 +++---- .../Testing/EntityChangeEvents_Tests.cs | 6 +- .../Repository_Basic_Tests_With_Int_Pk.cs | 7 +- .../ApplicationService_Validation_Tests.cs | 122 +++++++++--------- 53 files changed, 283 insertions(+), 895 deletions(-) rename framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/{PersonAppService_Tests.cs => PeopleAppService_Tests.cs} (88%) delete mode 100644 framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleSyncInterceptor.cs diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs index 434ddc9d16..5a401a218e 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs @@ -18,33 +18,6 @@ namespace Volo.Abp.Auditing _auditingManager = auditingManager; } - public override void Intercept(IAbpMethodInvocation invocation) - { - if (!ShouldIntercept(invocation, out var auditLog, out var auditLogAction)) - { - invocation.Proceed(); - return; - } - - var stopwatch = Stopwatch.StartNew(); - - try - { - invocation.Proceed(); - } - catch (Exception ex) - { - auditLog.Exceptions.Add(ex); - throw; - } - finally - { - stopwatch.Stop(); - auditLogAction.ExecutionDuration = Convert.ToInt32(stopwatch.Elapsed.TotalMilliseconds); - auditLog.Actions.Add(auditLogAction); - } - } - public override async Task InterceptAsync(IAbpMethodInvocation invocation) { if (!ShouldIntercept(invocation, out var auditLog, out var auditLogAction)) diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs index 74314e815d..44466884dd 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.DynamicProxy; -using Volo.Abp.Threading; namespace Volo.Abp.Authorization { @@ -14,12 +13,6 @@ namespace Volo.Abp.Authorization _methodInvocationAuthorizationService = methodInvocationAuthorizationService; } - public override void Intercept(IAbpMethodInvocation invocation) - { - AsyncHelper.RunSync(() => AuthorizeAsync(invocation)); - invocation.Proceed(); - } - public override async Task InterceptAsync(IAbpMethodInvocation invocation) { await AuthorizeAsync(invocation); diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs index edb52aff86..c8ba229979 100644 --- a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs @@ -42,15 +42,10 @@ namespace Volo.Abp.Castle.DynamicProxy } else { - InterceptSyncMethod(invocation, proceedInfo); + proceedInfo.Invoke(); } } - private void InterceptSyncMethod(IInvocation invocation, IInvocationProceedInfo proceedInfo) - { - _abpInterceptor.Intercept(new CastleAbpMethodInvocationAdapter(invocation, proceedInfo)); - } - private void InterceptAsyncMethod(IInvocation invocation, IInvocationProceedInfo proceedInfo) { if (invocation.Method.ReturnType == typeof(Task)) 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 0963da406b..13f59cb0c1 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 @@ -40,25 +40,13 @@ namespace Volo.Abp.Castle.DynamicProxy _lazyArgumentsDictionary = new Lazy>(GetArgumentsDictionary); } - public void Proceed() - { - ProceedInfo.Invoke(); - - if (Invocation.Method.IsAsync()) - { - AsyncHelper.RunSync(() => (Task)Invocation.ReturnValue); - } - } - public Task ProceedAsync() { ProceedInfo.Invoke(); _actualReturnValue = Invocation.ReturnValue; - return Invocation.Method.IsAsync() - ? (Task)_actualReturnValue - : Task.FromResult(_actualReturnValue); + return (Task) _actualReturnValue; } private IReadOnlyDictionary GetArgumentsDictionary() diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/AbpInterceptor.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/AbpInterceptor.cs index 8874beafcf..51ab36efc4 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/AbpInterceptor.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/AbpInterceptor.cs @@ -3,13 +3,7 @@ namespace Volo.Abp.DynamicProxy { public abstract class AbpInterceptor : IAbpInterceptor - { - public abstract void Intercept(IAbpMethodInvocation invocation); - - public virtual Task InterceptAsync(IAbpMethodInvocation invocation) - { - Intercept(invocation); - return Task.CompletedTask; - } - } + { + public abstract Task InterceptAsync(IAbpMethodInvocation invocation); + } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/IAbpInterceptor.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/IAbpInterceptor.cs index 0d953d9c73..c20cb01277 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/IAbpInterceptor.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/IAbpInterceptor.cs @@ -4,8 +4,6 @@ namespace Volo.Abp.DynamicProxy { public interface IAbpInterceptor { - void Intercept(IAbpMethodInvocation invocation); - Task InterceptAsync(IAbpMethodInvocation invocation); } } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/IAbpMethodInvocation.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/IAbpMethodInvocation.cs index 37a36ac05f..17a89be467 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/IAbpMethodInvocation.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/DynamicProxy/IAbpMethodInvocation.cs @@ -19,8 +19,6 @@ namespace Volo.Abp.DynamicProxy object ReturnValue { get; set; } - void Proceed(); - Task ProceedAsync(); } } \ No newline at end of file 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 05fc760182..d13d52ed97 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 @@ -25,54 +25,28 @@ namespace Volo.Abp.Domain.Repositories CancellationTokenProvider = NullCancellationTokenProvider.Instance; } - public abstract TEntity Insert(TEntity entity, bool autoSave = false); + public abstract Task InsertAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); - public virtual Task InsertAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) - { - return Task.FromResult(Insert(entity, autoSave)); - } + public abstract Task UpdateAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); - public abstract TEntity Update(TEntity entity, bool autoSave = false); + public abstract Task DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); - public virtual Task UpdateAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) - { - return Task.FromResult(Update(entity)); - } + public abstract Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default); - public abstract void Delete(TEntity entity, bool autoSave = false); - - public virtual Task DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) - { - Delete(entity); - return Task.CompletedTask; - } + public abstract Task GetCountAsync(CancellationToken cancellationToken = default); - protected virtual CancellationToken GetCancellationToken(CancellationToken prefferedValue = default) + protected virtual CancellationToken GetCancellationToken(CancellationToken preferredValue = default) { - return CancellationTokenProvider.FallbackToProvider(prefferedValue); - } - - public abstract List GetList(bool includeDetails = false); - - public virtual Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default) - { - return Task.FromResult(GetList(includeDetails)); - } - - public abstract long GetCount(); - - public virtual Task GetCountAsync(CancellationToken cancellationToken = default) - { - return Task.FromResult(GetCount()); + return CancellationTokenProvider.FallbackToProvider(preferredValue); } } public abstract class BasicRepositoryBase : BasicRepositoryBase, IBasicRepository where TEntity : class, IEntity { - public virtual TEntity Get(TKey id, bool includeDetails = true) + public virtual async Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) { - var entity = Find(id, includeDetails); + var entity = await FindAsync(id, includeDetails, cancellationToken); if (entity == null) { @@ -82,33 +56,17 @@ namespace Volo.Abp.Domain.Repositories return entity; } - public virtual Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) - { - return Task.FromResult(Get(id, includeDetails)); - } - - public abstract TEntity Find(TKey id, bool includeDetails = true); - - public virtual Task FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) - { - return Task.FromResult(Find(id, includeDetails)); - } - - public virtual void Delete(TKey id, bool autoSave = false) + 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 = Find(id); + var entity = await FindAsync(id, cancellationToken: cancellationToken); if (entity == null) { return; } - Delete(entity); - } - - public virtual Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) - { - Delete(id); - return Task.CompletedTask; + await DeleteAsync(entity, autoSave, 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 f3644bbe4a..6b62691ed8 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 @@ -8,17 +8,6 @@ namespace Volo.Abp.Domain.Repositories public interface IBasicRepository : IReadOnlyBasicRepository where TEntity : class, IEntity { - /// - /// Inserts a new entity. - /// - /// Inserted entity - /// - /// Set true to automatically save entity 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. - /// - [NotNull] - TEntity Insert([NotNull] TEntity entity, bool autoSave = false); - /// /// Inserts a new entity. /// @@ -31,17 +20,6 @@ namespace Volo.Abp.Domain.Repositories [NotNull] Task InsertAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); - /// - /// Updates an existing entity. - /// - /// 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. - /// - [NotNull] - TEntity Update([NotNull] TEntity entity, bool autoSave = false); - /// /// Updates an existing entity. /// @@ -54,16 +32,6 @@ namespace Volo.Abp.Domain.Repositories [NotNull] Task UpdateAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); - /// - /// Deletes an entity. - /// - /// Entity 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. - /// - void Delete([NotNull] TEntity entity, bool autoSave = false); - /// /// Deletes an entity. /// @@ -79,16 +47,6 @@ namespace Volo.Abp.Domain.Repositories public interface IBasicRepository : IBasicRepository, IReadOnlyBasicRepository where TEntity : class, IEntity { - /// - /// Deletes an entity by primary key. - /// - /// Primary key of the 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. - /// - void Delete(TKey id, bool autoSave = false); //TODO: Return true if deleted - /// /// Deletes an entity by primary key. /// diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IReadOnlyBasicRepository.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IReadOnlyBasicRepository.cs index c67b35794b..828e305ff8 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IReadOnlyBasicRepository.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IReadOnlyBasicRepository.cs @@ -9,13 +9,6 @@ namespace Volo.Abp.Domain.Repositories public interface IReadOnlyBasicRepository : IRepository where TEntity : class, IEntity { - /// - /// Gets a list of all the entities. - /// - /// Set true to include all children of this entity - /// Entity - List GetList(bool includeDetails = false); - /// /// Gets a list of all the entities. /// @@ -24,11 +17,6 @@ namespace Volo.Abp.Domain.Repositories /// Entity Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default); - /// - /// Gets total count of all entities. - /// - long GetCount(); - /// /// Gets total count of all entities. /// @@ -38,16 +26,6 @@ namespace Volo.Abp.Domain.Repositories public interface IReadOnlyBasicRepository : IReadOnlyBasicRepository where TEntity : class, IEntity { - /// - /// Gets an entity with given primary key. - /// Throws if can not find an entity with given id. - /// - /// Primary key of the entity to get - /// Set true to include all children of this entity - /// Entity - [NotNull] - TEntity Get(TKey id, bool includeDetails = true); - /// /// Gets an entity with given primary key. /// Throws if can not find an entity with given id. @@ -59,15 +37,6 @@ namespace Volo.Abp.Domain.Repositories [NotNull] Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default); - /// - /// Gets an entity with given primary key or null if not found. - /// - /// Primary key of the entity to get - /// Set true to include all children of this entity - /// Entity or null - [CanBeNull] - TEntity Find(TKey id, bool includeDetails = true); - /// /// Gets an entity with given primary key or null if not found. /// diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IRepository.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IRepository.cs index a77dc4acb7..2ac16ec229 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IRepository.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IRepository.cs @@ -18,19 +18,6 @@ namespace Volo.Abp.Domain.Repositories public interface IRepository : IReadOnlyRepository, IBasicRepository where TEntity : class, IEntity { - /// - /// Deletes many entities by function. - /// Notice that: All entities fits to given predicate are retrieved and deleted. - /// This may cause major performance problems if there are too many entities with - /// given predicate. - /// - /// A condition to filter 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. - /// - void Delete([NotNull] Expression> predicate, bool autoSave = false); - /// /// Deletes many entities by function. /// Notice that: All entities fits to given predicate are retrieved and deleted. 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 139f4ff999..29814f4de6 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 @@ -46,19 +46,7 @@ namespace Volo.Abp.Domain.Repositories protected abstract IQueryable GetQueryable(); - public virtual void Delete(Expression> predicate, bool autoSave = false) - { - foreach (var entity in GetQueryable().Where(predicate).ToList()) - { - Delete(entity, autoSave); - } - } - - public virtual Task DeleteAsync(Expression> predicate, bool autoSave = false, CancellationToken cancellationToken = default) - { - Delete(predicate, autoSave); - return Task.CompletedTask; - } + public abstract Task DeleteAsync(Expression> predicate, bool autoSave = false, CancellationToken cancellationToken = default); protected virtual TQueryable ApplyDataFilters(TQueryable query) where TQueryable : IQueryable @@ -81,50 +69,19 @@ namespace Volo.Abp.Domain.Repositories public abstract class RepositoryBase : RepositoryBase, IRepository where TEntity : class, IEntity { - public virtual TEntity Find(TKey id, bool includeDetails = true) - { - return includeDetails - ? WithDetails().FirstOrDefault(EntityHelper.CreateEqualityExpressionForId(id)) - : GetQueryable().FirstOrDefault(EntityHelper.CreateEqualityExpressionForId(id)); - } + public abstract Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default); - public virtual TEntity Get(TKey id, bool includeDetails = true) - { - var entity = Find(id, includeDetails); + public abstract Task FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default); - if (entity == null) - { - throw new EntityNotFoundException(typeof(TEntity), id); - } - - return entity; - } - - public virtual Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) - { - return Task.FromResult(Get(id, includeDetails)); - } - - public virtual Task FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) { - return Task.FromResult(Find(id, includeDetails)); - } - - public virtual void Delete(TKey id, bool autoSave = false) - { - var entity = Find(id, includeDetails: false); + var entity = await FindAsync(id, cancellationToken: cancellationToken); if (entity == null) { return; } - Delete(entity, autoSave); - } - - public virtual Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) - { - Delete(id, autoSave); - return Task.CompletedTask; + await DeleteAsync(entity, autoSave, cancellationToken); } } } \ No newline at end of file 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 bfedcf2d66..4131a774b5 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 @@ -40,18 +40,6 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore ); } - public override TEntity Insert(TEntity entity, bool autoSave = false) - { - var savedEntity = DbSet.Add(entity).Entity; - - if (autoSave) - { - DbContext.SaveChanges(); - } - - return savedEntity; - } - public override async Task InsertAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { var savedEntity = DbSet.Add(entity).Entity; @@ -64,20 +52,6 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore return savedEntity; } - public override TEntity Update(TEntity entity, bool autoSave = false) - { - DbContext.Attach(entity); - - var updatedEntity = DbContext.Update(entity).Entity; - - if (autoSave) - { - DbContext.SaveChanges(); - } - - return updatedEntity; - } - public override async Task UpdateAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { DbContext.Attach(entity); @@ -91,17 +65,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore return updatedEntity; } - - public override void Delete(TEntity entity, bool autoSave = false) - { - DbSet.Remove(entity); - - if (autoSave) - { - DbContext.SaveChanges(); - } - } - + public override async Task DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { DbSet.Remove(entity); @@ -112,13 +76,6 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore } } - public override List GetList(bool includeDetails = false) - { - return includeDetails - ? WithDetails().ToList() - : DbSet.ToList(); - } - public override async Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default) { return includeDetails @@ -126,11 +83,6 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore : await DbSet.ToListAsync(GetCancellationToken(cancellationToken)); } - public override long GetCount() - { - return DbSet.LongCount(); - } - public override async Task GetCountAsync(CancellationToken cancellationToken = default) { return await DbSet.LongCountAsync(GetCancellationToken(cancellationToken)); @@ -141,16 +93,6 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore return DbSet.AsQueryable(); } - public override void Delete(Expression> predicate, bool autoSave = false) - { - base.Delete(predicate, autoSave); - - if (autoSave) - { - DbContext.SaveChanges(); - } - } - public override async Task DeleteAsync(Expression> predicate, bool autoSave = false, CancellationToken cancellationToken = default) { var entities = await GetQueryable() @@ -269,20 +211,9 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore : await DbSet.FindAsync(new object[] { id }, GetCancellationToken(cancellationToken)); } - public virtual void Delete(TKey id, bool autoSave = false) - { - var entity = Find(id, includeDetails: false); - if (entity == null) - { - return; - } - - Delete(entity, autoSave); - } - public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) { - var entity = await FindAsync(id, includeDetails: false, cancellationToken: cancellationToken); + var entity = await FindAsync(id, cancellationToken: cancellationToken); if (entity == null) { return; diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureInterceptor.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureInterceptor.cs index 5fb7c54293..9986af6275 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureInterceptor.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureInterceptor.cs @@ -2,7 +2,6 @@ using Volo.Abp.Aspects; using Volo.Abp.DependencyInjection; using Volo.Abp.DynamicProxy; -using Volo.Abp.Threading; namespace Volo.Abp.Features { @@ -16,18 +15,6 @@ namespace Volo.Abp.Features _methodInvocationFeatureCheckerService = methodInvocationFeatureCheckerService; } - public override void Intercept(IAbpMethodInvocation invocation) - { - if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.FeatureChecking)) - { - invocation.Proceed(); - return; - } - - AsyncHelper.RunSync(() => CheckFeaturesAsync(invocation)); - invocation.Proceed(); - } - public override async Task InterceptAsync(IAbpMethodInvocation invocation) { if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.FeatureChecking)) 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 d2b57d32ef..42fdb0afc3 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 @@ -74,31 +74,6 @@ namespace Volo.Abp.Http.Client.DynamicProxying Logger = NullLogger>.Instance; } - public override void Intercept(IAbpMethodInvocation invocation) - { - if (invocation.Method.ReturnType == typeof(void)) - { - AsyncHelper.RunSync(() => MakeRequestAsync(invocation)); - } - else - { - var responseAsString = AsyncHelper.RunSync(() => MakeRequestAsync(invocation)); - - //TODO: Think on that - if (TypeHelper.IsPrimitiveExtended(invocation.Method.ReturnType, true)) - { - invocation.ReturnValue = Convert.ChangeType(responseAsString, invocation.Method.ReturnType); - } - else - { - invocation.ReturnValue = JsonSerializer.Deserialize( - invocation.Method.ReturnType, - responseAsString - ); - } - } - } - public override Task InterceptAsync(IAbpMethodInvocation invocation) { if (invocation.Method.ReturnType.GenericTypeArguments.IsNullOrEmpty()) 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 68b9beeb6e..b81aa7ae87 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,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Entities; @@ -25,40 +26,52 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb DatabaseProvider = databaseProvider; } - public override TEntity Insert(TEntity entity, bool autoSave = false) + protected override IQueryable GetQueryable() { - Collection.Add(entity); - return entity; + return ApplyDataFilters(Collection.AsQueryable()); } - public override TEntity Update(TEntity entity, bool autoSave = false) + public override Task DeleteAsync(Expression> predicate, bool autoSave = false, CancellationToken cancellationToken = default) { - Collection.Update(entity); - return entity; + var entities = Collection.AsQueryable().Where(predicate).ToList(); + foreach (var entity in entities) + { + Collection.Remove(entity); + } + + return Task.CompletedTask; } - public override void Delete(TEntity entity, bool autoSave = false) + public override Task InsertAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { - Collection.Remove(entity); + Collection.Add(entity); + return Task.FromResult(entity); + } + + public override Task UpdateAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) + { + Collection.Update(entity); + return Task.FromResult(entity); } - public override List GetList(bool includeDetails = false) + public override Task DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { - return Collection.ToList(); + Collection.Remove(entity); + return Task.CompletedTask; } - public override long GetCount() + public override Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default) { - return Collection.Count(); + return Task.FromResult(Collection.ToList()); } - protected override IQueryable GetQueryable() + public override Task GetCountAsync(CancellationToken cancellationToken = default) { - return ApplyDataFilters(Collection.AsQueryable()); + return Task.FromResult(Collection.LongCount()); } } - public class MemoryDbRepository : MemoryDbRepository, IMemoryDbRepository + public class MemoryDbRepository : MemoryDbRepository, IMemoryDbRepository where TMemoryDbContext : MemoryDbContext where TEntity : class, IEntity { @@ -67,16 +80,16 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb { } - public override TEntity Insert(TEntity entity, bool autoSave = false) + public override Task InsertAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { SetIdIfNeeded(entity); - return base.Insert(entity, autoSave); + return base.InsertAsync(entity, autoSave, cancellationToken); } protected virtual void SetIdIfNeeded(TEntity entity) { - if (typeof(TKey) == typeof(int) || - typeof(TKey) == typeof(long) || + if (typeof(TKey) == typeof(int) || + typeof(TKey) == typeof(long) || typeof(TKey) == typeof(Guid)) { if (EntityHelper.HasDefaultId(entity)) @@ -86,14 +99,9 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb } } - public virtual TEntity Find(TKey id, bool includeDetails = true) - { - return GetQueryable().FirstOrDefault(e => e.Id.Equals(id)); - } - - public virtual TEntity Get(TKey id, bool includeDetails = true) + public virtual async Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) { - var entity = Find(id, includeDetails); + var entity = await FindAsync(id, includeDetails, cancellationToken); if (entity == null) { @@ -103,31 +111,20 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb return entity; } - public virtual Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) - { - return Task.FromResult(Get(id, includeDetails)); - } - public virtual Task FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) { - return Task.FromResult(Find(id, includeDetails)); + return Task.FromResult(GetQueryable().FirstOrDefault(e => e.Id.Equals(id))); } - public virtual void Delete(TKey id, bool autoSave = false) + public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) { - var entity = Find(id); + var entity = await FindAsync(id, cancellationToken: cancellationToken); if (entity == null) { return; } - Delete(entity); - } - - public virtual Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) - { - Delete(id); - return Task.CompletedTask; + await DeleteAsync(entity, autoSave, cancellationToken); } } } \ No newline at end of file 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 057f72bbb5..4e8ccaa82e 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 @@ -53,20 +53,6 @@ namespace Volo.Abp.Domain.Repositories.MongoDB EntityChangeEventHelper = NullEntityChangeEventHelper.Instance; } - public override TEntity Insert(TEntity entity, bool autoSave = false) - { - /* EntityCreatedEvent (OnUowCompleted) is triggered as the first because it should be - * triggered before other events triggered inside an EntityCreating event handler. - * This is also true for other "ed" & "ing" events. - */ - - AsyncHelper.RunSync(() => ApplyAbpConceptsForAddedEntityAsync(entity)); - - Collection.InsertOne(entity); - - return entity; - } - public override async Task InsertAsync( TEntity entity, bool autoSave = false, @@ -82,37 +68,6 @@ namespace Volo.Abp.Domain.Repositories.MongoDB return entity; } - public override TEntity Update(TEntity entity, bool autoSave = false) - { - SetModificationAuditProperties(entity); - - if (entity is ISoftDelete softDeleteEntity && softDeleteEntity.IsDeleted) - { - SetDeletionAuditProperties(entity); - AsyncHelper.RunSync(() => TriggerEntityDeleteEventsAsync(entity)); - } - else - { - AsyncHelper.RunSync(() => TriggerEntityUpdateEventsAsync(entity)); - } - - AsyncHelper.RunSync(() => TriggerDomainEventsAsync(entity)); - - var oldConcurrencyStamp = SetNewConcurrencyStamp(entity); - - var result = Collection.ReplaceOne( - CreateEntityFilter(entity, true, oldConcurrencyStamp), - entity - ); - - if (result.MatchedCount <= 0) - { - ThrowOptimisticConcurrencyException(); - } - - return entity; - } - public override async Task UpdateAsync( TEntity entity, bool autoSave = false, @@ -148,37 +103,6 @@ namespace Volo.Abp.Domain.Repositories.MongoDB return entity; } - public override void Delete(TEntity entity, bool autoSave = false) - { - AsyncHelper.RunSync(() => ApplyAbpConceptsForDeletedEntityAsync(entity)); - var oldConcurrencyStamp = SetNewConcurrencyStamp(entity); - - if (entity is ISoftDelete softDeleteEntity) - { - softDeleteEntity.IsDeleted = true; - var result = Collection.ReplaceOne( - CreateEntityFilter(entity, true, oldConcurrencyStamp), - entity - ); - - if (result.MatchedCount <= 0) - { - ThrowOptimisticConcurrencyException(); - } - } - else - { - var result = Collection.DeleteOne( - CreateEntityFilter(entity, true, oldConcurrencyStamp) - ); - - if (result.DeletedCount <= 0) - { - ThrowOptimisticConcurrencyException(); - } - } - } - public override async Task DeleteAsync( TEntity entity, bool autoSave = false, @@ -215,38 +139,16 @@ namespace Volo.Abp.Domain.Repositories.MongoDB } } - public override List GetList(bool includeDetails = false) - { - return GetMongoQueryable().ToList(); - } - public override async Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default) { return await GetMongoQueryable().ToListAsync(GetCancellationToken(cancellationToken)); } - public override long GetCount() - { - return GetMongoQueryable().LongCount(); - } - public override async Task GetCountAsync(CancellationToken cancellationToken = default) { return await GetMongoQueryable().LongCountAsync(GetCancellationToken(cancellationToken)); } - public override void Delete(Expression> predicate, bool autoSave = false) - { - var entities = GetMongoQueryable() - .Where(predicate) - .ToList(); - - foreach (var entity in entities) - { - Delete(entity, autoSave); - } - } - public override async Task DeleteAsync( Expression> predicate, bool autoSave = false, @@ -417,18 +319,6 @@ namespace Volo.Abp.Domain.Repositories.MongoDB } - public virtual TEntity Get(TKey id, bool includeDetails = true) - { - var entity = Find(id, includeDetails); - - if (entity == null) - { - throw new EntityNotFoundException(typeof(TEntity), id); - } - - return entity; - } - public virtual async Task GetAsync( TKey id, bool includeDetails = true, @@ -454,16 +344,6 @@ namespace Volo.Abp.Domain.Repositories.MongoDB .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } - public virtual TEntity Find(TKey id, bool includeDetails = true) - { - return Collection.Find(CreateEntityFilter(id, true)).FirstOrDefault(); - } - - public virtual void Delete(TKey id, bool autoSave = false) - { - Collection.DeleteOne(CreateEntityFilter(id)); - } - public virtual Task DeleteAsync( TKey id, bool autoSave = false, diff --git a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkInterceptor.cs b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkInterceptor.cs index 1ca6681189..81bd132a5e 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkInterceptor.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkInterceptor.cs @@ -18,21 +18,6 @@ namespace Volo.Abp.Uow _defaultOptions = options.Value; } - public override void Intercept(IAbpMethodInvocation invocation) - { - if (!UnitOfWorkHelper.IsUnitOfWorkMethod(invocation.Method, out var unitOfWorkAttribute)) - { - invocation.Proceed(); - return; - } - - using (var uow = _unitOfWorkManager.Begin(CreateOptions(invocation, unitOfWorkAttribute))) - { - invocation.Proceed(); - uow.Complete(); - } - } - public override async Task InterceptAsync(IAbpMethodInvocation invocation) { if (!UnitOfWorkHelper.IsUnitOfWorkMethod(invocation.Method, out var unitOfWorkAttribute)) diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationInterceptor.cs b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationInterceptor.cs index ed8c107005..b4ce642471 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationInterceptor.cs +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationInterceptor.cs @@ -13,12 +13,6 @@ namespace Volo.Abp.Validation _methodInvocationValidator = methodInvocationValidator; } - public override void Intercept(IAbpMethodInvocation invocation) - { - Validate(invocation); - invocation.Proceed(); - } - public override async Task InterceptAsync(IAbpMethodInvocation invocation) { Validate(invocation); diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PersonAppService_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PeopleAppService_Tests.cs similarity index 88% rename from framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PersonAppService_Tests.cs rename to framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PeopleAppService_Tests.cs index 8bf86a3ace..96a79d8971 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PersonAppService_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PeopleAppService_Tests.cs @@ -19,13 +19,13 @@ namespace Volo.Abp.AspNetCore.Mvc { //TODO: Refactor to make tests easier. - public class PersonAppService_Tests : AspNetCoreMvcTestBase + public class PeopleAppService_Tests : AspNetCoreMvcTestBase { private readonly IRepository _personRepository; private readonly IJsonSerializer _jsonSerializer; private readonly IObjectMapper _objectMapper; - public PersonAppService_Tests() + public PeopleAppService_Tests() { _personRepository = ServiceProvider.GetRequiredService>(); _jsonSerializer = ServiceProvider.GetRequiredService(); @@ -42,7 +42,7 @@ namespace Volo.Abp.AspNetCore.Mvc [Fact] public async Task Get_Test() { - var firstPerson = _personRepository.First(); + var firstPerson = (await _personRepository.GetListAsync()).First(); var result = await GetResponseAsObjectAsync($"/api/app/people/{firstPerson.Id}"); result.Name.ShouldBe(firstPerson.Name); @@ -51,7 +51,7 @@ namespace Volo.Abp.AspNetCore.Mvc [Fact] public async Task Delete_Test() { - var firstPerson = _personRepository.First(); + var firstPerson = (await _personRepository.GetListAsync()).First(); await Client.DeleteAsync($"/api/app/people/{firstPerson.Id}"); @@ -89,7 +89,7 @@ namespace Volo.Abp.AspNetCore.Mvc { //Arrange - var firstPerson = _personRepository.First(); + var firstPerson = (await _personRepository.GetListAsync()).First(); var firstPersonAge = firstPerson.Age; //Persist to a variable since we are using in-memory database which shares same entity. var updateDto = _objectMapper.Map(firstPerson); updateDto.Age = updateDto.Age + 1; @@ -123,7 +123,7 @@ namespace Volo.Abp.AspNetCore.Mvc { //Arrange - var personToAddNewPhone = _personRepository.First(); + var personToAddNewPhone = (await _personRepository.GetListAsync()).First(); var phoneNumberToAdd = RandomHelper.GetRandom(1000000, 9000000).ToString(); //Act @@ -152,7 +152,7 @@ namespace Volo.Abp.AspNetCore.Mvc [Fact] public async Task GetPhones_Test() { - var douglas = _personRepository.First(p => p.Name == "Douglas"); + var douglas = (await _personRepository.GetListAsync()).First(p => p.Name == "Douglas"); var result = await GetResponseAsObjectAsync>($"/api/app/people/{douglas.Id}/phones"); result.Items.Count.ShouldBe(douglas.Phones.Count); @@ -161,12 +161,12 @@ namespace Volo.Abp.AspNetCore.Mvc [Fact] public async Task DeletePhone_Test() { - var douglas = _personRepository.First(p => p.Name == "Douglas"); + var douglas = (await _personRepository.GetListAsync()).First(p => p.Name == "Douglas"); var firstPhone = douglas.Phones.First(); await Client.DeleteAsync($"/api/app/people/{douglas.Id}/phones?number={firstPhone.Number}"); - douglas = _personRepository.First(p => p.Name == "Douglas"); + douglas = (await _personRepository.GetListAsync()).First(p => p.Name == "Douglas"); douglas.Phones.Any(p => p.Number == firstPhone.Number).ShouldBeFalse(); } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkTestController.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkTestController.cs index 4d8d51c3c8..705a9a7212 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkTestController.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkTestController.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Mvc; using Shouldly; -using Volo.Abp.UI; using Volo.Abp.Uow; namespace Volo.Abp.AspNetCore.Mvc.Uow diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v1/ITodoAppService.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v1/ITodoAppService.cs index 3e82da0329..7ed6be1ac2 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v1/ITodoAppService.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v1/ITodoAppService.cs @@ -1,9 +1,10 @@ +using System.Threading.Tasks; using Volo.Abp.Application.Services; namespace Volo.Abp.AspNetCore.Mvc.Versioning.App.v1 { public interface ITodoAppService : IApplicationService { - string Get(int id); + Task GetAsync(int id); } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v1/TodoAppService.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v1/TodoAppService.cs index f3f900148d..eee0248a61 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v1/TodoAppService.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v1/TodoAppService.cs @@ -1,4 +1,5 @@ -using Volo.Abp.ApiVersioning; +using System.Threading.Tasks; +using Volo.Abp.ApiVersioning; using Volo.Abp.Application.Services; namespace Volo.Abp.AspNetCore.Mvc.Versioning.App.v1 @@ -12,9 +13,9 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning.App.v1 _requestedApiVersion = requestedApiVersion; } - public string Get(int id) + public Task GetAsync(int id) { - return $"Compat-{id}-{GetVersionOrNone()}"; + return Task.FromResult($"Compat-{id}-{GetVersionOrNone()}"); } private string GetVersionOrNone() diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v2/ITodoAppService.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v2/ITodoAppService.cs index ae4afea6e1..196cc82503 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v2/ITodoAppService.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v2/ITodoAppService.cs @@ -1,9 +1,10 @@ +using System.Threading.Tasks; using Volo.Abp.Application.Services; namespace Volo.Abp.AspNetCore.Mvc.Versioning.App.v2 { public interface ITodoAppService : IApplicationService { - string Get(int id); + Task GetAsync(int id); } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v2/TodoAppService.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v2/TodoAppService.cs index b97af873b7..24f8604227 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v2/TodoAppService.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/App/v2/TodoAppService.cs @@ -1,4 +1,5 @@ -using Volo.Abp.ApiVersioning; +using System.Threading.Tasks; +using Volo.Abp.ApiVersioning; using Volo.Abp.Application.Services; namespace Volo.Abp.AspNetCore.Mvc.Versioning.App.v2 @@ -12,9 +13,9 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning.App.v2 _requestedApiVersion = requestedApiVersion; } - public string Get(int id) + public Task GetAsync(int id) { - return id + "-" + GetVersionOrNone(); + return Task.FromResult(id + "-" + GetVersionOrNone()); } private string GetVersionOrNone() diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v1/TodoAppService_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v1/TodoAppService_Tests.cs index 7b461a3902..f5b86cf7d7 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v1/TodoAppService_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v1/TodoAppService_Tests.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using Shouldly; using Volo.Abp.AspNetCore.Mvc.Versioning.App.v1; using Xunit; @@ -15,9 +16,9 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning.Test.v1 } [Fact] - public void Get() + public async Task GetAsync() { - _todoAppService.Get(42).ShouldBe("Compat-42-1.0"); + (await _todoAppService.GetAsync(42)).ShouldBe("Compat-42-1.0"); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v2/TodoAppService_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v2/TodoAppService_Tests.cs index f4cd122afc..d6b681aa2e 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v2/TodoAppService_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v2/TodoAppService_Tests.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using Shouldly; using Volo.Abp.AspNetCore.Mvc.Versioning.App.v2; using Xunit; @@ -15,9 +16,9 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning.Test.v2 } [Fact] - public void Get() + public async Task GetAsync() { - _todoAppService.Get(42).ShouldBe("42-2.0"); + (await _todoAppService.GetAsync(42)).ShouldBe("42-2.0"); } } } diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs index fa069348cd..104d75c11b 100644 --- a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs @@ -18,11 +18,11 @@ namespace Volo.Abp.Authorization } [Fact] - public void Should_Not_Allow_To_Call_Method_If_Has_No_Permission_ProtectedByClass() + public async Task Should_Not_Allow_To_Call_Method_If_Has_No_Permission_ProtectedByClass() { - Assert.Throws(() => + await Assert.ThrowsAsync(async () => { - _myAuthorizedService1.ProtectedByClass(); + await _myAuthorizedService1.ProtectedByClass(); }); } @@ -36,9 +36,9 @@ namespace Volo.Abp.Authorization } [Fact] - public void Should_Allow_To_Call_Anonymous_Method() + public async Task Should_Allow_To_Call_Anonymous_Method() { - _myAuthorizedService1.Anonymous().ShouldBe(42); + (await _myAuthorizedService1.Anonymous()).ShouldBe(42); } [Fact] diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/IMyAuthorizedService1.cs b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/IMyAuthorizedService1.cs index 0ef6bde8a0..b3841c4fed 100644 --- a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/IMyAuthorizedService1.cs +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/IMyAuthorizedService1.cs @@ -4,11 +4,11 @@ namespace Volo.Abp.Authorization.TestServices { public interface IMyAuthorizedService1 { - int Anonymous(); + Task Anonymous(); Task AnonymousAsync(); - int ProtectedByClass(); + Task ProtectedByClass(); Task ProtectedByClassAsync(); } diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/MyAuthorizedService1.cs b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/MyAuthorizedService1.cs index 0b33dd0c98..b1b2a4c43f 100644 --- a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/MyAuthorizedService1.cs +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/MyAuthorizedService1.cs @@ -8,9 +8,9 @@ namespace Volo.Abp.Authorization.TestServices public class MyAuthorizedService1 : IMyAuthorizedService1, ITransientDependency { [AllowAnonymous] - public virtual int Anonymous() + public virtual Task Anonymous() { - return 42; + return Task.FromResult(42); } [AllowAnonymous] @@ -20,9 +20,9 @@ namespace Volo.Abp.Authorization.TestServices return 42; } - public virtual int ProtectedByClass() + public virtual Task ProtectedByClass() { - return 42; + return Task.FromResult(42); } public virtual async Task ProtectedByClassAsync() diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/AbpInterceptionTestBase.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/AbpInterceptionTestBase.cs index 27b3bf5d81..c6e9f03927 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/AbpInterceptionTestBase.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/AbpInterceptionTestBase.cs @@ -12,7 +12,6 @@ namespace Volo.Abp.DynamicProxy protected override void BeforeAddApplication(IServiceCollection services) { services.AddTransient(); - services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -24,7 +23,6 @@ namespace Volo.Abp.DynamicProxy if (typeof(SimpleInterceptionTargetClass) == registration.ImplementationType) { registration.Interceptors.Add(); - registration.Interceptors.Add(); registration.Interceptors.Add(); } @@ -48,16 +46,14 @@ namespace Volo.Abp.DynamicProxy //Assert - target.Logs.Count.ShouldBe(9); + target.Logs.Count.ShouldBe(7); target.Logs[0].ShouldBe("SimpleAsyncInterceptor_InterceptAsync_BeforeInvocation"); - target.Logs[1].ShouldBe("SimpleSyncInterceptor_Intercept_BeforeInvocation"); - target.Logs[2].ShouldBe("SimpleAsyncInterceptor2_InterceptAsync_BeforeInvocation"); - target.Logs[3].ShouldBe("EnterDoItAsync"); - target.Logs[4].ShouldBe("MiddleDoItAsync"); - target.Logs[5].ShouldBe("ExitDoItAsync"); - target.Logs[6].ShouldBe("SimpleAsyncInterceptor2_InterceptAsync_AfterInvocation"); - target.Logs[7].ShouldBe("SimpleSyncInterceptor_Intercept_AfterInvocation"); - target.Logs[8].ShouldBe("SimpleAsyncInterceptor_InterceptAsync_AfterInvocation"); + target.Logs[1].ShouldBe("SimpleAsyncInterceptor2_InterceptAsync_BeforeInvocation"); + target.Logs[2].ShouldBe("EnterDoItAsync"); + target.Logs[3].ShouldBe("MiddleDoItAsync"); + target.Logs[4].ShouldBe("ExitDoItAsync"); + target.Logs[5].ShouldBe("SimpleAsyncInterceptor2_InterceptAsync_AfterInvocation"); + target.Logs[6].ShouldBe("SimpleAsyncInterceptor_InterceptAsync_AfterInvocation"); } [Fact] @@ -73,77 +69,15 @@ namespace Volo.Abp.DynamicProxy //Assert - result.ShouldBe(42); - target.Logs.Count.ShouldBe(9); - target.Logs[0].ShouldBe("SimpleAsyncInterceptor_InterceptAsync_BeforeInvocation"); - target.Logs[1].ShouldBe("SimpleSyncInterceptor_Intercept_BeforeInvocation"); - target.Logs[2].ShouldBe("SimpleAsyncInterceptor2_InterceptAsync_BeforeInvocation"); - target.Logs[3].ShouldBe("EnterGetValueAsync"); - target.Logs[4].ShouldBe("MiddleGetValueAsync"); - target.Logs[5].ShouldBe("ExitGetValueAsync"); - target.Logs[6].ShouldBe("SimpleAsyncInterceptor2_InterceptAsync_AfterInvocation"); - target.Logs[7].ShouldBe("SimpleSyncInterceptor_Intercept_AfterInvocation"); - target.Logs[8].ShouldBe("SimpleAsyncInterceptor_InterceptAsync_AfterInvocation"); - } - - [Fact] - public void Should_Intercept_Sync_Method_Without_Return_Value() - { - //Arrange - - var target = ServiceProvider.GetService(); - - //Act - - target.DoIt(); - - //Assert - target.Logs.Count.ShouldBe(7); - target.Logs[0].ShouldBe("SimpleAsyncInterceptor_Intercept_BeforeInvocation"); - target.Logs[1].ShouldBe("SimpleSyncInterceptor_Intercept_BeforeInvocation"); - target.Logs[2].ShouldBe("SimpleAsyncInterceptor2_Intercept_BeforeInvocation"); - target.Logs[3].ShouldBe("ExecutingDoIt"); - target.Logs[4].ShouldBe("SimpleAsyncInterceptor2_Intercept_AfterInvocation"); - target.Logs[5].ShouldBe("SimpleSyncInterceptor_Intercept_AfterInvocation"); - target.Logs[6].ShouldBe("SimpleAsyncInterceptor_Intercept_AfterInvocation"); - } - - [Fact] - public void Should_Intercept_Sync_Method_With_Return_Value() - { - //Arrange - - var target = ServiceProvider.GetService(); - - //Act - - var result = target.GetValue(); - - //Assert - result.ShouldBe(42); target.Logs.Count.ShouldBe(7); - target.Logs[0].ShouldBe("SimpleAsyncInterceptor_Intercept_BeforeInvocation"); - target.Logs[1].ShouldBe("SimpleSyncInterceptor_Intercept_BeforeInvocation"); - target.Logs[2].ShouldBe("SimpleAsyncInterceptor2_Intercept_BeforeInvocation"); - target.Logs[3].ShouldBe("ExecutingGetValue"); - target.Logs[4].ShouldBe("SimpleAsyncInterceptor2_Intercept_AfterInvocation"); - target.Logs[5].ShouldBe("SimpleSyncInterceptor_Intercept_AfterInvocation"); - target.Logs[6].ShouldBe("SimpleAsyncInterceptor_Intercept_AfterInvocation"); - } - - [Fact] - public void Should_Cache_Results() - { - //Arrange - - var target = ServiceProvider.GetService(); - - //Act & Assert - - target.GetValue(42).ShouldBe(42); //First run, not cached yet - target.GetValue(43).ShouldBe(42); //First run, cached previous value - target.GetValue(44).ShouldBe(42); //First run, cached previous value + target.Logs[0].ShouldBe("SimpleAsyncInterceptor_InterceptAsync_BeforeInvocation"); + target.Logs[1].ShouldBe("SimpleAsyncInterceptor2_InterceptAsync_BeforeInvocation"); + target.Logs[2].ShouldBe("EnterGetValueAsync"); + target.Logs[3].ShouldBe("MiddleGetValueAsync"); + target.Logs[4].ShouldBe("ExitGetValueAsync"); + target.Logs[5].ShouldBe("SimpleAsyncInterceptor2_InterceptAsync_AfterInvocation"); + target.Logs[6].ShouldBe("SimpleAsyncInterceptor_InterceptAsync_AfterInvocation"); } [Fact] 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 f1f868700a..9427298e62 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,14 +5,7 @@ namespace Volo.Abp.DynamicProxy { public class SimpleAsyncInterceptor : AbpInterceptor { - public override void Intercept(IAbpMethodInvocation invocation) - { - (invocation.TargetObject as ICanLogOnObject)?.Logs?.Add($"{GetType().Name}_Intercept_BeforeInvocation"); - invocation.ProceedAsync(); - (invocation.TargetObject as ICanLogOnObject)?.Logs?.Add($"{GetType().Name}_Intercept_AfterInvocation"); - } - - public override async 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 1712d316a8..e5e4d39790 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 @@ -12,16 +12,7 @@ namespace Volo.Abp.DynamicProxy { _cache = new ConcurrentDictionary(); } - - public override void Intercept(IAbpMethodInvocation invocation) - { - invocation.ReturnValue = _cache.GetOrAdd(invocation.Method, m => - { - invocation.Proceed(); - return invocation.ReturnValue; - }); - } - + public override async Task InterceptAsync(IAbpMethodInvocation invocation) { if (_cache.ContainsKey(invocation.Method)) diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleSyncInterceptor.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleSyncInterceptor.cs deleted file mode 100644 index fc43e31525..0000000000 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleSyncInterceptor.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Volo.Abp.TestBase.Logging; - -namespace Volo.Abp.DynamicProxy -{ - public class SimpleSyncInterceptor : AbpInterceptor - { - public override void Intercept(IAbpMethodInvocation invocation) - { - (invocation.TargetObject as ICanLogOnObject)?.Logs?.Add($"{GetType().Name}_Intercept_BeforeInvocation"); - invocation.Proceed(); - (invocation.TargetObject as ICanLogOnObject)?.Logs?.Add($"{GetType().Name}_Intercept_AfterInvocation"); - } - } -} \ No newline at end of file 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 820a62892e..7e1dd24ae6 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 @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; @@ -239,51 +240,47 @@ namespace Volo.Abp.Domain.Repositories public class MyTestDefaultRepository : RepositoryBase where TEntity : class, IEntity { - public override TEntity Insert(TEntity entity, bool autoSave = false) - { - throw new NotImplementedException(); - } - public override TEntity Update(TEntity entity, bool autoSave = false) + protected override IQueryable GetQueryable() { throw new NotImplementedException(); } - public override void Delete(TEntity entity, bool autoSave = false) + public override Task DeleteAsync(Expression> predicate, bool autoSave = false, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } - public override List GetList(bool includeDetails = false) + public override Task InsertAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } - public override long GetCount() + public override Task UpdateAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } - protected override IQueryable GetQueryable() + public override Task DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } - } - public class MyTestDefaultRepository : MyTestDefaultRepository, IRepository - where TEntity : class, IEntity - { - public TEntity Get(TKey id, bool includeDetails = true) + public override Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } - public Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) + public override Task GetCountAsync(CancellationToken cancellationToken = default) { throw new NotImplementedException(); } + } - public TEntity Find(TKey id, bool includeDetails = true) + public class MyTestDefaultRepository : MyTestDefaultRepository, IRepository + where TEntity : class, IEntity + { + public Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } @@ -293,11 +290,6 @@ namespace Volo.Abp.Domain.Repositories throw new NotImplementedException(); } - public void Delete(TKey id, bool autoSave = false) - { - throw new NotImplementedException(); - } - public Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) { throw new NotImplementedException(); diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/AbpEfCoreTestSecondContextModule.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/AbpEfCoreTestSecondContextModule.cs index 02142f06d9..80ece93c07 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/AbpEfCoreTestSecondContextModule.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/AbpEfCoreTestSecondContextModule.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore.TestApp.ThirdDbContext; using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Abp.EntityFrameworkCore.TestApp.SecondContext { @@ -29,9 +30,9 @@ namespace Volo.Abp.EntityFrameworkCore.TestApp.SecondContext { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(() => scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondContextTestDataBuilder.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondContextTestDataBuilder.cs index 0b89576f34..c65cd8d7f4 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondContextTestDataBuilder.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondContextTestDataBuilder.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories; using Volo.Abp.Guids; @@ -16,9 +17,9 @@ namespace Volo.Abp.EntityFrameworkCore.TestApp.SecondContext _guidGenerator = guidGenerator; } - public void Build() + public async Task BuildAsync() { - _bookRepository.Insert( + await _bookRepository.InsertAsync( new BookInSecondDbContext( _guidGenerator.Create(), "TestBook1" diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DbContext_Replace_Tests.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DbContext_Replace_Tests.cs index 8ada582fa6..7bc4af2e31 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DbContext_Replace_Tests.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DbContext_Replace_Tests.cs @@ -1,9 +1,11 @@ using System; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Shouldly; using Volo.Abp.Domain.Repositories; using Volo.Abp.EntityFrameworkCore.TestApp.ThirdDbContext; using Volo.Abp.TestApp.EntityFrameworkCore; +using Volo.Abp.Uow; using Xunit; namespace Volo.Abp.EntityFrameworkCore @@ -11,19 +13,26 @@ namespace Volo.Abp.EntityFrameworkCore public class DbContext_Replace_Tests : EntityFrameworkCoreTestBase { private readonly IBasicRepository _dummyRepository; + private readonly IUnitOfWorkManager _unitOfWorkManager; public DbContext_Replace_Tests() { _dummyRepository = ServiceProvider.GetRequiredService>(); + _unitOfWorkManager = ServiceProvider.GetRequiredService(); } [Fact] - public void Should_Replace_DbContext() + public async Task Should_Replace_DbContext() { (ServiceProvider.GetRequiredService() is TestAppDbContext).ShouldBeTrue(); - (_dummyRepository.GetDbContext() is IThirdDbContext).ShouldBeTrue(); - (_dummyRepository.GetDbContext() is TestAppDbContext).ShouldBeTrue(); + using (_unitOfWorkManager.Begin()) + { + (_dummyRepository.GetDbContext() is IThirdDbContext).ShouldBeTrue(); + (_dummyRepository.GetDbContext() is TestAppDbContext).ShouldBeTrue(); + + await _unitOfWorkManager.Current.CompleteAsync(); + } } } } diff --git a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/ClassFeatureTestService.cs b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/ClassFeatureTestService.cs index 425f69337f..13dd19da19 100644 --- a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/ClassFeatureTestService.cs +++ b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/ClassFeatureTestService.cs @@ -1,4 +1,5 @@ -using Volo.Abp.DependencyInjection; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; namespace Volo.Abp.Features { @@ -10,14 +11,14 @@ namespace Volo.Abp.Features */ [RequiresFeature("BooleanTestFeature2")] - public virtual int Feature2() + public virtual Task Feature2Async() { - return 42; + return Task.FromResult(42); } - public virtual void NoAdditionalFeature() + public virtual Task NoAdditionalFeatureAsync() { - + return Task.CompletedTask; } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureInterceptor_Tests.cs b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureInterceptor_Tests.cs index 159e2ff241..bdc17a1d5f 100644 --- a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureInterceptor_Tests.cs +++ b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureInterceptor_Tests.cs @@ -27,14 +27,14 @@ namespace Volo.Abp.Features { using (_currentTenant.Change(ParseNullableGuid(tenantIdValue))) { - Assert.Throws(() => + await Assert.ThrowsAsync(async () => { - _classFeatureTestService.NoAdditionalFeature(); + await _classFeatureTestService.NoAdditionalFeatureAsync(); }); - Assert.Throws(() => + await Assert.ThrowsAsync(async () => { - _classFeatureTestService.Feature2(); + await _classFeatureTestService.Feature2Async(); }); await Assert.ThrowsAsync(async () => @@ -50,8 +50,8 @@ namespace Volo.Abp.Features //Features were enabled for Tenant 1 using (_currentTenant.Change(TestFeatureStore.Tenant1Id)) { - _classFeatureTestService.NoAdditionalFeature(); - _classFeatureTestService.Feature2().ShouldBe(42); + await _classFeatureTestService.NoAdditionalFeatureAsync(); + (await _classFeatureTestService.Feature2Async()).ShouldBe(42); (await _methodFeatureTestService.Feature1Async()).ShouldBe(42); } } diff --git a/framework/test/Volo.Abp.FluentValidation.Tests/Volo/Abp/FluentValidation/ApplicationService_FluentValidation_Tests.cs b/framework/test/Volo.Abp.FluentValidation.Tests/Volo/Abp/FluentValidation/ApplicationService_FluentValidation_Tests.cs index 0cde05efd4..3bc4851bb8 100644 --- a/framework/test/Volo.Abp.FluentValidation.Tests/Volo/Abp/FluentValidation/ApplicationService_FluentValidation_Tests.cs +++ b/framework/test/Volo.Abp.FluentValidation.Tests/Volo/Abp/FluentValidation/ApplicationService_FluentValidation_Tests.cs @@ -27,21 +27,6 @@ namespace Volo.Abp.FluentValidation [Fact] public async Task Should_Work_Proper_With_Right_Inputs() { - // MyStringValue should be aaa, MyStringValue2 should be bbb. MyStringValue3 should be ccc - var output = _myAppService.MyMethod(new MyMethodInput - { - MyStringValue = "aaa", - MyMethodInput2 = new MyMethodInput2 - { - MyStringValue2 = "bbb" - }, - MyMethodInput3 = new MyMethodInput3 - { - MyStringValue3 = "ccc" - } - }); - output.ShouldBe("aaabbbccc"); - var asyncOutput = await _myAppService.MyMethodAsync(new MyMethodInput { MyStringValue = "aaa", @@ -63,19 +48,6 @@ namespace Volo.Abp.FluentValidation { // MyStringValue should be aaa, MyStringValue2 should be bbb. MyStringValue3 should be ccc - Assert.Throws(() => _myAppService.MyMethod(new MyMethodInput - { - MyStringValue = "a", - MyMethodInput2 = new MyMethodInput2 - { - MyStringValue2 = "b" - }, - MyMethodInput3 = new MyMethodInput3 - { - MyStringValue3 = "c" - } - })); - await Assert.ThrowsAsync(async () => await _myAppService.MyMethodAsync( new MyMethodInput { @@ -92,9 +64,9 @@ namespace Volo.Abp.FluentValidation } [Fact] - public void NotValidateMyMethod_Test() + public async Task NotValidateMyMethod_Test() { - var output = _myAppService.NotValidateMyMethod(new MyMethodInput4 + var output = await _myAppService.NotValidateMyMethod(new MyMethodInput4 { MyStringValue4 = "444" }); @@ -125,29 +97,22 @@ namespace Volo.Abp.FluentValidation public interface IMyAppService { - string MyMethod(MyMethodInput input); - Task MyMethodAsync(MyMethodInput input); - string NotValidateMyMethod(MyMethodInput4 input); + Task NotValidateMyMethod(MyMethodInput4 input); } public class MyAppService : IMyAppService, ITransientDependency { - public string MyMethod(MyMethodInput input) - { - return input.MyStringValue + input.MyMethodInput2.MyStringValue2 + input.MyMethodInput3.MyStringValue3; - } - public Task MyMethodAsync(MyMethodInput input) { return Task.FromResult(input.MyStringValue + input.MyMethodInput2.MyStringValue2 + input.MyMethodInput3.MyStringValue3); } - public string NotValidateMyMethod(MyMethodInput4 input) + public Task NotValidateMyMethod(MyMethodInput4 input) { - return input.MyStringValue4; + return Task.FromResult(input.MyStringValue4); } } diff --git a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/IRegularTestController.cs b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/IRegularTestController.cs index cd8c92c66d..0e7b9d9163 100644 --- a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/IRegularTestController.cs +++ b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/IRegularTestController.cs @@ -4,8 +4,6 @@ namespace Volo.Abp.Http.DynamicProxying { public interface IRegularTestController { - int IncrementValue(int value); - Task IncrementValueAsync(int value); Task GetException1Async(); diff --git a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs index 2df9ad62a1..0c75fc68ff 100644 --- a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs +++ b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs @@ -27,7 +27,7 @@ namespace Volo.Abp.Http.DynamicProxying [Fact] public async Task Get() { - var firstPerson = _personRepository.First(); + var firstPerson = (await _personRepository.GetListAsync()).First(); var person = await _peopleAppService.GetAsync(firstPerson.Id); person.ShouldNotBeNull(); @@ -46,11 +46,11 @@ namespace Volo.Abp.Http.DynamicProxying [Fact] public async Task Delete() { - var firstPerson = _personRepository.First(); + var firstPerson = (await _personRepository.GetListAsync()).First(); await _peopleAppService.DeleteAsync(firstPerson.Id); - firstPerson = _personRepository.FirstOrDefault(p => p.Id == firstPerson.Id); + firstPerson = (await _personRepository.GetListAsync()).FirstOrDefault(p => p.Id == firstPerson.Id); firstPerson.ShouldBeNull(); } @@ -70,7 +70,7 @@ namespace Volo.Abp.Http.DynamicProxying person.Id.ShouldNotBe(Guid.Empty); person.Name.ShouldBe(uniquePersonName); - var personInDb = _personRepository.FirstOrDefault(p => p.Name == uniquePersonName); + var personInDb = (await _personRepository.GetListAsync()).FirstOrDefault(p => p.Name == uniquePersonName); personInDb.ShouldNotBeNull(); personInDb.Id.ShouldBe(person.Id); } @@ -78,7 +78,7 @@ namespace Volo.Abp.Http.DynamicProxying [Fact] public async Task Update() { - var firstPerson = _personRepository.First(); + var firstPerson = (await _personRepository.GetListAsync()).First(); var uniquePersonName = Guid.NewGuid().ToString(); var person = await _peopleAppService.UpdateAsync( @@ -96,7 +96,7 @@ namespace Volo.Abp.Http.DynamicProxying person.Name.ShouldBe(uniquePersonName); person.Age.ShouldBe(firstPerson.Age); - var personInDb = _personRepository.FirstOrDefault(p => p.Id == firstPerson.Id); + var personInDb = (await _personRepository.GetListAsync()).FirstOrDefault(p => p.Id == firstPerson.Id); personInDb.ShouldNotBeNull(); personInDb.Id.ShouldBe(person.Id); personInDb.Name.ShouldBe(person.Name); diff --git a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs index 34f8c5820d..717b62701e 100644 --- a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs +++ b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs @@ -11,13 +11,6 @@ namespace Volo.Abp.Http.DynamicProxying //[ApiExplorerSettings(IgnoreApi = false)] //alternative public class RegularTestController : AbpController, IRegularTestController { - [HttpGet] - [Route("increment/{value}")] //full URL: .../api/regular-test-controller/increment/{value} - public int IncrementValue(int value) - { - return value + 1; - } - [HttpGet] [Route("increment")] public Task IncrementValueAsync(int value) diff --git a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs index 22d9354624..cabbac6775 100644 --- a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs +++ b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs @@ -17,12 +17,6 @@ namespace Volo.Abp.Http.DynamicProxying _controller = ServiceProvider.GetRequiredService(); } - [Fact] - public void IncrementValue() - { - _controller.IncrementValue(42).ShouldBe(43); - } - [Fact] public async Task IncrementValueAsync() { 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 72774be545..5cc7737e4a 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 @@ -14,9 +14,11 @@ namespace Volo.Abp.MongoDB.Repositories [Fact] public void Linq_Queries() { - PersonRepository.FirstOrDefault(p => p.Name == "Douglas").ShouldNotBeNull(); - - PersonRepository.Count().ShouldBeGreaterThan(0); + WithUnitOfWork(() => + { + PersonRepository.FirstOrDefault(p => p.Name == "Douglas").ShouldNotBeNull(); + PersonRepository.Count().ShouldBeGreaterThan(0); + }); } [Fact] diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests_With_Int_Pk.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests_With_Int_Pk.cs index 58914e8e50..c5885dfb4d 100644 --- a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests_With_Int_Pk.cs +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests_With_Int_Pk.cs @@ -1,4 +1,5 @@ -using Volo.Abp.TestApp.Testing; +using System.Threading.Tasks; +using Volo.Abp.TestApp.Testing; using Xunit; namespace Volo.Abp.MongoDB.Repositories @@ -6,9 +7,9 @@ namespace Volo.Abp.MongoDB.Repositories public class Repository_Basic_Tests_With_Int_Pk : Repository_Basic_Tests_With_Int_Pk { [Fact(Skip = "Int PKs are not working for MongoDb")] - public override void Get() + public override Task Get() { - + return Task.CompletedTask; } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs index afe0f536d4..522f8d9794 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs @@ -13,7 +13,7 @@ namespace Volo.Abp.TestApp.Application { public class PeopleAppService : CrudAppService, IPeopleAppService { - public PeopleAppService(IRepository repository) + public PeopleAppService(IRepository repository) : base(repository) { @@ -36,7 +36,7 @@ namespace Volo.Abp.TestApp.Application var phone = new Phone(person.Id, phoneDto.Number, phoneDto.Type); person.Phones.Add(phone); - Repository.Update(person); + await Repository.UpdateAsync(person); return ObjectMapper.Map(phone); } @@ -44,7 +44,7 @@ namespace Volo.Abp.TestApp.Application { var person = await GetEntityByIdAsync(id); person.Phones.RemoveAll(p => p.Number == number); - Repository.Update(person); + await Repository.UpdateAsync(person); } [Authorize] diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs index b9aef1ca2e..683c99d417 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs @@ -6,6 +6,7 @@ using Volo.Abp.TestApp.Domain; using Volo.Abp.AutoMapper; using Volo.Abp.EventBus.Distributed; using Volo.Abp.TestApp.Application.Dto; +using Volo.Abp.Threading; namespace Volo.Abp.TestApp { @@ -54,9 +55,9 @@ namespace Volo.Abp.TestApp { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(() => scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestDataBuilder.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestDataBuilder.cs index 8900d8cfdf..a11ba60639 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestDataBuilder.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestDataBuilder.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories; using Volo.Abp.TestApp.Domain; @@ -29,53 +30,53 @@ namespace Volo.Abp.TestApp _entityWithIntPksRepository = entityWithIntPksRepository; } - public void Build() + public async Task BuildAsync() { - AddCities(); - AddPeople(); - AddEntitiesWithPks(); + await AddCities(); + await AddPeople(); + await AddEntitiesWithPks(); } - private void AddCities() + private async Task AddCities() { var istanbul = new City(IstanbulCityId, "Istanbul"); istanbul.Districts.Add(new District(istanbul.Id, "Bakirkoy", 1283999)); istanbul.Districts.Add(new District(istanbul.Id, "Mecidiyeky", 2222321)); istanbul.Districts.Add(new District(istanbul.Id, "Uskudar", 726172)); - _cityRepository.Insert(new City(Guid.NewGuid(), "Tokyo")); - _cityRepository.Insert(new City(Guid.NewGuid(), "Madrid")); - _cityRepository.Insert(new City(LondonCityId, "London") {ExtraProperties = { { "Population", 10_470_000 } } }); - _cityRepository.Insert(istanbul); - _cityRepository.Insert(new City(Guid.NewGuid(), "Paris")); - _cityRepository.Insert(new City(Guid.NewGuid(), "Washington")); - _cityRepository.Insert(new City(Guid.NewGuid(), "Sao Paulo")); - _cityRepository.Insert(new City(Guid.NewGuid(), "Berlin")); - _cityRepository.Insert(new City(Guid.NewGuid(), "Amsterdam")); - _cityRepository.Insert(new City(Guid.NewGuid(), "Beijing")); - _cityRepository.Insert(new City(Guid.NewGuid(), "Rome")); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Tokyo")); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Madrid")); + await _cityRepository.InsertAsync(new City(LondonCityId, "London") {ExtraProperties = { { "Population", 10_470_000 } } }); + await _cityRepository.InsertAsync(istanbul); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Paris")); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Washington")); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Sao Paulo")); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Berlin")); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Amsterdam")); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Beijing")); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Rome")); } - private void AddPeople() + private async Task AddPeople() { var douglas = new Person(UserDouglasId, "Douglas", 42, cityId: LondonCityId); douglas.Phones.Add(new Phone(douglas.Id, "123456789")); douglas.Phones.Add(new Phone(douglas.Id, "123456780", PhoneType.Home)); - _personRepository.Insert(douglas); + await _personRepository.InsertAsync(douglas); - _personRepository.Insert(new Person(UserJohnDeletedId, "John-Deleted", 33) { IsDeleted = true }); + await _personRepository.InsertAsync(new Person(UserJohnDeletedId, "John-Deleted", 33) { IsDeleted = true }); var tenant1Person1 = new Person(Guid.NewGuid(), TenantId1 + "-Person1", 42, TenantId1); var tenant1Person2 = new Person(Guid.NewGuid(), TenantId1 + "-Person2", 43, TenantId1); - _personRepository.Insert(tenant1Person1); - _personRepository.Insert(tenant1Person2); + await _personRepository.InsertAsync(tenant1Person1); + await _personRepository.InsertAsync(tenant1Person2); } - private void AddEntitiesWithPks() + private async Task AddEntitiesWithPks() { - _entityWithIntPksRepository.Insert(new EntityWithIntPk("Entity1")); + await _entityWithIntPksRepository.InsertAsync(new EntityWithIntPk("Entity1")); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs index 184b7698be..fe4e0862f3 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs @@ -28,7 +28,7 @@ namespace Volo.Abp.TestApp.Testing } [Fact] - public void Complex_Event_Test() + public async Task Complex_Event_Test() { var personName = Guid.NewGuid().ToString("N"); @@ -75,9 +75,9 @@ namespace Volo.Abp.TestApp.Testing return Task.CompletedTask; }); - PersonRepository.Insert(new Person(Guid.NewGuid(), personName, 15)); + await PersonRepository.InsertAsync(new Person(Guid.NewGuid(), personName, 15)); - uow.Complete(); + await uow.CompleteAsync(); } creatingEventTriggered.ShouldBeTrue(); diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs index f8a2f4e8e9..b9145dff56 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Threading.Tasks; using Shouldly; using Volo.Abp.Domain.Repositories; using Volo.Abp.Modularity; @@ -29,11 +30,11 @@ namespace Volo.Abp.TestApp.Testing } [Fact] - public virtual void Get() + public virtual async Task Get() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(async () => { - var entity = EntityWithIntPkRepository.Get(1); + var entity = await EntityWithIntPkRepository.GetAsync(1); entity.ShouldNotBeNull(); entity.Name.ShouldBe("Entity1"); }); diff --git a/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs b/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs index 8ff4aa8bfd..4035f2d371 100644 --- a/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs +++ b/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Shouldly; using Volo.Abp.Autofac; @@ -25,36 +26,37 @@ namespace Volo.Abp.Validation } [Fact] - public void Should_Work_Proper_With_Right_Inputs() + public async Task Should_Work_Proper_With_Right_Inputs() { - var output = _myAppService.MyMethod(new MyMethodInput { MyStringValue = "test" }); + var output = await _myAppService.MyMethod(new MyMethodInput { MyStringValue = "test" }); output.Result.ShouldBe(42); } [Fact] - public void Should_Not_Work_With_Wrong_Inputs() + public async Task Should_Not_Work_With_Wrong_Inputs() { - Assert.Throws(() => _myAppService.MyMethod(new MyMethodInput())); //MyStringValue is not supplied! - Assert.Throws(() => _myAppService.MyMethod(new MyMethodInput { MyStringValue = "a" })); //MyStringValue's min length should be 3! + await Assert.ThrowsAsync(async () => await _myAppService.MyMethod(new MyMethodInput())); //MyStringValue is not supplied! + await Assert.ThrowsAsync(async () => await _myAppService.MyMethod(new MyMethodInput { MyStringValue = "a" })); //MyStringValue's min length should be 3! } [Fact] - public void Should_Work_With_Right_Nesned_Inputs() + public async Task Should_Work_With_Right_Nesned_Inputs() { - var output = _myAppService.MyMethod2(new MyMethod2Input + var output = await _myAppService.MyMethod2(new MyMethod2Input { MyStringValue2 = "test 1", Input1 = new MyMethodInput { MyStringValue = "test 2" }, DateTimeValue = DateTime.Now }); + output.Result.ShouldBe(42); } [Fact] - public void Should_Not_Work_With_Wrong_Nesned_Inputs_1() + public async Task Should_Not_Work_With_Wrong_Nesned_Inputs_1() { - Assert.Throws(() => - _myAppService.MyMethod2(new MyMethod2Input + await Assert.ThrowsAsync(async () => + await _myAppService.MyMethod2(new MyMethod2Input { MyStringValue2 = "test 1", Input1 = new MyMethodInput() //MyStringValue is not set @@ -62,20 +64,20 @@ namespace Volo.Abp.Validation } [Fact] - public void Should_Not_Work_With_Wrong_Nesned_Inputs_2() + public async Task Should_Not_Work_With_Wrong_Nesned_Inputs_2() { - Assert.Throws(() => - _myAppService.MyMethod2(new MyMethod2Input //Input1 is not set + await Assert.ThrowsAsync(async () => + await _myAppService.MyMethod2(new MyMethod2Input //Input1 is not set { MyStringValue2 = "test 1" })); } [Fact] - public void Should_Not_Work_With_Wrong_List_Input_1() + public async Task Should_Not_Work_With_Wrong_List_Input_1() { - Assert.Throws(() => - _myAppService.MyMethod3( + await Assert.ThrowsAsync(async () => + await _myAppService.MyMethod3( new MyMethod3Input { MyStringValue2 = "test 1", @@ -87,10 +89,10 @@ namespace Volo.Abp.Validation } [Fact] - public void Should_Not_Work_With_Wrong_Array_Input_1() + public async Task Should_Not_Work_With_Wrong_Array_Input_1() { - Assert.Throws(() => - _myAppService.MyMethod3( + await Assert.ThrowsAsync(async () => + await _myAppService.MyMethod3( new MyMethod3Input { MyStringValue2 = "test 1", @@ -102,31 +104,31 @@ namespace Volo.Abp.Validation } [Fact] - public void Should_Not_Work_If_Array_Is_Null() + public async Task Should_Not_Work_If_Array_Is_Null() { - Assert.Throws(() => - _myAppService.MyMethod4(new MyMethod4Input()) //ArrayItems is null! + await Assert.ThrowsAsync(async () => + await _myAppService.MyMethod4(new MyMethod4Input()) //ArrayItems is null! ); } [Fact] - public void Should_Work_If_Array_Is_Null_But_DisabledValidation_For_Method() + public async Task Should_Work_If_Array_Is_Null_But_DisabledValidation_For_Method() { - _myAppService.MyMethod4_2(new MyMethod4Input()); + await _myAppService.MyMethod4_2(new MyMethod4Input()); } [Fact] - public void Should_Work_If_Array_Is_Null_But_DisabledValidation_For_Property() + public async Task Should_Work_If_Array_Is_Null_But_DisabledValidation_For_Property() { - _myAppService.MyMethod5(new MyMethod5Input()); + await _myAppService.MyMethod5(new MyMethod5Input()); } [Fact] - public void Should_Use_IValidatableObject() + public async Task Should_Use_IValidatableObject() { - Assert.Throws(() => + await Assert.ThrowsAsync(async () => { - _myAppService.MyMethod6(new MyMethod6Input + await _myAppService.MyMethod6(new MyMethod6Input { MyStringValue = "test value" //MyIntValue has not set! }); @@ -134,15 +136,15 @@ namespace Volo.Abp.Validation } [Fact] - public void Should_Stop_Recursive_Validation_In_A_Constant_Depth() + public async Task Should_Stop_Recursive_Validation_In_A_Constant_Depth() { - _myAppService.MyMethod8(new MyClassWithRecursiveReference { Value = "42" }).Result.ShouldBe(42); + (await _myAppService.MyMethod8(new MyClassWithRecursiveReference { Value = "42" })).Result.ShouldBe(42); } [Fact] - public void Should_Allow_Null_For_Nullable_Enums() + public async Task Should_Allow_Null_For_Nullable_Enums() { - _myAppService.MyMethodWithNullableEnum(null); + await _myAppService.MyMethodWithNullableEnum(null); } [Fact] @@ -184,63 +186,63 @@ namespace Volo.Abp.Validation public interface IMyAppService { - MyMethodOutput MyMethod(MyMethodInput input); - MyMethodOutput MyMethod2(MyMethod2Input input); - MyMethodOutput MyMethod3(MyMethod3Input input); - MyMethodOutput MyMethod4(MyMethod4Input input); - MyMethodOutput MyMethod4_2(MyMethod4Input input); - MyMethodOutput MyMethod5(MyMethod5Input input); - MyMethodOutput MyMethod6(MyMethod6Input input); - MyMethodOutput MyMethod8(MyClassWithRecursiveReference input); - void MyMethodWithNullableEnum(MyEnum? value); + Task MyMethod(MyMethodInput input); + Task MyMethod2(MyMethod2Input input); + Task MyMethod3(MyMethod3Input input); + Task MyMethod4(MyMethod4Input input); + Task MyMethod4_2(MyMethod4Input input); + Task MyMethod5(MyMethod5Input input); + Task MyMethod6(MyMethod6Input input); + Task MyMethod8(MyClassWithRecursiveReference input); + Task MyMethodWithNullableEnum(MyEnum? value); } public class MyAppService : IMyAppService, ITransientDependency { - public MyMethodOutput MyMethod(MyMethodInput input) + public Task MyMethod(MyMethodInput input) { - return new MyMethodOutput { Result = 42 }; + return Task.FromResult(new MyMethodOutput { Result = 42 }); } - public MyMethodOutput MyMethod2(MyMethod2Input input) + public Task MyMethod2(MyMethod2Input input) { - return new MyMethodOutput { Result = 42 }; + return Task.FromResult(new MyMethodOutput { Result = 42 }); } - public MyMethodOutput MyMethod3(MyMethod3Input input) + public Task MyMethod3(MyMethod3Input input) { - return new MyMethodOutput { Result = 42 }; + return Task.FromResult(new MyMethodOutput { Result = 42 }); } - public MyMethodOutput MyMethod4(MyMethod4Input input) + public Task MyMethod4(MyMethod4Input input) { - return new MyMethodOutput { Result = 42 }; + return Task.FromResult(new MyMethodOutput { Result = 42 }); } [DisableValidation] - public MyMethodOutput MyMethod4_2(MyMethod4Input input) + public Task MyMethod4_2(MyMethod4Input input) { - return new MyMethodOutput { Result = 42 }; + return Task.FromResult(new MyMethodOutput { Result = 42 }); } - public MyMethodOutput MyMethod5(MyMethod5Input input) + public Task MyMethod5(MyMethod5Input input) { - return new MyMethodOutput { Result = 42 }; + return Task.FromResult(new MyMethodOutput { Result = 42 }); } - public MyMethodOutput MyMethod6(MyMethod6Input input) + public Task MyMethod6(MyMethod6Input input) { - return new MyMethodOutput { Result = 42 }; + return Task.FromResult(new MyMethodOutput { Result = 42 }); } - public MyMethodOutput MyMethod8(MyClassWithRecursiveReference input) + public Task MyMethod8(MyClassWithRecursiveReference input) { - return new MyMethodOutput { Result = 42 }; + return Task.FromResult(new MyMethodOutput { Result = 42 }); } - public void MyMethodWithNullableEnum(MyEnum? value) + public Task MyMethodWithNullableEnum(MyEnum? value) { - + return Task.CompletedTask; } } From 0860f54e5ad4b4bdb7d10f87a57f3b33f880d5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 12:03:06 +0300 Subject: [PATCH 071/105] Remove CachedApplicationConfigurationClient.Get --- .../CachedApplicationConfigurationClient.cs | 27 ------------ .../ICachedApplicationConfigurationClient.cs | 2 - .../Client/RemoteLocalizationContributor.cs | 2 +- .../Abp/EntityFrameworkCore/AbpDbContext.cs | 42 +------------------ 4 files changed, 2 insertions(+), 71 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs index fc2ba3eb13..1fbb72bb3e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs @@ -31,33 +31,6 @@ namespace Volo.Abp.AspNetCore.Mvc.Client Cache = cache; } - public ApplicationConfigurationDto Get() - { - var cacheKey = CreateCacheKey(); - var httpContext = HttpContextAccessor?.HttpContext; - - if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration) - { - return configuration; - } - - configuration = Cache.GetOrAdd( - cacheKey, - () => AsyncHelper.RunSync(Proxy.Service.GetAsync), - () => new DistributedCacheEntryOptions - { - AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(120) //TODO: Should be configurable. Default value should be higher (5 mins would be good). - } - ); - - if (httpContext != null) - { - httpContext.Items[cacheKey] = configuration; - } - - return configuration; - } - public async Task GetAsync() { var cacheKey = CreateCacheKey(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/ICachedApplicationConfigurationClient.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/ICachedApplicationConfigurationClient.cs index 00f195166c..71d9d8cddf 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/ICachedApplicationConfigurationClient.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/ICachedApplicationConfigurationClient.cs @@ -5,8 +5,6 @@ namespace Volo.Abp.AspNetCore.Mvc.Client { public interface ICachedApplicationConfigurationClient { - ApplicationConfigurationDto Get(); - Task GetAsync(); } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLocalizationContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLocalizationContributor.cs index 4b92f1083f..d60256a501 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLocalizationContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLocalizationContributor.cs @@ -55,7 +55,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client private Dictionary GetResourceOrNull() { - var applicationConfigurationDto = _applicationConfigurationClient.Get(); + var applicationConfigurationDto = AsyncHelper.RunSync(() => _applicationConfigurationClient.GetAsync()); var resource = applicationConfigurationDto .Localization.Values 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 18758d98e3..bcd21149da 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs @@ -22,7 +22,6 @@ using Volo.Abp.EntityFrameworkCore.ValueConverters; using Volo.Abp.Guids; using Volo.Abp.MultiTenancy; using Volo.Abp.Reflection; -using Volo.Abp.Threading; using Volo.Abp.Timing; namespace Volo.Abp.EntityFrameworkCore @@ -92,46 +91,7 @@ namespace Volo.Abp.EntityFrameworkCore .Invoke(this, new object[] { modelBuilder, entityType }); } } - - public override int SaveChanges(bool acceptAllChangesOnSuccess) - { - //TODO: Reduce duplications with SaveChangesAsync - //TODO: Instead of adding entity changes to audit log, write them to uow and add to audit log only if uow succeed - - try - { - var auditLog = AuditingManager?.Current?.Log; - - List entityChangeList = null; - if (auditLog != null) - { - entityChangeList = EntityHistoryHelper.CreateChangeList(ChangeTracker.Entries().ToList()); - } - - var changeReport = ApplyAbpConcepts(); - - var result = base.SaveChanges(acceptAllChangesOnSuccess); - - AsyncHelper.RunSync(() => EntityChangeEventHelper.TriggerEventsAsync(changeReport)); - - if (auditLog != null) - { - EntityHistoryHelper.UpdateChangeList(entityChangeList); - auditLog.EntityChanges.AddRange(entityChangeList); - } - - return result; - } - catch (DbUpdateConcurrencyException ex) - { - throw new AbpDbConcurrencyException(ex.Message, ex); - } - finally - { - ChangeTracker.AutoDetectChangesEnabled = true; - } - } - + public override async Task SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default) { try From 0754254428a21c5e4f5c606106e4b9333ba72ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 12:54:48 +0300 Subject: [PATCH 072/105] Remove UnitOfWork Sync API. --- .../Volo/Abp/Uow/ChildUnitOfWork.cs | 15 ----- .../Volo.Abp.Uow/Volo/Abp/Uow/IUnitOfWork.cs | 6 -- .../Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs | 58 ------------------- .../Abp/AspNetCore/Mvc/Uow/TestUnitOfWork.cs | 6 -- .../Repository_Queryable_Tests.cs | 16 +++-- .../Repositories/Repository_Basic_Tests.cs | 5 +- .../Testing/MultiTenant_Filter_Tests.cs | 13 +++-- .../Repository_Basic_Tests_With_Int_Pk.cs | 5 +- .../Testing/Repository_Queryable_Tests.cs | 21 ++++--- .../Repository_Specifications_Tests.cs | 6 +- .../Testing/SoftDelete_Filter_Tests.cs | 16 +++-- .../Abp/TestApp/Testing/TestAppTestBase.cs | 40 ------------- .../Volo/Abp/Uow/UnitOfWork_Events_Tests.cs | 17 +++--- 13 files changed, 61 insertions(+), 163 deletions(-) diff --git a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/ChildUnitOfWork.cs b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/ChildUnitOfWork.cs index 0d2686cdfe..d1d90b6f6f 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/ChildUnitOfWork.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/ChildUnitOfWork.cs @@ -53,31 +53,16 @@ namespace Volo.Abp.Uow _parent.Reserve(reservationName); } - public void SaveChanges() - { - _parent.SaveChanges(); - } - public Task SaveChangesAsync(CancellationToken cancellationToken = default) { return _parent.SaveChangesAsync(cancellationToken); } - public void Complete() - { - - } - public Task CompleteAsync(CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public void Rollback() - { - _parent.Rollback(); - } - public Task RollbackAsync(CancellationToken cancellationToken = default) { return _parent.RollbackAsync(cancellationToken); diff --git a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/IUnitOfWork.cs b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/IUnitOfWork.cs index cf65ca69e7..32ef781133 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/IUnitOfWork.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/IUnitOfWork.cs @@ -32,16 +32,10 @@ namespace Volo.Abp.Uow void Reserve([NotNull] string reservationName); - void SaveChanges(); - Task SaveChangesAsync(CancellationToken cancellationToken = default); - void Complete(); - Task CompleteAsync(CancellationToken cancellationToken = default); - void Rollback(); - Task RollbackAsync(CancellationToken cancellationToken = default); void OnCompleted(Func handler); 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 5b857e8828..e7e86774b5 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs @@ -5,7 +5,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; -using Volo.Abp.Threading; namespace Volo.Abp.Uow { @@ -75,14 +74,6 @@ namespace Volo.Abp.Uow Outer = outer; } - public virtual void SaveChanges() - { - foreach (var databaseApi in GetAllActiveDatabaseApis()) - { - (databaseApi as ISupportsSavingChanges)?.SaveChanges(); - } - } - public virtual async Task SaveChangesAsync(CancellationToken cancellationToken = default) { foreach (var databaseApi in GetAllActiveDatabaseApis()) @@ -104,30 +95,6 @@ namespace Volo.Abp.Uow return _transactionApis.Values.ToImmutableList(); } - public virtual void Complete() - { - if (_isRolledback) - { - return; - } - - PreventMultipleComplete(); - - try - { - _isCompleting = true; - SaveChanges(); - CommitTransactions(); - IsCompleted = true; - OnCompleted(); - } - catch (Exception ex) - { - _exception = ex; - throw; - } - } - public virtual async Task CompleteAsync(CancellationToken cancellationToken = default) { if (_isRolledback) @@ -152,18 +119,6 @@ namespace Volo.Abp.Uow } } - public virtual void Rollback() - { - if (_isRolledback) - { - return; - } - - _isRolledback = true; - - RollbackAll(); - } - public virtual async Task RollbackAsync(CancellationToken cancellationToken = default) { if (_isRolledback) @@ -235,19 +190,6 @@ namespace Volo.Abp.Uow CompletedHandlers.Add(handler); } - public void OnFailed(Func handler) - { - throw new NotImplementedException(); - } - - protected virtual void OnCompleted() - { - foreach (var handler in CompletedHandlers) - { - AsyncHelper.RunSync(handler); - } - } - protected virtual async Task OnCompletedAsync() { foreach (var handler in CompletedHandlers) diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/TestUnitOfWork.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/TestUnitOfWork.cs index 079120e8d3..3b9ec55e75 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/TestUnitOfWork.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/TestUnitOfWork.cs @@ -19,12 +19,6 @@ namespace Volo.Abp.AspNetCore.Mvc.Uow _config = config; } - public override void Complete() - { - ThrowExceptionIfRequested(); - base.Complete(); - } - public override Task CompleteAsync(CancellationToken cancellationToken = default(CancellationToken)) { ThrowExceptionIfRequested(); diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Repositories/Repository_Queryable_Tests.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Repositories/Repository_Queryable_Tests.cs index bd4859784a..a5b8aa0577 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Repositories/Repository_Queryable_Tests.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Repositories/Repository_Queryable_Tests.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Shouldly; @@ -23,31 +24,34 @@ namespace Volo.Abp.EntityFrameworkCore.Repositories } [Fact] - public void GetBookList() + public async Task GetBookList() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { _bookRepository.Any().ShouldBeTrue(); + return Task.CompletedTask; }); } [Fact] - public void GetPhoneInSecondDbContextList() + public async Task GetPhoneInSecondDbContextList() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { _phoneInSecondDbContextRepository.Any().ShouldBeTrue(); + return Task.CompletedTask; }); } [Fact] - public void EfCore_Include_Extension() + public async Task EfCore_Include_Extension() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { var person = PersonRepository.Include(p => p.Phones).Single(p => p.Id == TestDataBuilder.UserDouglasId); person.Name.ShouldBe("Douglas"); person.Phones.Count.ShouldBe(2); + return Task.CompletedTask; }); } } 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 5cc7737e4a..efa64b3617 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 @@ -12,12 +12,13 @@ namespace Volo.Abp.MongoDB.Repositories public class Repository_Basic_Tests : Repository_Basic_Tests { [Fact] - public void Linq_Queries() + public async Task Linq_Queries() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { PersonRepository.FirstOrDefault(p => p.Name == "Douglas").ShouldNotBeNull(); PersonRepository.Count().ShouldBeGreaterThan(0); + return Task.CompletedTask; }); } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Filter_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Filter_Tests.cs index d763fdea5b..da3e33ffea 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Filter_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Filter_Tests.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using NSubstitute; using Shouldly; @@ -33,9 +34,9 @@ namespace Volo.Abp.TestApp.Testing } [Fact] - public void Should_Get_Person_For_Current_Tenant() + public async Task Should_Get_Person_For_Current_Tenant() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { //TenantId = null @@ -60,13 +61,15 @@ namespace Volo.Abp.TestApp.Testing people = _personRepository.ToList(); people.Count.ShouldBe(0); + + return Task.CompletedTask; }); } [Fact] - public void Should_Get_All_People_When_MultiTenant_Filter_Is_Disabled() + public async Task Should_Get_All_People_When_MultiTenant_Filter_Is_Disabled() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { List people; @@ -80,6 +83,8 @@ namespace Volo.Abp.TestApp.Testing //Filter re-enabled automatically people = _personRepository.ToList(); people.Count.ShouldBe(1); + + return Task.CompletedTask; }); } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs index b9145dff56..f873fe4265 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs @@ -19,13 +19,14 @@ namespace Volo.Abp.TestApp.Testing } [Fact] - public virtual void FirstOrDefault() + public virtual async Task FirstOrDefault() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { var entity = EntityWithIntPkRepository.FirstOrDefault(e => e.Name == "Entity1"); entity.ShouldNotBeNull(); entity.Name.ShouldBe("Entity1"); + return Task.CompletedTask; }); } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Queryable_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Queryable_Tests.cs index b7436f7bc5..6078236380 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Queryable_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Queryable_Tests.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Shouldly; using Volo.Abp.Domain.Repositories; @@ -20,43 +21,47 @@ namespace Volo.Abp.TestApp.Testing } [Fact] - public void Any() + public async Task Any() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { PersonRepository.Any().ShouldBeTrue(); + return Task.CompletedTask; }); } [Fact] - public void Single() + public async Task Single() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { var person = PersonRepository.Single(p => p.Id == TestDataBuilder.UserDouglasId); person.Name.ShouldBe("Douglas"); + return Task.CompletedTask; }); } [Fact] - public void WithDetails() + public async Task WithDetails() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { var person = PersonRepository.WithDetails().Single(p => p.Id == TestDataBuilder.UserDouglasId); person.Name.ShouldBe("Douglas"); person.Phones.Count.ShouldBe(2); + return Task.CompletedTask; }); } [Fact] - public void WithDetails_Explicit() + public async Task WithDetails_Explicit() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { var person = PersonRepository.WithDetails(p => p.Phones).Single(p => p.Id == TestDataBuilder.UserDouglasId); person.Name.ShouldBe("Douglas"); person.Phones.Count.ShouldBe(2); + return Task.CompletedTask; }); } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Specifications_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Specifications_Tests.cs index a3e7907135..c26134b27c 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Specifications_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Specifications_Tests.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Linq.Expressions; +using System.Threading.Tasks; using Shouldly; using Volo.Abp.Domain.Repositories; using Volo.Abp.Modularity; @@ -21,11 +22,12 @@ namespace Volo.Abp.TestApp.Testing } [Fact] - public void SpecificationWithRepository_Test() + public async Task SpecificationWithRepository_Test() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { CityRepository.Count(new CitySpecification().ToExpression()).ShouldBe(1); + return Task.CompletedTask; }); } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Filter_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Filter_Tests.cs index 891691114e..f3ac8c301f 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Filter_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Filter_Tests.cs @@ -23,12 +23,13 @@ namespace Volo.Abp.TestApp.Testing } [Fact] - public void Should_Not_Get_Deleted_Entities_Linq() + public async Task Should_Not_Get_Deleted_Entities_Linq() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { var person = PersonRepository.FirstOrDefault(p => p.Name == "John-Deleted"); person.ShouldBeNull(); + return Task.CompletedTask; }); } @@ -43,20 +44,21 @@ namespace Volo.Abp.TestApp.Testing } [Fact] - public void Should_Not_Get_Deleted_Entities_By_Default_ToList() + public async Task Should_Not_Get_Deleted_Entities_By_Default_ToList() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { var people = PersonRepository.ToList(); people.Count.ShouldBe(1); people.Any(p => p.Name == "Douglas").ShouldBeTrue(); + return Task.CompletedTask; }); } [Fact] - public void Should_Get_Deleted_Entities_When_Filter_Is_Disabled() + public async Task Should_Get_Deleted_Entities_When_Filter_Is_Disabled() { - WithUnitOfWork(() => + await WithUnitOfWorkAsync(() => { //Soft delete is enabled by default var people = PersonRepository.ToList(); @@ -88,6 +90,8 @@ namespace Volo.Abp.TestApp.Testing people = PersonRepository.ToList(); people.Any(p => !p.IsDeleted).ShouldBeTrue(); people.Any(p => p.IsDeleted).ShouldBeFalse(); + + return Task.CompletedTask; }); } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/TestAppTestBase.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/TestAppTestBase.cs index 647e5eaa03..9f7ef1b34b 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/TestAppTestBase.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/TestAppTestBase.cs @@ -16,26 +16,6 @@ namespace Volo.Abp.TestApp.Testing #region WithUnitOfWork - protected virtual void WithUnitOfWork(Action action) - { - WithUnitOfWork(new AbpUnitOfWorkOptions(), action); - } - - protected virtual void WithUnitOfWork(AbpUnitOfWorkOptions options, Action action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - action(); - - uow.Complete(); - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); @@ -56,26 +36,6 @@ namespace Volo.Abp.TestApp.Testing } } - protected virtual TResult WithUnitOfWork(Func func) - { - return WithUnitOfWork(new AbpUnitOfWorkOptions(), func); - } - - protected virtual TResult WithUnitOfWork(AbpUnitOfWorkOptions options, Func func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = func(); - uow.Complete(); - return result; - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func> func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); diff --git a/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs b/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs index 4d9bfc8dd6..0da84a04a9 100644 --- a/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs +++ b/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Shouldly; using Xunit; @@ -15,7 +16,7 @@ namespace Volo.Abp.Uow } [Fact] - public void Should_Trigger_Complete_On_Success() + public async Task Should_Trigger_Complete_On_Success() { var completed = false; var disposed = false; @@ -25,7 +26,7 @@ namespace Volo.Abp.Uow uow.OnCompleted(async () => completed = true); uow.Disposed += (sender, args) => disposed = true; - uow.Complete(); + await uow.CompleteAsync(); completed.ShouldBeTrue(); } @@ -34,7 +35,7 @@ namespace Volo.Abp.Uow } [Fact] - public void Should_Trigger_Complete_On_Success_In_Child_Uow() + public async Task Should_Trigger_Complete_On_Success_In_Child_Uow() { var completed = false; var disposed = false; @@ -46,7 +47,7 @@ namespace Volo.Abp.Uow childUow.OnCompleted(async () => completed = true); uow.Disposed += (sender, args) => disposed = true; - childUow.Complete(); + await childUow.CompleteAsync(); completed.ShouldBeFalse(); //Parent has not been completed yet! disposed.ShouldBeFalse(); @@ -55,7 +56,7 @@ namespace Volo.Abp.Uow completed.ShouldBeFalse(); //Parent has not been completed yet! disposed.ShouldBeFalse(); - uow.Complete(); + await uow.CompleteAsync(); completed.ShouldBeTrue(); //It's completed now! disposed.ShouldBeFalse(); //But not disposed yet! @@ -110,7 +111,7 @@ namespace Volo.Abp.Uow [InlineData(true)] [InlineData(false)] [Theory] - public void Should_Trigger_Failed_If_Rolled_Back(bool callComplete) + public async Task Should_Trigger_Failed_If_Rolled_Back(bool callComplete) { var completed = false; var failed = false; @@ -122,11 +123,11 @@ namespace Volo.Abp.Uow uow.Failed += (sender, args) => { failed = true; args.IsRolledback.ShouldBeTrue(); }; uow.Disposed += (sender, args) => disposed = true; - uow.Rollback(); + await uow.RollbackAsync(); if (callComplete) { - uow.Complete(); + await uow.CompleteAsync(); } } From c4b2d2b48cfe63eb300473e267c764c5ae7da685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 13:09:18 +0300 Subject: [PATCH 073/105] Remove reflection for ExecuteWithoutReturnValueAsync --- .../CastleAbpInterceptorAdapter.cs | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs index c8ba229979..00dc33a59a 100644 --- a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs @@ -9,13 +9,6 @@ namespace Volo.Abp.Castle.DynamicProxy public class CastleAbpInterceptorAdapter : IInterceptor where TInterceptor : IAbpInterceptor { - private static readonly MethodInfo MethodExecuteWithoutReturnValueAsync = - typeof(CastleAbpInterceptorAdapter) - .GetMethod( - nameof(ExecuteWithoutReturnValueAsync), - BindingFlags.NonPublic | BindingFlags.Instance - ); - private static readonly MethodInfo MethodExecuteWithReturnValueAsync = typeof(CastleAbpInterceptorAdapter) .GetMethod( @@ -36,22 +29,20 @@ namespace Volo.Abp.Castle.DynamicProxy var method = invocation.MethodInvocationTarget ?? invocation.Method; - if (method.IsAsync()) - { - InterceptAsyncMethod(invocation, proceedInfo); - } - else + if (!method.IsAsync()) { proceedInfo.Invoke(); + return; } + + InterceptAsyncMethod(invocation, proceedInfo); } private void InterceptAsyncMethod(IInvocation invocation, IInvocationProceedInfo proceedInfo) { if (invocation.Method.ReturnType == typeof(Task)) { - invocation.ReturnValue = MethodExecuteWithoutReturnValueAsync - .Invoke(this, new object[] { invocation, proceedInfo }); + invocation.ReturnValue = ExecuteWithoutReturnValueAsync(invocation, proceedInfo); } else { @@ -63,8 +54,6 @@ namespace Volo.Abp.Castle.DynamicProxy private async Task ExecuteWithoutReturnValueAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo) { - await Task.Yield(); - await _abpInterceptor.InterceptAsync( new CastleAbpMethodInvocationAdapter(invocation, proceedInfo) ); From 0d01fbfcb468bed4179a959933f058c5a3e7741f Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 24 Dec 2019 14:53:56 +0300 Subject: [PATCH 074/105] Docs documentation Introduce section future. resolves https://github.com/abpframework/abp/issues/2456 --- docs/en/Modules/Docs.md | 93 ++++++++++++++++++++++++++++- docs/en/images/docs-section-ui.png | Bin 0 -> 9624 bytes 2 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 docs/en/images/docs-section-ui.png diff --git a/docs/en/Modules/Docs.md b/docs/en/Modules/Docs.md index ac85978740..0a74d7ebde 100644 --- a/docs/en/Modules/Docs.md +++ b/docs/en/Modules/Docs.md @@ -408,12 +408,101 @@ public class Person ``` ~~~ - - As an example you can see ABP Framework documentation: [https://github.com/abpframework/abp/blob/master/docs/en/](https://github.com/abpframework/abp/blob/master/docs/en/) +#### Conditional sections feature (Using Scriban) + +Docs module uses [Scriban]( ) for conditionally show or hide some parts of a document. In order to use that feature, you have to create a JSON file as **Parameter document** per every language. It will contain all the key-values, as well as their display names. + +For example, [en/docs-params.json](https://github.com/abpio/abp-commercial-docs/blob/master/en/docs-params.json): + +```json +{ + "parameters": [{ + "name": "UI", + "displayName": "UI", + "values": { + "MVC": "MVC / Razor Pages", + "NG": "Angular" + } + }, + { + "name": "DB", + "displayName": "Database", + "values": { + "EF": "Entity Framework Core", + "Mongo": "MongoDB" + } + }, + { + "name": "Tiered", + "displayName": "Tiered", + "values": { + "No": "Not Tiered", + "Yes": "Tiered" + } + }] +} +``` + +Since not every single document in your projects may not have sections or may not need all of those parameters, you have to declare which of those parameters will be used for sectioning the document, as a JSON block anywhere on the document. + +For example [Getting-Started.md](https://github.com/abpio/abp-commercial-docs/blob/master/en/Getting-Started.md): + +``` +..... + +​````json +//[doc-params] +{ + "UI": ["MVC","NG"], + "DB": ["EF", "Mongo"], + "Tiered": ["Yes", "No"] +} +​```` + +........ +``` + +This section will be automatically deleted during render. And f course, those key values must match with the ones in **Parameter document**. + +![Interface](..\images\docs-section-ui.png) + +Now you can use **Scriban** syntax to create sections in your document. + +For example: + +```` +{{ if UI == "NG" }} + +* `-u` argument specifies the UI framework, `angular` in this case. + +{{ end }} + +{{ if DB == "Mongo" }} + +* `-d` argument specifies the database provider, `mongodb` in this case. + +{{ end }} + +{{ if Tiered == "Yes" }} + +* `--tiered` argument is used to create N-tiered solution where authentication server, UI and API layers are physically separated. + +{{ end }} + +```` + +You can also use variables in a text, adding **_Value** postfix to its key: + +```` +This document assumes that you prefer to use **{{ UI_Value }}** as the UI framework and **{{ DB_Value }}** as the database provider. +```` + +**IMPORTANT NOTICE**: Scriban uses "{{" and "}}" for syntax. Therefore, you must use escape blocks if you are going to use those in your document (an Angular document, for example). See [Scriban docs]( ) for more information. + ### 8- Creating the Navigation Document Navigation document is the main menu of the documents page. It is located on the left side of the page. It is a `JSON` file. Take a look at the below sample navigation document to understand the structure. diff --git a/docs/en/images/docs-section-ui.png b/docs/en/images/docs-section-ui.png new file mode 100644 index 0000000000000000000000000000000000000000..7856454e5d0ad9723cadeff680477aa0fe9d87e8 GIT binary patch literal 9624 zcmdUVcTiK^*Dkgf6lp4g(nOIWy%#CcMXD4dH80Yn*U$+Tlq$VQ2SGXsgc1l4lpadx zH54fk2%$sh@EyM2+?o6Dy)$?2d@~ID>{Hj?>)Fq<*2)go(^03o_3#!M85xzvOBH=G zvg;ziaXQ6S;6GampAs3_BQgyYMMK|=^_hUTMn>m{+h6?2V%(^^uHd78a26@2r3`eN z+83-uo$L2Jbb45vicV_Aj65tXU~Mi~-8}g&*LP1V+FLci@+qTupUI3vI`nJCkDyF%o{iXQ^;OCZz2$w zYGBuZ;}523>YkoeW01=WZklVkkQxovo_vV(P zRXXS&U^p+hejMBzJb&Cau)(|Y-o?db^!Bo&isF}*MIJ9XT=A>Rk;{B3a9ntm7k1O> zpeuh=!|Y2^8wYUu7r)}T!QS@0FG=g@A8$gRj;X!71DyWzCUbk2&Hu06{UNuR@$~e*Lag(}j^4(gs5po~71Y@IjZr9gYNd|dQchM@tc($`@k8{| z;Pmu#$paDe-2!>%ig%7di`liy`L@i}7vn9fR?z3cKW1@NRBtXp^XKndSlH@koDcmJ zhr96_)3`InjWL0OU0;+MhKsi>cQw?NHPaLEAAFeJ+nhh|+pf=R(HLUkcpJVgW20h3m>JZQG41H0%<_;|wiQgic-t0&3!wr_FiyO;& zS5zHQ)2mm>KImwsbHLzzUmk$jK(pr?g8>ZFlKwbQ==t(la}N)2wmD!aC!n*P+eWQj zh52|(mAwti?CC!Fvyee2c{mgDDDmoy8emb6YaxG-FX4k;!WhKJ_{?H!0IKX~TWJrfoVyI1^73R5TD z2{)l=e+BSaGU&d~($q{oEZ^Th$ZEJDdp#JB33)9{r$q5{2ir}_j+Tv`6a4k4|0Nk& zj`n-Enk7WdxvQ}{%%TCNCHx@BpG2g4xKgN9@4tRLhln<-9rFp?|Bwzc^R_2$aX+Q5 z_c7CA>fm^9x=*E@Qoeuw4{oCM%K}0ZupI{nus;1stj^?JaTz~P!=3?^Kj~2DEWP(L zR}2(fBJf7v8>4T$R(jxVmzr(EGPyMiQVMGe@s$oKyUhhMuN9c7IGZ?F{z5DGv@cQl z&;f8CoOAQO(zF8fd(3PP6xA0647a}#UEZtDUl_x9uY^_K2!4P^4&T{0nq*?LNj5G4 zze@A#FZzw(Y$gBVWF`SlRxs0xuRgxUu2O-ivp@QDC6_b(fz5pP!&0-=^Cw>pV%TaO zFxMnzrZvSu_nRB>!1t5zMGUan>oyG|qp{QsiNvm6CV6h_)&MXDZ#ecAe~0K(M*9PR z8KgU_-axI}($=P%0nEmrluw*M0$<3RODXYrxlnefU7RYh?{(-dRhorZ@5UW}(`Y=ozBdt<=KTWN?QtJp@(G0{m|*znmAW3xOn!{$`h%Wh=1sfL z=C~_dJpPlYFMhK4+ZJ}xNkh4{d*r4ID|@?BqMn!uXHM-_d|cR^nr2gVlmAWYzI^!Y z4c>zf8KC0bCS4aTtuV02fx!Oj`3jce7%>RT$T!U<`v}z60wdQT0p5apZgtWUk$04e zc#EA7eLAMezH?v8!F`z`L&kn5Ph_PAR-C~2Y=P1miSN3ZRY%-OnNQ}TSy;sb-esU_ zP?OVSWGgyi6q?T*%MkEKR4fBv(t08`!O*rCR#r((;q3Pj92gWx+$vILLvsf(-d*@H z3dU`2Vl$uHECFC0mz2nqw+j&bC^M<%O=Y z6fwX8NHN#2QDbi-B+3Dw4f3B~IshsBeXOwjS+2g@C9!9lG!g{Thw%j(IQ*5%`v)}k z_5kXsq{Al@JlKw%PPKx%`FXrkYMibN4zwFj)z^$HR-Da3jq3KTGW@F-UpF#n3vr$) z7|}BB2iOVDu{l-egszIQvWqr$soR=s2bN!zSzrhSM$oz=p$V_phlIPjpc%K@wg+VE3wocr&Q`^Txgum1Z z0~IJ#xkV675041TIuGjS%(z1)_M6q0wOM#h9zfB@H<9WMMc)St4;B@&|Ew2NQj2v^ z-Mn-|Hr#@wX`Mt$r^KtUt2lX8#LSkK{V&tDY7V*>?96qV;9YMPliv%dTi!N2<`8W9b3?I4_Lb8 z-s+jh5T8vz>!;Jvk3af4-2rj}-fd`pZvPW7PjOyR1RHl&55Q!2na@)3ymIh2;@3!} za?*>J#)-5GW_~}Xxhk)H9t8<4d9Y?m>!53jjQ}(f}s*&c68j z_H|2@D<)tqNxq0y35wXs(U+2C-J$FWq1{oYEAJ<-nhUvKI=CPoH)A8c38+d2ONPKy zoZGAuo>BoEWcc#KnF!cVM6nhPO#WbHoO-h$q*5BjFv@ARSqeCV6n6@&kKo{1GuAu6 zHI{pVrJ?*ADOo=YEQ4Vr;^)@gW7nR8!1(Xbq zwFNAC`eq@t!y8e~M$rw91li<&6JApYKN{KVOBFyCNA2UC&3bZ*iXF)gdG8(r z3ll%fB{^jmZ8Y{aXn%IrLIzR}yhjEny0Q6Ud$9{8^2x&3Y9=^;3%KpsjSV&htyO=S z=d8dzBub&``Enj?Np4xoSA?NDTl~Jzy!JjQ2m;s^D{anSjcm7=wwS7BMyg<3L zzNN_SQMNspx`^iIPWGXoVDGpcc}u9eT`-?wd#?op%xG8 zDIIou!%@_n!0_+Z?jUkv*)5y+d&0+gbe!DfYhd)iNhw>xk*HvECTAfHh4{~=?Zn=q zxO!b@1Zpfkz*Mdsrzt5`a?ztvWtJa-A(jC!MJRBEP*Cn5H+`mj0`UpciM?z;;bnUl zBWKWbvLQ7`pB#_k?zx-`g@b4l)ccZF#@5O0M(%%^judn32zFTS3>S3v0~&x<@NHp#(7@F)yZ-cYiy$ilhYrO_ zjhao~uGwGFy|TuSnk%%ZQ9ZJyfJlod6``DF64Q7(MY!5j3yBk4cZEs>Ob^(2_9RzI z9oMXabur86E&d1haB0{};&We?5Y-xu9E+0?3 zPO1DA=4J`OH^?6X*aNgG$(4p7G0;>`R;btB%)0p+(Bp&pMfQc(@h`@T;P<38AHSw}pgyy#wsY{s+Swrw7V(BV6~7e!WX|Ua6?ZfVJnj z49Li4q9mG4MTGd=@Ky&G^SasKGStw7*S_`Ojs4(jr^jW1#Pg4qA0?X~1Ej5Lvu++! z&Y&PKi7B9bYS3u?5eWC5UZ~sl^QN+QGm?tFhk>%ReBJyIA~XG0 zrT(csP`|k$DqNBnf4bun>KJk${s!WZr20E|7dBZKo@5gwF0+=W6U-dclD}~V%czI2 z155}mZ|=;gnaIW)I`BbnIA`k-Uc;>W2cW^7^t(eWXK1gp0PwA4XGi5=2eC~sPeoCPR%N)ugfgTM>qn{j&lm%lt~iU^Ne-tnCzGOQ8ST1_5s%Jp{m6; zjV>Md>kuv`#J5$>z z)MGL-ug4}|pDKm1va+&&gaUsF>W-##Wbb{t;lkb4O68^3F4JV2I}De}Ar^iuzD~^d zzdK|_|3}HKJ;^g-U%O9xJnakZxamOyPx%tNN`nAfo%kMsT~=1spG0fXBx{yJ%qf_; zxwl0t=O0!&UJWC6^E8=6eWC3$FNO?L{o?OE8=KL1e>ZtVQe4u^aU)Drwd(twK6>^X zs*LjccBN@dFo_1K28h}4#&wuvxxespJgV^whNdOlGKr z^S%Q}w&n`5)-8|XV7KnC$M?hnDlgS}HM))Q#VH8L=KahI(4N)W#=~+@dPTk?k%{br zXPP@L-JA+JQ2kNh8E|Ya@vn*GfNIU*%#0skmsi|(st@I*0;Yo6Oe-khc^^Cq;={^e zc3J%SzpDf6523E={M?cCl*ka-4{kS(v-aM{VlJY-bG%kw6DTPqK zt?C``sqY^jzy+OlYw`orGSkj=@#`b*m4H=SJ0tbqf2wvL&2y#Ss~&f@yofl~+It$s-G{Kfpask8aa8 zNzD-FXxxO`w$+SY9jx){_3<98*&0Ov^)?OaIDZ+iMGssYLgE(}aNn_xRf zc(0y@{UNi%8_4%juZ@FJe@5!3nMOVxmCOD9(qJQ-0jKMV6ZdA{$hOZNyHXy2Y1GjC ztL^aK3GqP2sr5sCQ@hGP)_8h`d!{B373rv3oE@rSc1_&Gv~|E^3*^=1)F&G*t{m>t z6~JUTDktoa{)8h+rjE%wR4LiD)Xws8Pli1ylP>OG=$RXtD)4nDS_x?A^gQ3gT6Nd+ zaSrYM$!82Lm5K$+xGv~1uy+!-KVQ4u#9LD4T&3X>7B1G5=nI-Z>ZUe*B9m)x^^Xpd z=)gIo!9>J$DDUQ75w!f&l{F>Mc!?Y;&Y#0ZjYM1+I~Gsc%7YP`aMx-C^M32>}!EC zSI>f#@=RI$&nf?9SER3&#iFoZ-;dF3z?CBgvYha6lfyTPm8ukRRsyd%VOm&y+w6J| zTmcLD=v@{W2r0g77Pz_R%k&YBzdQLECAj){SNl12NebN1))Qr{Go9g53%-iFZj<=) zNvP>p)zB>2brM`E~w{G(1kyoro$E3oQ7oOb1aUC5jyjB!jeI$)-g z9IzWBoYKWoph@*IasAV~iBI;W#OlGZE6)Qn_F+xHb(&NBX}Q=~$(GLH~nH%Ew+ zg>@<;gJp3oXCb~k;9W#b?y8gDx7+q6URx^05NBoU;Jio?rdoV7BO^!XwHOBDF*#vX zn9CR?&gRyn!bSDlCfXmzh*4Y>$Xt0bOF?cKU#tnhWadIj#OuXYq^2!7 zNt|2544^HpDCV7o_(>7a(%O?b%xZw=?zNMLq;s2}w2$$_#DgJ{V5;P5OZ&rP53+U{y`zGJi$E7JhQPV8vVsP|+b32B_ngUNUtse^td=#+w z#4&-hhm)C&2_<2_6T5|eH5Pj3=7g4DjhRkAeHTPK_O|%_fR@j4mOLBw*}~J!lq;p z!g@Bp4)@sF6jrZ4J~ZVLJ6k$lqRz!<(ZDM&VHk9XX_e=(%s)M!$#8*^`r!Im!GBtf zJOL{t-5f((y*W<)A*d0y!hp-OC(dzBjXRvlJ}Lc9!!sWQ)ON>aIO|LnepPTA7&!-R z(*Vj>{s1UCFgu8xdl_WP#H{(oJ(Xz#L*p8Bqe;@eBjK`K$N8Nh}Ysu+YV(FV@ zWBhkbZ1Q*)^aVg)n&Cbe&!Sn)ltdwYj2flTo=%2*i=~bHR6t|@*_s?DJhk#&dSl@m zOxQrcYQZesQ^DLKb#5C}N``q8IY7vb;mR~iDYw}9Mj;~CoZqXw2$*C2EO9XX*{bHD z%l6JlU#5&n$Fj(mU{H zh4x}m^?v#@jZUl~U-0uPBS}Pq#d!-)rN?W+p>`J6s75{VDwQdcw#8UkbZ_-?Pz*K^ zuXvTNo_(dJxUb~vM_^4A|2IEC>>Cr+D0{KFfIYv*rR#3TPmCR z(d&PVlj!0;z3W+HW1Bcu`oyeP`9S6N&M6|T1P}q4N9o061qxs~7i6)aT z;FuwAy=Owq?ZnG(zx7i``^1KGQ;L9W7cI+ztLThnYs$EsHHQ#KqpMd~u)m9CY_jok#dBZ;RyrDXvgl-GjM zubUzPYMCJxlL@?+ik}*oSgOdyeBDI#9z{Hxys}a;g=JOn1sHo&I^@eTZ|mpV-MK#w z#*U7BQ$WU6k6qp9sc~`I4?@+6z^6*4{3q+kR8!D8k0G-a92^6J@SLLDN)2hMOn4EY zqNbl!;c!y2`PD2$#a4eZFh!jtd3@w+ho>+7eE;dk-}~b@EWDYLMx+k?K}cBO-Ozd* zARaL7G(M~N{E#>{SlW{iy`5L(RNAF;bIqr@zV+OpbHC%xzWKYFN5+LyrP3Ebpbg0Twl-0n6%vFf?X+_*KK<8Ob$6P(7DFoLv?d+n5z)a^4!1@U=SdJe-VCs+n#NU zg8l04CS>zzB%pcB@{9wMsbhV3@}t#YQM-|^b6QQ1g;;EBkHK<9Zm}zk=NmPO+>JYi zV`lcv90C~Y5qQA6?g$?dJ6*=dg({(kJHXSAIDRIp6$Niwrmj(z2XsBnZ* zhlU(9&8LxNsw`_SMBJj11;0)@(*77|s_*R%(#i6OLpG&G9dA8S_Atq6o#smI6}m`j z1{}+4entAPB>nc+(e-U6bNRO;-jKCrKhK@n*>A&7;RqeTJD3Z)R7_> z{}P6HKzj`KW@SQWs9&(VYQXCZMQxm-XqDtR{TnMr(97)P2Fh2@mev|SJ;s9p4c5)z zNf=g`sJQ^#xJx49E8MWTcX#AX^5C;8c??QXEb>D5VJFBzktU<4*u=`>{zymEjRaFh zTKAW7#{rL;_uhSLNZ+iOr(_3W(!MVYSfddYl4M%cvE{X^l1@EI3?}&Z*ssp@2tsJ z9J1g1_$#7_gvOf}fTVeO?!LT?vu6*(P_E@!^1=d2n?IR?Ot!7 zi;fktUnQ4l#bB}3*ksqLw@oP<-wHR=_ghGv;5q)n*!NR$3oelruJ1Pz!zrlWHh7(P zf5Qoym2EKm8@TWr^Wfz9LfnE!m>yc#zpXwzW#t5i2$p#9fcKC)0Cc^drRZpL z-$Ih)Jyjrsu=lx>mTl>B$W?TOX{H9^IQ#NSU%ktW3&Msb&#>K|158ePX`PmgNngJz5R5CWbZS?GWl)oR&ACwO@i;1tubx!(Vn!58r zK2*2tDp^hsJKslBAT6ys7gr-=(U^TV2vL_IBdbvSPub{y?TPpdo96VvpoIR^%ejB)OQpLxkHLv9nk*e^~Paq<)*>BeiVbS9| zCVyXF->@vX5D@&n3@1>R0>Q&=2dB~64R=@O+5PuuL2!F>nm<5}Kc+27h7>w5MLw7L zvwTlH;6()ztGvSKdj-Yhni)E9^Q+OvjnFZw9CJuqBrr-~h6GzKcY=^Te8P7HXmW)A zpLHvNeJB39gI?uw4wu!XoMC$u=U&!2IvF@Wc)sxJN!;bGlYujF^Shvjs@1^_@UFc2 z`udvP3^?7Fq?V}(*8NKh2aH$bRI8gQgsV>?TsZ#Q=noQY{F}ffGBLHcm#= Date: Tue, 24 Dec 2019 16:34:12 +0300 Subject: [PATCH 075/105] Use Castle.Core.AsyncInterceptor --- .../AbpRegistrationBuilderExtensions.cs | 2 +- .../Volo.Abp.Castle.Core.csproj | 1 + .../Volo/Abp/Castle/AbpCastleCoreModule.cs | 2 +- .../AbpAsyncDeterminationInterceptor.cs | 15 ++++ .../CastleAbpInterceptorAdapter.cs | 73 ------------------- .../CastleAbpMethodInvocationAdapter.cs | 55 ++------------ .../CastleAbpMethodInvocationAdapterBase.cs | 48 ++++++++++++ ...pMethodInvocationAdapterWithReturnValue.cs | 27 +++++++ .../CastleAsyncAbpInterceptorAdapter.cs | 36 +++++++++ ...lectionDynamicHttpClientProxyExtensions.cs | 6 +- .../DynamicHttpProxyInterceptor.cs | 28 +++++-- 11 files changed, 161 insertions(+), 132 deletions(-) create mode 100644 framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/AbpAsyncDeterminationInterceptor.cs delete mode 100644 framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs create mode 100644 framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapterBase.cs create mode 100644 framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapterWithReturnValue.cs create mode 100644 framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs b/framework/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs index 0d5c7612b2..96caf956b1 100644 --- a/framework/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs +++ b/framework/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs @@ -89,7 +89,7 @@ namespace Autofac.Builder foreach (var interceptor in interceptors) { registrationBuilder.InterceptedBy( - typeof(CastleAbpInterceptorAdapter<>).MakeGenericType(interceptor) + typeof(AbpAsyncDeterminationInterceptor<>).MakeGenericType(interceptor) ); } diff --git a/framework/src/Volo.Abp.Castle.Core/Volo.Abp.Castle.Core.csproj b/framework/src/Volo.Abp.Castle.Core/Volo.Abp.Castle.Core.csproj index adcf4f8c2f..3d01363064 100644 --- a/framework/src/Volo.Abp.Castle.Core/Volo.Abp.Castle.Core.csproj +++ b/framework/src/Volo.Abp.Castle.Core/Volo.Abp.Castle.Core.csproj @@ -15,6 +15,7 @@ + diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/AbpCastleCoreModule.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/AbpCastleCoreModule.cs index 0f9a10bda1..0cb59767a4 100644 --- a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/AbpCastleCoreModule.cs +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/AbpCastleCoreModule.cs @@ -8,7 +8,7 @@ namespace Volo.Abp.Castle { public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddTransient(typeof(CastleAbpInterceptorAdapter<>)); + context.Services.AddTransient(typeof(AbpAsyncDeterminationInterceptor<>)); } } } diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/AbpAsyncDeterminationInterceptor.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/AbpAsyncDeterminationInterceptor.cs new file mode 100644 index 0000000000..4f852ce475 --- /dev/null +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/AbpAsyncDeterminationInterceptor.cs @@ -0,0 +1,15 @@ +using Castle.DynamicProxy; +using Volo.Abp.DynamicProxy; + +namespace Volo.Abp.Castle.DynamicProxy +{ + public class AbpAsyncDeterminationInterceptor : AsyncDeterminationInterceptor + where TInterceptor : IAbpInterceptor + { + public AbpAsyncDeterminationInterceptor(TInterceptor abpInterceptor) + : base(new CastleAsyncAbpInterceptorAdapter(abpInterceptor)) + { + + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs deleted file mode 100644 index 00dc33a59a..0000000000 --- a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpInterceptorAdapter.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Reflection; -using System.Threading.Tasks; -using Castle.DynamicProxy; -using Volo.Abp.DynamicProxy; -using Volo.Abp.Threading; - -namespace Volo.Abp.Castle.DynamicProxy -{ - public class CastleAbpInterceptorAdapter : IInterceptor - where TInterceptor : IAbpInterceptor - { - private static readonly MethodInfo MethodExecuteWithReturnValueAsync = - typeof(CastleAbpInterceptorAdapter) - .GetMethod( - nameof(ExecuteWithReturnValueAsync), - BindingFlags.NonPublic | BindingFlags.Instance - ); - - private readonly TInterceptor _abpInterceptor; - - public CastleAbpInterceptorAdapter(TInterceptor abpInterceptor) - { - _abpInterceptor = abpInterceptor; - } - - public void Intercept(IInvocation invocation) - { - var proceedInfo = invocation.CaptureProceedInfo(); - - var method = invocation.MethodInvocationTarget ?? invocation.Method; - - if (!method.IsAsync()) - { - proceedInfo.Invoke(); - return; - } - - InterceptAsyncMethod(invocation, proceedInfo); - } - - private void InterceptAsyncMethod(IInvocation invocation, IInvocationProceedInfo proceedInfo) - { - if (invocation.Method.ReturnType == typeof(Task)) - { - invocation.ReturnValue = ExecuteWithoutReturnValueAsync(invocation, proceedInfo); - } - else - { - invocation.ReturnValue = MethodExecuteWithReturnValueAsync - .MakeGenericMethod(invocation.Method.ReturnType.GenericTypeArguments[0]) - .Invoke(this, new object[] {invocation, proceedInfo}); - } - } - - private async Task ExecuteWithoutReturnValueAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo) - { - await _abpInterceptor.InterceptAsync( - new CastleAbpMethodInvocationAdapter(invocation, proceedInfo) - ); - } - - private async Task ExecuteWithReturnValueAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo) - { - await Task.Yield(); - - await _abpInterceptor.InterceptAsync( - new CastleAbpMethodInvocationAdapter(invocation, proceedInfo) - ); - - return await (Task)invocation.ReturnValue; - } - } -} 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 13f59cb0c1..89f3713521 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 @@ -1,65 +1,26 @@ using System; -using System.Collections.Generic; -using System.Reflection; using System.Threading.Tasks; using Castle.DynamicProxy; using Volo.Abp.DynamicProxy; -using Volo.Abp.Threading; namespace Volo.Abp.Castle.DynamicProxy { - public class CastleAbpMethodInvocationAdapter : IAbpMethodInvocation + public class CastleAbpMethodInvocationAdapter : CastleAbpMethodInvocationAdapterBase, IAbpMethodInvocation { - public object[] Arguments => Invocation.Arguments; - - public IReadOnlyDictionary ArgumentsDictionary => _lazyArgumentsDictionary.Value; - private readonly Lazy> _lazyArgumentsDictionary; - - public Type[] GenericArguments => Invocation.GenericArguments; - - public object TargetObject => Invocation.InvocationTarget ?? Invocation.MethodInvocationTarget; - - public MethodInfo Method => Invocation.MethodInvocationTarget ?? Invocation.Method; - - public object ReturnValue - { - get => _actualReturnValue ?? Invocation.ReturnValue; - set => Invocation.ReturnValue = value; - } - - private object _actualReturnValue; - - protected IInvocation Invocation { get; } protected IInvocationProceedInfo ProceedInfo { get; } + protected Func Proceed { get; } - public CastleAbpMethodInvocationAdapter(IInvocation invocation, IInvocationProceedInfo proceedInfo) + public CastleAbpMethodInvocationAdapter(IInvocation invocation, IInvocationProceedInfo proceedInfo, + Func proceed) + : base(invocation) { - Invocation = invocation; ProceedInfo = proceedInfo; - - _lazyArgumentsDictionary = new Lazy>(GetArgumentsDictionary); - } - - public Task ProceedAsync() - { - ProceedInfo.Invoke(); - - _actualReturnValue = Invocation.ReturnValue; - - return (Task) _actualReturnValue; + Proceed = proceed; } - private IReadOnlyDictionary GetArgumentsDictionary() + public override async Task ProceedAsync() { - var dict = new Dictionary(); - - var methodParameters = Method.GetParameters(); - for (int i = 0; i < methodParameters.Length; i++) - { - dict[methodParameters[i].Name] = Invocation.Arguments[i]; - } - - return dict; + await Proceed(Invocation, ProceedInfo); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapterBase.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapterBase.cs new file mode 100644 index 0000000000..09609699a8 --- /dev/null +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapterBase.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Threading.Tasks; +using Castle.DynamicProxy; +using Volo.Abp.DynamicProxy; + +namespace Volo.Abp.Castle.DynamicProxy +{ + public abstract class CastleAbpMethodInvocationAdapterBase : IAbpMethodInvocation + { + public object[] Arguments => Invocation.Arguments; + + public IReadOnlyDictionary ArgumentsDictionary => _lazyArgumentsDictionary.Value; + private readonly Lazy> _lazyArgumentsDictionary; + + public Type[] GenericArguments => Invocation.GenericArguments; + + public object TargetObject => Invocation.InvocationTarget ?? Invocation.MethodInvocationTarget; + + public MethodInfo Method => Invocation.MethodInvocationTarget ?? Invocation.Method; + + public object ReturnValue { get; set; } + + protected IInvocation Invocation { get; } + + protected CastleAbpMethodInvocationAdapterBase(IInvocation invocation) + { + Invocation = invocation; + _lazyArgumentsDictionary = new Lazy>(GetArgumentsDictionary); + } + + public abstract Task ProceedAsync(); + + private IReadOnlyDictionary GetArgumentsDictionary() + { + var dict = new Dictionary(); + + var methodParameters = Method.GetParameters(); + for (int i = 0; i < methodParameters.Length; i++) + { + dict[methodParameters[i].Name] = Invocation.Arguments[i]; + } + + return dict; + } + } +} \ No newline at end of file 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 new file mode 100644 index 0000000000..bf91102337 --- /dev/null +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapterWithReturnValue.cs @@ -0,0 +1,27 @@ +using System; +using System.Threading.Tasks; +using Castle.DynamicProxy; +using Volo.Abp.DynamicProxy; + +namespace Volo.Abp.Castle.DynamicProxy +{ + public class CastleAbpMethodInvocationAdapterWithReturnValue : CastleAbpMethodInvocationAdapterBase, IAbpMethodInvocation + { + protected IInvocationProceedInfo ProceedInfo { get; } + protected Func> Proceed { get; } + + public CastleAbpMethodInvocationAdapterWithReturnValue(IInvocation invocation, + IInvocationProceedInfo proceedInfo, + Func> proceed) + : base(invocation) + { + ProceedInfo = proceedInfo; + Proceed = proceed; + } + + public override async Task ProceedAsync() + { + ReturnValue = await Proceed(Invocation, ProceedInfo); + } + } +} \ No newline at end of file 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 new file mode 100644 index 0000000000..8a0c4fdd45 --- /dev/null +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs @@ -0,0 +1,36 @@ +using System; +using System.Threading.Tasks; +using Castle.DynamicProxy; +using Volo.Abp.DynamicProxy; + +namespace Volo.Abp.Castle.DynamicProxy +{ + public class CastleAsyncAbpInterceptorAdapter : AsyncInterceptorBase + where TInterceptor : IAbpInterceptor + { + private readonly TInterceptor _abpInterceptor; + + public CastleAsyncAbpInterceptorAdapter(TInterceptor abpInterceptor) + { + _abpInterceptor = abpInterceptor; + } + + protected override async Task InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func proceed) + { + await _abpInterceptor.InterceptAsync( + new CastleAbpMethodInvocationAdapter(invocation, proceedInfo, proceed) + ); + } + + protected override async Task InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func> proceed) + { + var adapter = new CastleAbpMethodInvocationAdapterWithReturnValue(invocation, proceedInfo, proceed); + + await _abpInterceptor.InterceptAsync( + adapter + ); + + return (TResult)adapter.ReturnValue; + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs b/framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs index 54387d2871..f34a732cb0 100644 --- a/framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs +++ b/framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs @@ -53,7 +53,7 @@ namespace Microsoft.Extensions.DependencyInjection foreach (var serviceType in serviceTypes) { services.AddHttpClientProxy( - serviceType, + serviceType, remoteServiceConfigurationName, asDefaultServices ); @@ -153,7 +153,7 @@ namespace Microsoft.Extensions.DependencyInjection var interceptorType = typeof(DynamicHttpProxyInterceptor<>).MakeGenericType(type); services.AddTransient(interceptorType); - var interceptorAdapterType = typeof(CastleAbpInterceptorAdapter<>).MakeGenericType(interceptorType); + var interceptorAdapterType = typeof(AbpAsyncDeterminationInterceptor<>).MakeGenericType(interceptorType); if (asDefaultService) { @@ -174,7 +174,7 @@ namespace Microsoft.Extensions.DependencyInjection var service = ProxyGeneratorInstance .CreateInterfaceProxyWithoutTarget( type, - (IInterceptor) serviceProvider.GetRequiredService(interceptorAdapterType) + (IInterceptor)serviceProvider.GetRequiredService(interceptorAdapterType) ); return Activator.CreateInstance( 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 42fdb0afc3..3e0124237f 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 @@ -74,18 +74,33 @@ namespace Volo.Abp.Http.Client.DynamicProxying Logger = NullLogger>.Instance; } - public override Task InterceptAsync(IAbpMethodInvocation invocation) + public override async Task InterceptAsync(IAbpMethodInvocation invocation) { if (invocation.Method.ReturnType.GenericTypeArguments.IsNullOrEmpty()) { - return MakeRequestAsync(invocation); + await MakeRequestAsync(invocation); } + else + { + var result = (Task)GenericInterceptAsyncMethod + .MakeGenericMethod(invocation.Method.ReturnType.GenericTypeArguments[0]) + .Invoke(this, new object[] { invocation }); - invocation.ReturnValue = GenericInterceptAsyncMethod - .MakeGenericMethod(invocation.Method.ReturnType.GenericTypeArguments[0]) - .Invoke(this, new object[] { invocation }); + invocation.ReturnValue = await GetResultAsync( + result, + invocation.Method.ReturnType.GetGenericArguments()[0] + ); + } - return Task.CompletedTask; + } + + private async Task GetResultAsync(Task task, Type resultType) + { + await task; + return typeof(Task<>) + .MakeGenericType(resultType) + .GetProperty(nameof(Task.Result), BindingFlags.Instance | BindingFlags.Public) + .GetValue(task); } private async Task MakeRequestAndGetResultAsync(IAbpMethodInvocation invocation) @@ -138,7 +153,6 @@ namespace Volo.Abp.Http.Client.DynamicProxying return await response.Content.ReadAsStringAsync(); } - private ApiVersionInfo GetApiVersionInfo(ActionApiDescriptionModel action) { var apiVersion = FindBestApiVersion(action); From 23a8a9f0fced92358e11a767b8ff132f55450816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 16:44:24 +0300 Subject: [PATCH 076/105] Fix permission and setting management modules for removed sync api --- .../PermissionAppService_Tests.cs | 2 +- .../AbpPermissionManagementTestBaseModule.cs | 5 +++-- .../PermissionTestDataBuilder.cs | 7 ++++--- .../PermissionManagementProvider_Tests.cs | 4 ++-- .../AbpSettingManagementTestBaseModule.cs | 5 +++-- .../SettingManagement/SettingTestDataBuilder.cs | 17 +++++++++-------- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo/Abp/PermissionManagement/PermissionAppService_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo/Abp/PermissionManagement/PermissionAppService_Tests.cs index 8b36b02877..e944aeebc2 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo/Abp/PermissionManagement/PermissionAppService_Tests.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo/Abp/PermissionManagement/PermissionAppService_Tests.cs @@ -65,7 +65,7 @@ namespace Volo.Abp.PermissionManagement.Application.Tests.Volo.Abp.PermissionMan [Fact] public async Task Update_Revoke_Test() { - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( Guid.NewGuid(), "MyPermission1", diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs index ec343d9615..20f4c94b62 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs @@ -2,6 +2,7 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Autofac; using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Abp.PermissionManagement { @@ -29,9 +30,9 @@ namespace Volo.Abp.PermissionManagement { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(() => scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/PermissionTestDataBuilder.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/PermissionTestDataBuilder.cs index 9d9e2ab10f..662d0b17c8 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/PermissionTestDataBuilder.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/PermissionTestDataBuilder.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Volo.Abp.Authorization.Permissions; using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; @@ -19,9 +20,9 @@ namespace Volo.Abp.PermissionManagement _permissionGrantRepository = permissionGrantRepository; } - public void Build() + public async Task BuildAsync() { - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( _guidGenerator.Create(), "MyPermission1", @@ -30,7 +31,7 @@ namespace Volo.Abp.PermissionManagement ) ); - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( _guidGenerator.Create(), "MyPermission3", diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs index d1e249c29a..aac1272ccd 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs @@ -22,7 +22,7 @@ namespace Volo.Abp.PermissionManagement [Fact] public async Task CheckAsync() { - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( Guid.NewGuid(), "MyPermission1", @@ -54,7 +54,7 @@ namespace Volo.Abp.PermissionManagement [Fact] public async Task SetAsync() { - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( Guid.NewGuid(), "MyPermission1", diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs index 7d90dcd747..058bd8ff49 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs @@ -2,6 +2,7 @@ using Volo.Abp.Autofac; using Volo.Abp.Modularity; using Volo.Abp.Settings; +using Volo.Abp.Threading; namespace Volo.Abp.SettingManagement { @@ -20,9 +21,9 @@ namespace Volo.Abp.SettingManagement { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(()=> scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/SettingTestDataBuilder.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/SettingTestDataBuilder.cs index 6843d6257e..a4a0b32a03 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/SettingTestDataBuilder.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/SettingTestDataBuilder.cs @@ -1,4 +1,5 @@ -using Volo.Abp.DependencyInjection; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; using Volo.Abp.Settings; @@ -20,9 +21,9 @@ namespace Volo.Abp.SettingManagement _testData = testData; } - public void Build() + public async Task BuildAsync() { - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _testData.SettingId, "MySetting1", @@ -31,7 +32,7 @@ namespace Volo.Abp.SettingManagement ) ); - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _guidGenerator.Create(), "MySetting2", @@ -40,7 +41,7 @@ namespace Volo.Abp.SettingManagement ) ); - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _guidGenerator.Create(), "MySetting2", @@ -50,7 +51,7 @@ namespace Volo.Abp.SettingManagement ) ); - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _guidGenerator.Create(), "MySetting2", @@ -60,7 +61,7 @@ namespace Volo.Abp.SettingManagement ) ); - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _guidGenerator.Create(), "MySettingWithoutInherit", @@ -69,7 +70,7 @@ namespace Volo.Abp.SettingManagement ) ); - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _guidGenerator.Create(), "MySettingWithoutInherit", From 4a3177d1870261e2fe61acffe00daf0434a19d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 16:47:47 +0300 Subject: [PATCH 077/105] feature-management use async api --- .../FeatureManagementTestBaseModule.cs | 5 +-- .../FeatureManagementTestDataBuilder.cs | 33 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestBaseModule.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestBaseModule.cs index 48a90400c8..1de262fd7b 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestBaseModule.cs +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestBaseModule.cs @@ -3,6 +3,7 @@ using Volo.Abp.Authorization; using Volo.Abp.Autofac; using Volo.Abp.Features; using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Abp.FeatureManagement { @@ -37,9 +38,9 @@ namespace Volo.Abp.FeatureManagement { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(() => scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestDataBuilder.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestDataBuilder.cs index 6c6a835109..0629693dbd 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestDataBuilder.cs +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestDataBuilder.cs @@ -1,4 +1,5 @@ -using Volo.Abp.DependencyInjection; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; using Volo.Abp.Features; using Volo.Abp.Guids; @@ -20,12 +21,12 @@ namespace Volo.Abp.FeatureManagement _featureValueRepository = featureValueRepository; } - public void Build() + public async Task BuildAsync() { #region "Regular" edition features //SocialLogins - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.SocialLogins, @@ -36,7 +37,7 @@ namespace Volo.Abp.FeatureManagement ); //UserCount - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.UserCount, @@ -47,7 +48,7 @@ namespace Volo.Abp.FeatureManagement ); //ProjectCount - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.ProjectCount, @@ -62,7 +63,7 @@ namespace Volo.Abp.FeatureManagement #region "Enterprise" edition features //SocialLogins - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.SocialLogins, @@ -73,7 +74,7 @@ namespace Volo.Abp.FeatureManagement ); //EmailSupport - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.EmailSupport, @@ -84,7 +85,7 @@ namespace Volo.Abp.FeatureManagement ); //UserCount - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.UserCount, @@ -95,7 +96,7 @@ namespace Volo.Abp.FeatureManagement ); //ProjectCount - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.ProjectCount, @@ -106,7 +107,7 @@ namespace Volo.Abp.FeatureManagement ); //BackupCount - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.BackupCount, @@ -121,7 +122,7 @@ namespace Volo.Abp.FeatureManagement #region "Ultimate" edition features //SocialLogins - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.SocialLogins, @@ -132,7 +133,7 @@ namespace Volo.Abp.FeatureManagement ); //EmailSupport - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.EmailSupport, @@ -143,7 +144,7 @@ namespace Volo.Abp.FeatureManagement ); //EmailSupport - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.DailyAnalysis, @@ -154,7 +155,7 @@ namespace Volo.Abp.FeatureManagement ); //UserCount - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.UserCount, @@ -165,7 +166,7 @@ namespace Volo.Abp.FeatureManagement ); //ProjectCount - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.ProjectCount, @@ -176,7 +177,7 @@ namespace Volo.Abp.FeatureManagement ); //BackupCount - _featureValueRepository.Insert( + await _featureValueRepository.InsertAsync( new FeatureValue( _guidGenerator.Create(), TestFeatureDefinitionProvider.BackupCount, From c4acff598da388a8d95f4118c71cb7b12da95b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 16:58:58 +0300 Subject: [PATCH 078/105] Identity module remove sync api usage --- .../Identity/AbpIdentityDomainTestModule.cs | 5 +-- .../IdentityClaimTypeManager_Tests.cs | 4 +-- .../Abp/Identity/TestPermissionDataBuilder.cs | 31 +++++++++-------- .../Abp/Identity/AbpIdentityTestBaseModule.cs | 12 ++++--- .../Identity/AbpIdentityTestDataBuilder.cs | 34 +++++++++---------- 5 files changed, 45 insertions(+), 41 deletions(-) diff --git a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs index cbb52f02ba..d9fb330a02 100644 --- a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs +++ b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs @@ -3,6 +3,7 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement.Identity; +using Volo.Abp.Threading; namespace Volo.Abp.Identity { @@ -22,9 +23,9 @@ namespace Volo.Abp.Identity { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(() => scope.ServiceProvider .GetRequiredService() - .Build(); + .Build()); } } } diff --git a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityClaimTypeManager_Tests.cs b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityClaimTypeManager_Tests.cs index c27967e704..c5c68d40c6 100644 --- a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityClaimTypeManager_Tests.cs +++ b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityClaimTypeManager_Tests.cs @@ -42,7 +42,7 @@ namespace Volo.Abp.Identity [Fact] public async Task UpdateAsync() { - var ageClaim = _identityClaimTypeRepository.Find(_testData.AgeClaimId); + var ageClaim = await _identityClaimTypeRepository.FindAsync(_testData.AgeClaimId); ageClaim.ShouldNotBeNull(); ageClaim.Description = "this is age"; @@ -65,7 +65,7 @@ namespace Volo.Abp.Identity public async Task Static_IdentityClaimType_Cant_Not_Update() { var phoneClaim = new IdentityClaimType(Guid.NewGuid(), "Phone", true, true); - _identityClaimTypeRepository.Insert(phoneClaim); + await _identityClaimTypeRepository.InsertAsync(phoneClaim); await Assert.ThrowsAnyAsync(async () => await _claimTypeManager.UpdateAsync(phoneClaim)); } diff --git a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/TestPermissionDataBuilder.cs b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/TestPermissionDataBuilder.cs index b84860a5cc..ad94e914b5 100644 --- a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/TestPermissionDataBuilder.cs +++ b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/TestPermissionDataBuilder.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Identity; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Identity; using Volo.Abp.Authorization.Permissions; using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; @@ -26,33 +27,33 @@ namespace Volo.Abp.Identity _lookupNormalizer = lookupNormalizer; } - public void Build() + public async Task Build() { - AddRolePermissions(); - AddUserPermissions(); + await AddRolePermissions(); + await AddUserPermissions(); } - private void AddRolePermissions() + private async Task AddRolePermissions() { - AddPermission(TestPermissionNames.MyPermission1, RolePermissionValueProvider.ProviderName, "admin"); - AddPermission(TestPermissionNames.MyPermission2, RolePermissionValueProvider.ProviderName, "admin"); - AddPermission(TestPermissionNames.MyPermission2_ChildPermission1, RolePermissionValueProvider.ProviderName, "admin"); + await AddPermission(TestPermissionNames.MyPermission1, RolePermissionValueProvider.ProviderName, "admin"); + await AddPermission(TestPermissionNames.MyPermission2, RolePermissionValueProvider.ProviderName, "admin"); + await AddPermission(TestPermissionNames.MyPermission2_ChildPermission1, RolePermissionValueProvider.ProviderName, "admin"); - AddPermission(TestPermissionNames.MyPermission1, RolePermissionValueProvider.ProviderName, "moderator"); - AddPermission(TestPermissionNames.MyPermission2, RolePermissionValueProvider.ProviderName, "moderator"); + await AddPermission(TestPermissionNames.MyPermission1, RolePermissionValueProvider.ProviderName, "moderator"); + await AddPermission(TestPermissionNames.MyPermission2, RolePermissionValueProvider.ProviderName, "moderator"); - AddPermission(TestPermissionNames.MyPermission1, RolePermissionValueProvider.ProviderName, "supporter"); + await AddPermission(TestPermissionNames.MyPermission1, RolePermissionValueProvider.ProviderName, "supporter"); } - private void AddUserPermissions() + private async Task AddUserPermissions() { var david = AsyncHelper.RunSync(() => _userRepository.FindByNormalizedUserNameAsync(_lookupNormalizer.NormalizeName("david"))); - AddPermission(TestPermissionNames.MyPermission1, UserPermissionValueProvider.ProviderName, david.Id.ToString()); + await AddPermission(TestPermissionNames.MyPermission1, UserPermissionValueProvider.ProviderName, david.Id.ToString()); } - private void AddPermission(string permissionName, string providerName, string providerKey) + private async Task AddPermission(string permissionName, string providerName, string providerKey) { - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( _guidGenerator.Create(), permissionName, diff --git a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestBaseModule.cs b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestBaseModule.cs index b52136a082..4b956ab16d 100644 --- a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestBaseModule.cs +++ b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestBaseModule.cs @@ -30,11 +30,13 @@ namespace Volo.Abp.Identity using (var scope = context.ServiceProvider.CreateScope()) { var dataSeeder = scope.ServiceProvider.GetRequiredService(); - AsyncHelper.RunSync(() => dataSeeder.SeedAsync()); - - scope.ServiceProvider - .GetRequiredService() - .Build(); + AsyncHelper.RunSync(async () => + { + await dataSeeder.SeedAsync(); + await scope.ServiceProvider + .GetRequiredService() + .Build(); + }); } } } diff --git a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestDataBuilder.cs b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestDataBuilder.cs index ae6b7befc2..69361ff5a8 100644 --- a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestDataBuilder.cs +++ b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestDataBuilder.cs @@ -1,8 +1,8 @@ using System.Security.Claims; +using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; -using Volo.Abp.Threading; namespace Volo.Abp.Identity { @@ -35,31 +35,31 @@ namespace Volo.Abp.Identity _testData = testData; } - public void Build() + public async Task Build() { - AddRoles(); - AddUsers(); - AddClaimTypes(); + await AddRoles(); + await AddUsers(); + await AddClaimTypes(); } - private void AddRoles() + private async Task AddRoles() { - _adminRole = AsyncHelper.RunSync(()=> _roleRepository.FindByNormalizedNameAsync(_lookupNormalizer.NormalizeName("admin"))); + _adminRole = await _roleRepository.FindByNormalizedNameAsync(_lookupNormalizer.NormalizeName("admin")); _moderator = new IdentityRole(_testData.RoleModeratorId, "moderator"); _moderator.AddClaim(_guidGenerator, new Claim("test-claim", "test-value")); - _roleRepository.Insert(_moderator); + await _roleRepository.InsertAsync(_moderator); _supporterRole = new IdentityRole(_guidGenerator.Create(), "supporter"); - _roleRepository.Insert(_supporterRole); + await _roleRepository.InsertAsync(_supporterRole); } - private void AddUsers() + private async Task AddUsers() { var adminUser = new IdentityUser(_guidGenerator.Create(), "administrator", "admin@abp.io"); adminUser.AddRole(_adminRole.Id); adminUser.AddClaim(_guidGenerator, new Claim("TestClaimType", "42")); - _userRepository.Insert(adminUser); + await _userRepository.InsertAsync(adminUser); var john = new IdentityUser(_testData.UserJohnId, "john.nash", "john.nash@abp.io"); john.AddRole(_moderator.Id); @@ -68,23 +68,23 @@ namespace Volo.Abp.Identity john.AddLogin(new UserLoginInfo("twitter", "johnx", "John Nash")); john.AddClaim(_guidGenerator, new Claim("TestClaimType", "42")); john.SetToken("test-provider", "test-name", "test-value"); - _userRepository.Insert(john); + await _userRepository.InsertAsync(john); var david = new IdentityUser(_testData.UserDavidId, "david", "david@abp.io"); - _userRepository.Insert(david); + await _userRepository.InsertAsync(david); var neo = new IdentityUser(_testData.UserNeoId, "neo", "neo@abp.io"); neo.AddRole(_supporterRole.Id); neo.AddClaim(_guidGenerator, new Claim("TestClaimType", "43")); - _userRepository.Insert(neo); + await _userRepository.InsertAsync(neo); } - private void AddClaimTypes() + private async Task AddClaimTypes() { var ageClaim = new IdentityClaimType(_testData.AgeClaimId, "Age", false, false, null, null, null,IdentityClaimValueType.Int); - _identityClaimTypeRepository.Insert(ageClaim); + await _identityClaimTypeRepository.InsertAsync(ageClaim); var educationClaim = new IdentityClaimType(_testData.EducationClaimId, "Education", true, false, null, null, null); - _identityClaimTypeRepository.Insert(educationClaim); + await _identityClaimTypeRepository.InsertAsync(educationClaim); } } } \ No newline at end of file From 2527faaa37d6f95911b9e2762209514c3c38eac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 17:05:14 +0300 Subject: [PATCH 079/105] identityserver remove old sync api usage --- .../AbpIdentityServerTestDataBuilder.cs | 37 +++++++------- ...tityServerTestEntityFrameworkCoreModule.cs | 5 +- .../AbpIdentityServerTestBaseModule.cs | 5 +- .../AbpIdentityServerTestDataBuilder.cs | 49 ++++++++++--------- 4 files changed, 50 insertions(+), 46 deletions(-) diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs index 2eef9ffc57..0d87a2fd19 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs @@ -1,4 +1,5 @@ -using IdentityServer4.Models; +using System.Threading.Tasks; +using IdentityServer4.Models; using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; using Volo.Abp.IdentityServer.ApiResources; @@ -12,7 +13,7 @@ using PersistedGrant = Volo.Abp.IdentityServer.Grants.PersistedGrant; namespace Volo.Abp.IdentityServer { - //TODO: There are two data builders (ses AbpIdentityServerTestDataBuilder in Volo.Abp.IdentityServer.TestBase). It should be somehow unified! + //TODO: There are two data builders (see AbpIdentityServerTestDataBuilder in Volo.Abp.IdentityServer.TestBase). It should be somehow unified! public class AbpIdentityServerTestDataBuilder : ITransientDependency { @@ -36,15 +37,15 @@ namespace Volo.Abp.IdentityServer _identityResourceRepository = identityResourceRepository; } - public void Build() + public async Task BuildAsync() { - AddClients(); - AddPersistentGrants(); - AddApiResources(); - AddIdentityResources(); + await AddClients(); + await AddPersistentGrants(); + await AddApiResources(); + await AddIdentityResources(); } - private void AddClients() + private async Task AddClients() { var client42 = new Client(_guidGenerator.Create(), "42") { @@ -55,12 +56,12 @@ namespace Volo.Abp.IdentityServer client42.AddScope("api1"); - _clientRepository.Insert(client42); + await _clientRepository.InsertAsync(client42); } - private void AddPersistentGrants() + private async Task AddPersistentGrants() { - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) + await _persistentGrantRepository.InsertAsync(new PersistedGrant(_guidGenerator.Create()) { Key = "38", ClientId = "TestClientId-38", @@ -69,7 +70,7 @@ namespace Volo.Abp.IdentityServer Data = "TestData-38" }); - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) + await _persistentGrantRepository.InsertAsync(new PersistedGrant(_guidGenerator.Create()) { Key = "37", ClientId = "TestClientId-37", @@ -78,7 +79,7 @@ namespace Volo.Abp.IdentityServer Data = "TestData-37" }); - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) + await _persistentGrantRepository.InsertAsync(new PersistedGrant(_guidGenerator.Create()) { Key = "36", ClientId = "TestClientId-X", @@ -87,7 +88,7 @@ namespace Volo.Abp.IdentityServer Data = "TestData-36" }); - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) + await _persistentGrantRepository.InsertAsync(new PersistedGrant(_guidGenerator.Create()) { Key = "35", ClientId = "TestClientId-X", @@ -97,7 +98,7 @@ namespace Volo.Abp.IdentityServer }); } - private void AddApiResources() + private async Task AddApiResources() { var apiResource = new ApiResource(_guidGenerator.Create(), "Test-ApiResource-Name-1") { @@ -110,10 +111,10 @@ namespace Volo.Abp.IdentityServer apiResource.AddScope("Test-ApiResource-ApiScope-Name-1", "Test-ApiResource-ApiScope-DisplayName-1"); apiResource.AddUserClaim("Test-ApiResource-Claim-Type-1"); - _apiResourceRepository.Insert(apiResource); + await _apiResourceRepository.InsertAsync(apiResource); } - private void AddIdentityResources() + private async Task AddIdentityResources() { var identityResource = new IdentityResource(_guidGenerator.Create(), "Test-Identity-Resource-Name-1") { @@ -125,7 +126,7 @@ namespace Volo.Abp.IdentityServer identityResource.AddUserClaim("Test-Identity-Resource-1-IdentityClaim-Type-1"); - _identityResourceRepository.Insert(identityResource); + await _identityResourceRepository.InsertAsync(identityResource); } } } diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs index 627ae45e38..450bd922f8 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs @@ -7,6 +7,7 @@ using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Abp.IdentityServer { @@ -55,9 +56,9 @@ namespace Volo.Abp.IdentityServer { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(() => scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestBaseModule.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestBaseModule.cs index b80cfedc20..29c748361a 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestBaseModule.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestBaseModule.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Autofac; using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Abp.IdentityServer { @@ -25,9 +26,9 @@ namespace Volo.Abp.IdentityServer { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(() => scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs index f86d060d5b..dd0016e666 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; using Volo.Abp.Identity; @@ -38,18 +39,18 @@ namespace Volo.Abp.IdentityServer _persistentGrantRepository = persistentGrantRepository; } - public void Build() + public async Task BuildAsync() { - AddPersistedGrants(); - AddIdentityResources(); - AddApiResources(); - AddClients(); - AddClaimTypes(); + await AddPersistedGrants(); + await AddIdentityResources(); + await AddApiResources(); + await AddClients(); + await AddClaimTypes(); } - private void AddPersistedGrants() + private async Task AddPersistedGrants() { - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) + await _persistentGrantRepository.InsertAsync(new PersistedGrant(_guidGenerator.Create()) { Key = "PersistedGrantKey1", SubjectId = "PersistedGrantSubjectId1", @@ -58,7 +59,7 @@ namespace Volo.Abp.IdentityServer Data = "" }); - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) + await _persistentGrantRepository.InsertAsync(new PersistedGrant(_guidGenerator.Create()) { Key = "PersistedGrantKey2", SubjectId = "PersistedGrantSubjectId2", @@ -67,7 +68,7 @@ namespace Volo.Abp.IdentityServer Data = "" }); - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) + await _persistentGrantRepository.InsertAsync(new PersistedGrant(_guidGenerator.Create()) { Key = "PersistedGrantKey3", SubjectId = "PersistedGrantSubjectId3", @@ -77,7 +78,7 @@ namespace Volo.Abp.IdentityServer }); } - private void AddIdentityResources() + private async Task AddIdentityResources() { var identityResource = new IdentityResource(_testData.IdentityResource1Id, "NewIdentityResource1") { @@ -87,12 +88,12 @@ namespace Volo.Abp.IdentityServer identityResource.AddUserClaim(nameof(ApiResourceClaim.Type)); - _identityResourceRepository.Insert(identityResource); - _identityResourceRepository.Insert(new IdentityResource(_guidGenerator.Create(), "NewIdentityResource2")); - _identityResourceRepository.Insert(new IdentityResource(_guidGenerator.Create(), "NewIdentityResource3")); + await _identityResourceRepository.InsertAsync(identityResource); + await _identityResourceRepository.InsertAsync(new IdentityResource(_guidGenerator.Create(), "NewIdentityResource2")); + await _identityResourceRepository.InsertAsync(new IdentityResource(_guidGenerator.Create(), "NewIdentityResource3")); } - private void AddApiResources() + private async Task AddApiResources() { var apiResource = new ApiResource(_testData.ApiResource1Id, "NewApiResource1"); apiResource.Description = nameof(apiResource.Description); @@ -102,12 +103,12 @@ namespace Volo.Abp.IdentityServer apiResource.AddUserClaim(nameof(ApiResourceClaim.Type)); apiResource.AddSecret(nameof(ApiSecret.Value)); - _apiResourceRepository.Insert(apiResource); - _apiResourceRepository.Insert(new ApiResource(_guidGenerator.Create(), "NewApiResource2")); - _apiResourceRepository.Insert(new ApiResource(_guidGenerator.Create(), "NewApiResource3")); + await _apiResourceRepository.InsertAsync(apiResource); + await _apiResourceRepository.InsertAsync(new ApiResource(_guidGenerator.Create(), "NewApiResource2")); + await _apiResourceRepository.InsertAsync(new ApiResource(_guidGenerator.Create(), "NewApiResource3")); } - private void AddClients() + private async Task AddClients() { var client = new Client(_testData.Client1Id, "ClientId1") { @@ -129,17 +130,17 @@ namespace Volo.Abp.IdentityServer client.AddScope(nameof(ClientScope.Scope)); client.AddSecret(nameof(ClientSecret.Value)); - _clientRepository.Insert(client); + await _clientRepository.InsertAsync(client); - _clientRepository.Insert(new Client(_guidGenerator.Create(), "ClientId2")); - _clientRepository.Insert(new Client(_guidGenerator.Create(), "ClientId3")); + await _clientRepository.InsertAsync(new Client(_guidGenerator.Create(), "ClientId2")); + await _clientRepository.InsertAsync(new Client(_guidGenerator.Create(), "ClientId3")); } - private void AddClaimTypes() + private async Task AddClaimTypes() { var ageClaim = new IdentityClaimType(Guid.NewGuid(), "Age", false, false, null, null, null, IdentityClaimValueType.Int); - _identityClaimTypeRepository.Insert(ageClaim); + await _identityClaimTypeRepository.InsertAsync(ageClaim); } } } From d94e01f0ce877285df13e1779a288040eece3e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 17:30:09 +0300 Subject: [PATCH 080/105] move blog, docs and tenant management to async api --- .../Volo/Blogging/Posts/PostAppService.cs | 2 +- .../Volo/Blogging/Tagging/ITagRepository.cs | 3 ++- .../Volo/Blogging/Tagging/EfCoreTagRepository.cs | 7 +++++-- .../Volo/Blogging/Tagging/MongoTagRepository.cs | 11 +++++++---- .../Volo/Blogging/Tagging/TagRepository_Tests.cs | 2 +- .../Volo/Docs/DocsTestBaseModule.cs | 5 +++-- .../Volo/Docs/DocsTestDataBuilder.cs | 7 ++++--- .../Volo/Abp/TenantManagement/ITenantRepository.cs | 5 +++++ .../Volo/Abp/TenantManagement/TenantStore.cs | 2 +- .../EntityFrameworkCore/EfCoreTenantRepository.cs | 7 +++++++ .../TenantManagement/MongoDb/MongoTenantRepository.cs | 6 ++++++ 11 files changed, 42 insertions(+), 15 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs index a8232933a4..be51085f86 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs @@ -118,7 +118,7 @@ namespace Volo.Blogging.Posts await AuthorizationService.CheckAsync(post, CommonOperations.Delete); var tags = await GetTagsOfPost(id); - _tagRepository.DecreaseUsageCountOfTags(tags.Select(t => t.Id).ToList()); + await _tagRepository.DecreaseUsageCountOfTagsAsync(tags.Select(t => t.Id).ToList()); await _commentRepository.DeleteOfPost(id); await _postRepository.DeleteAsync(id); diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Tagging/ITagRepository.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Tagging/ITagRepository.cs index 33858b9baf..8c076c49d7 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Tagging/ITagRepository.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Tagging/ITagRepository.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; @@ -15,6 +16,6 @@ namespace Volo.Blogging.Tagging Task> GetListAsync(IEnumerable ids); - void DecreaseUsageCountOfTags(List id); + Task DecreaseUsageCountOfTagsAsync(List id, CancellationToken cancellationToken = default); } } diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Tagging/EfCoreTagRepository.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Tagging/EfCoreTagRepository.cs index cd77b3cfab..3e897fa7e3 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Tagging/EfCoreTagRepository.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Tagging/EfCoreTagRepository.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; @@ -36,9 +37,11 @@ namespace Volo.Blogging.Tagging return await DbSet.Where(t => ids.Contains(t.Id)).ToListAsync(); } - public void DecreaseUsageCountOfTags(List ids) + public async Task DecreaseUsageCountOfTagsAsync(List ids, CancellationToken cancellationToken = default) { - var tags = DbSet.Where(t => ids.Any(id => id == t.Id)); + var tags = await DbSet + .Where(t => ids.Any(id => id == t.Id)) + .ToListAsync(GetCancellationToken(cancellationToken)); foreach (var tag in tags) { diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Tagging/MongoTagRepository.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Tagging/MongoTagRepository.cs index e2fcdca96c..2c0b3b97bf 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Tagging/MongoTagRepository.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Tagging/MongoTagRepository.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.Threading.Tasks; using MongoDB.Driver; using MongoDB.Driver.Linq; @@ -19,7 +20,7 @@ namespace Volo.Blogging.Tagging public async Task> GetListAsync(Guid blogId) { - return await GetMongoQueryable().Where(t=>t.BlogId == blogId).ToListAsync(); + return await GetMongoQueryable().Where(t => t.BlogId == blogId).ToListAsync(); } public async Task GetByNameAsync(Guid blogId, string name) @@ -37,14 +38,16 @@ namespace Volo.Blogging.Tagging return await GetMongoQueryable().Where(t => ids.Contains(t.Id)).ToListAsync(); } - public void DecreaseUsageCountOfTags(List ids) + public async Task DecreaseUsageCountOfTagsAsync(List ids, CancellationToken cancellationToken = default) { - var tags = GetMongoQueryable().Where(t => ids.Contains(t.Id)); + var tags = await GetMongoQueryable() + .Where(t => ids.Contains(t.Id)) + .ToListAsync(GetCancellationToken(cancellationToken)); foreach (var tag in tags) { tag.DecreaseUsageCount(); - Update(tag); + await UpdateAsync(tag, cancellationToken: GetCancellationToken(cancellationToken)); } } } diff --git a/modules/blogging/test/Volo.Blogging.TestBase/Volo/Blogging/Tagging/TagRepository_Tests.cs b/modules/blogging/test/Volo.Blogging.TestBase/Volo/Blogging/Tagging/TagRepository_Tests.cs index a81c7dde1e..0706ad3f4a 100644 --- a/modules/blogging/test/Volo.Blogging.TestBase/Volo/Blogging/Tagging/TagRepository_Tests.cs +++ b/modules/blogging/test/Volo.Blogging.TestBase/Volo/Blogging/Tagging/TagRepository_Tests.cs @@ -60,7 +60,7 @@ namespace Volo.Blogging.Tagging var tag = await TagRepository.FindByNameAsync(BloggingTestData.Blog1Id, BloggingTestData.Tag1Name); var usageCount = tag.UsageCount; - TagRepository.DecreaseUsageCountOfTags(new List() + await TagRepository.DecreaseUsageCountOfTagsAsync(new List() { tag.Id }); diff --git a/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestBaseModule.cs b/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestBaseModule.cs index a4661075d0..ffc11fd134 100644 --- a/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestBaseModule.cs +++ b/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestBaseModule.cs @@ -3,6 +3,7 @@ using Volo.Abp; using Volo.Abp.Authorization; using Volo.Abp.Autofac; using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Docs { @@ -28,9 +29,9 @@ namespace Volo.Docs { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(() => scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestDataBuilder.cs b/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestDataBuilder.cs index 15fa70eee7..121d18b44a 100644 --- a/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestDataBuilder.cs +++ b/modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestDataBuilder.cs @@ -1,4 +1,5 @@ -using Volo.Abp.Data; +using System.Threading.Tasks; +using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Docs.GitHub.Documents; using Volo.Docs.Projects; @@ -18,7 +19,7 @@ namespace Volo.Docs _projectRepository = projectRepository; } - public void Build() + public async Task BuildAsync() { var project = new Project( _testData.PorjectId, @@ -36,7 +37,7 @@ namespace Volo.Docs .SetProperty("GitHubAccessToken", "123456") .SetProperty("GitHubUserAgent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"); - _projectRepository.Insert(project); + await _projectRepository.InsertAsync(project); } } } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs index d8725bf6cf..1feca866a2 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs @@ -18,6 +18,11 @@ namespace Volo.Abp.TenantManagement bool includeDetails = true ); + Tenant FindById( + Guid id, + bool includeDetails = true + ); + Task> GetListAsync( string sorting = null, int maxResultCount = int.MaxValue, diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs index cc0788d634..afa9af0cf2 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs @@ -70,7 +70,7 @@ namespace Volo.Abp.TenantManagement { using (_currentTenant.Change(null)) //TODO: No need this if we can implement to define host side (or tenant-independent) entities! { - var tenant = _tenantRepository.Find(id); + var tenant = _tenantRepository.FindById(id); if (tenant == null) { return null; diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs index c1188d2859..e211f81abf 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs @@ -35,6 +35,13 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore .FirstOrDefault(t => t.Name == name); } + public Tenant FindById(Guid id, bool includeDetails = true) + { + return DbSet + .IncludeDetails(includeDetails) + .FirstOrDefault(t => t.Id == id); + } + public virtual async Task> GetListAsync( string sorting = null, int maxResultCount = int.MaxValue, diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs index 389f55d5db..1d57652833 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs @@ -34,6 +34,12 @@ namespace Volo.Abp.TenantManagement.MongoDB .FirstOrDefault(t => t.Name == name); } + public Tenant FindById(Guid id, bool includeDetails = true) + { + return GetMongoQueryable() + .FirstOrDefault(t => t.Id == id); + } + public virtual async Task> GetListAsync( string sorting = null, int maxResultCount = int.MaxValue, From f0ae99484852185a5aec9c1a00e38e181e4becf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 18:13:54 +0300 Subject: [PATCH 081/105] Audit log remove sync api --- .../Volo/Abp/Auditing/AuditingManager.cs | 15 ----------- .../Volo/Abp/Auditing/IAuditLogSaveHandle.cs | 2 -- .../Volo/Abp/Auditing/IAuditingStore.cs | 2 -- .../Abp/Auditing/SimpleLogAuditingStore.cs | 7 +---- .../Volo/Abp/AuditLogging/AuditingStore.cs | 27 ------------------- .../AuditLogRepository_Tests.cs | 6 +---- .../AuditLogging/AuditLogRepository_Tests.cs | 12 ++++----- .../AuditLogging/AuditStore_Basic_Tests.cs | 2 +- 8 files changed, 9 insertions(+), 64 deletions(-) diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs index d314d31799..070684f48a 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs @@ -120,16 +120,6 @@ namespace Volo.Abp.Auditing } } - protected virtual void Save(DisposableSaveHandle saveHandle) - { - BeforeSave(saveHandle); - - if (ShouldSave(saveHandle.AuditLog)) - { - _auditingStore.Save(saveHandle.AuditLog); - } - } - protected bool ShouldSave(AuditLogInfo auditLog) { if (!auditLog.Actions.Any() && !auditLog.EntityChanges.Any()) @@ -165,11 +155,6 @@ namespace Volo.Abp.Auditing await _auditingManager.SaveAsync(this); } - public void Save() - { - _auditingManager.Save(this); - } - public void Dispose() { _scope.Dispose(); diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditLogSaveHandle.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditLogSaveHandle.cs index 596f67523a..4709b745d2 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditLogSaveHandle.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditLogSaveHandle.cs @@ -5,8 +5,6 @@ namespace Volo.Abp.Auditing { public interface IAuditLogSaveHandle : IDisposable { - void Save(); - Task SaveAsync(); } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs index 101ec8b03e..7166af642b 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs @@ -4,8 +4,6 @@ namespace Volo.Abp.Auditing { public interface IAuditingStore { - void Save(AuditLogInfo auditInfo); - Task SaveAsync(AuditLogInfo auditInfo); } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/SimpleLogAuditingStore.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/SimpleLogAuditingStore.cs index 8067ede5c5..eeb6c7803c 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/SimpleLogAuditingStore.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/SimpleLogAuditingStore.cs @@ -15,14 +15,9 @@ namespace Volo.Abp.Auditing Logger = NullLogger.Instance; } - public void Save(AuditLogInfo auditInfo) - { - Logger.LogInformation(auditInfo.ToString()); - } - public Task SaveAsync(AuditLogInfo auditInfo) { - Save(auditInfo); + Logger.LogInformation(auditInfo.ToString()); return Task.FromResult(0); } } diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditingStore.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditingStore.cs index 7bbd51af12..0fc757b5e9 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditingStore.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditingStore.cs @@ -33,33 +33,6 @@ namespace Volo.Abp.AuditLogging Logger = NullLogger.Instance; } - public void Save(AuditLogInfo auditInfo) - { - if (!Options.HideErrors) - { - SaveLog(auditInfo); - return; - } - - try - { - SaveLog(auditInfo); - } - catch (Exception ex) - { - Logger.LogException(ex, LogLevel.Error); - } - } - - protected virtual void SaveLog(AuditLogInfo auditInfo) - { - using (var uow = _unitOfWorkManager.Begin(true)) - { - _auditLogRepository.Insert(new AuditLog(_guidGenerator, auditInfo)); - uow.SaveChanges(); - } - } - public async Task SaveAsync(AuditLogInfo auditInfo) { if (!Options.HideErrors) diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AuditLogRepository_Tests.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AuditLogRepository_Tests.cs index 4f626c3636..7330e3292e 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AuditLogRepository_Tests.cs +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AuditLogRepository_Tests.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Volo.Abp.AuditLogging.EntityFrameworkCore +namespace Volo.Abp.AuditLogging.EntityFrameworkCore { public class AuditLogRepository_Tests : AuditLogRepository_Tests { diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditLogRepository_Tests.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditLogRepository_Tests.cs index 3f61988ec0..54092ea248 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditLogRepository_Tests.cs +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditLogRepository_Tests.cs @@ -119,8 +119,8 @@ namespace Volo.Abp.AuditLogging } }; - AuditLogRepository.Insert(new AuditLog(GuidGenerator, log1)); - AuditLogRepository.Insert(new AuditLog(GuidGenerator, log2)); + await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log1)); + await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log2)); //Assert var logs = await AuditLogRepository.GetListAsync(); @@ -223,8 +223,8 @@ namespace Volo.Abp.AuditLogging } }; - AuditLogRepository.Insert(new AuditLog(GuidGenerator, log1)); - AuditLogRepository.Insert(new AuditLog(GuidGenerator, log2)); + await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log1)); + await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log2)); //Assert var logs = await AuditLogRepository.GetCountAsync(); @@ -325,8 +325,8 @@ namespace Volo.Abp.AuditLogging } }; - AuditLogRepository.Insert(new AuditLog(GuidGenerator, log1)); - AuditLogRepository.Insert(new AuditLog(GuidGenerator, log2)); + await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log1)); + await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log2)); //Assert var date = DateTime.Parse("2020-01-01"); diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs index c54d98608c..05dc829440 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs @@ -68,7 +68,7 @@ namespace Volo.Abp.AuditLogging //Assert - var insertedLog = _auditLogRepository.GetList(true) + var insertedLog = (await _auditLogRepository.GetListAsync(true)) .FirstOrDefault(al => al.UserId == userId); insertedLog.ShouldNotBeNull(); From d332818f6ab978b4a8d116fa2d0722192b2105a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 18:14:10 +0300 Subject: [PATCH 082/105] Background job remove sync api --- .../Abp/BackgroundJobs/BackgroundJobWorker.cs | 6 ++-- .../Abp/BackgroundJobs/IBackgroundJobStore.cs | 34 ------------------- .../Abp/BackgroundJobs/BackgroundJobStore.cs | 31 ----------------- .../AbpBackgroundJobsTestBaseModule.cs | 5 +-- .../BackgroundJobsTestDataBuilder.cs | 9 ++--- 5 files changed, 11 insertions(+), 74 deletions(-) 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 03b5cb73e4..74a3f6128f 100644 --- a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobWorker.cs +++ b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobWorker.cs @@ -36,7 +36,7 @@ namespace Volo.Abp.BackgroundJobs { var store = scope.ServiceProvider.GetRequiredService(); - var waitingJobs = store.GetWaitingJobs(WorkerOptions.MaxJobFetchCount); + var waitingJobs = AsyncHelper.RunSync(() => store.GetWaitingJobsAsync(WorkerOptions.MaxJobFetchCount)); if (!waitingJobs.Any()) { @@ -62,7 +62,7 @@ namespace Volo.Abp.BackgroundJobs { jobExecuter.Execute(context); - store.Delete(jobInfo.Id); + AsyncHelper.RunSync(() => store.DeleteAsync(jobInfo.Id)); } catch (BackgroundJobExecutionException) { @@ -94,7 +94,7 @@ namespace Volo.Abp.BackgroundJobs { try { - store.Update(jobInfo); + AsyncHelper.RunSync(() => store.UpdateAsync(jobInfo)); } catch (Exception updateEx) { diff --git a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/IBackgroundJobStore.cs b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/IBackgroundJobStore.cs index f909b3846d..839156c225 100644 --- a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/IBackgroundJobStore.cs +++ b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/IBackgroundJobStore.cs @@ -9,13 +9,6 @@ namespace Volo.Abp.BackgroundJobs /// public interface IBackgroundJobStore { - /// - /// Gets a BackgroundJobInfo based on the given jobId. - /// - /// The Job Unique Identifier. - /// The BackgroundJobInfo object. - BackgroundJobInfo Find(Guid jobId); - /// /// Gets a BackgroundJobInfo based on the given jobId. /// @@ -23,27 +16,12 @@ namespace Volo.Abp.BackgroundJobs /// The BackgroundJobInfo object. Task FindAsync(Guid jobId); - /// - /// Inserts a background job. - /// - /// Job information. - void Insert(BackgroundJobInfo jobInfo); - /// /// Inserts a background job. /// /// Job information. Task InsertAsync(BackgroundJobInfo jobInfo); - /// - /// Gets waiting jobs. It should get jobs based on these: - /// Conditions: !IsAbandoned And NextTryTime <= Clock.Now. - /// Order by: Priority DESC, TryCount ASC, NextTryTime ASC. - /// Maximum result: . - /// - /// Maximum result count. - List GetWaitingJobs(int maxResultCount); - /// /// Gets waiting jobs. It should get jobs based on these: /// Conditions: !IsAbandoned And NextTryTime <= Clock.Now. @@ -53,24 +31,12 @@ namespace Volo.Abp.BackgroundJobs /// Maximum result count. Task> GetWaitingJobsAsync(int maxResultCount); - /// - /// Deletes a job. - /// - /// The Job Unique Identifier. - void Delete(Guid jobId); - /// /// Deletes a job. /// /// The Job Unique Identifier. Task DeleteAsync(Guid jobId); - /// - /// Updates a job. - /// - /// Job information. - void Update(BackgroundJobInfo jobInfo); - /// /// Updates a job. /// diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs index 833ce54a6b..db6f5cc486 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs @@ -20,13 +20,6 @@ namespace Volo.Abp.BackgroundJobs BackgroundJobRepository = backgroundJobRepository; } - public BackgroundJobInfo Find(Guid jobId) - { - return ObjectMapper.Map( - BackgroundJobRepository.Find(jobId) - ); - } - public virtual async Task FindAsync(Guid jobId) { return ObjectMapper.Map( @@ -34,13 +27,6 @@ namespace Volo.Abp.BackgroundJobs ); } - public void Insert(BackgroundJobInfo jobInfo) - { - BackgroundJobRepository.Insert( - ObjectMapper.Map(jobInfo) - ); - } - public virtual async Task InsertAsync(BackgroundJobInfo jobInfo) { await BackgroundJobRepository.InsertAsync( @@ -62,28 +48,11 @@ namespace Volo.Abp.BackgroundJobs ); } - public void Delete(Guid jobId) - { - BackgroundJobRepository.Delete(jobId); - } - public virtual async Task DeleteAsync(Guid jobId) { await BackgroundJobRepository.DeleteAsync(jobId); } - public void Update(BackgroundJobInfo jobInfo) - { - var backgroundJobRecord = BackgroundJobRepository.Find(jobInfo.Id); - if (backgroundJobRecord == null) - { - return; - } - - ObjectMapper.Map(jobInfo, backgroundJobRecord); - BackgroundJobRepository.Update(backgroundJobRecord); - } - public virtual async Task UpdateAsync(BackgroundJobInfo jobInfo) { var backgroundJobRecord = await BackgroundJobRepository.FindAsync(jobInfo.Id); diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/AbpBackgroundJobsTestBaseModule.cs b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/AbpBackgroundJobsTestBaseModule.cs index 0c1a681eeb..75e150dc25 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/AbpBackgroundJobsTestBaseModule.cs +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/AbpBackgroundJobsTestBaseModule.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Autofac; using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Abp.BackgroundJobs { @@ -28,9 +29,9 @@ namespace Volo.Abp.BackgroundJobs { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(() => scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/BackgroundJobsTestDataBuilder.cs b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/BackgroundJobsTestDataBuilder.cs index dd74854a9c..16bcc667f5 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/BackgroundJobsTestDataBuilder.cs +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/BackgroundJobsTestDataBuilder.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Timing; @@ -20,9 +21,9 @@ namespace Volo.Abp.BackgroundJobs _clock = clock; } - public void Build() + public async Task BuildAsync() { - _backgroundJobRepository.Insert( + await _backgroundJobRepository.InsertAsync( new BackgroundJobRecord(_testData.JobId1) { JobName = "TestJobName", @@ -36,7 +37,7 @@ namespace Volo.Abp.BackgroundJobs } ); - _backgroundJobRepository.Insert( + await _backgroundJobRepository.InsertAsync( new BackgroundJobRecord(_testData.JobId2) { JobName = "TestJobName", @@ -50,7 +51,7 @@ namespace Volo.Abp.BackgroundJobs } ); - _backgroundJobRepository.Insert( + await _backgroundJobRepository.InsertAsync( new BackgroundJobRecord(_testData.JobId3) { JobName = "TestJobName", From 9cabc686c8ef78b95478b7b64b7befab0ee45ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 18:14:22 +0300 Subject: [PATCH 083/105] Remove sync api from the startup template --- .../MyProjectNameTestBase.cs | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyProjectNameTestBase.cs b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyProjectNameTestBase.cs index 5cb98cde0c..3951905c8d 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyProjectNameTestBase.cs +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyProjectNameTestBase.cs @@ -17,26 +17,6 @@ namespace MyCompanyName.MyProjectName options.UseAutofac(); } - protected virtual void WithUnitOfWork(Action action) - { - WithUnitOfWork(new AbpUnitOfWorkOptions(), action); - } - - protected virtual void WithUnitOfWork(AbpUnitOfWorkOptions options, Action action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - action(); - - uow.Complete(); - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); @@ -57,26 +37,6 @@ namespace MyCompanyName.MyProjectName } } - protected virtual TResult WithUnitOfWork(Func func) - { - return WithUnitOfWork(new AbpUnitOfWorkOptions(), func); - } - - protected virtual TResult WithUnitOfWork(AbpUnitOfWorkOptions options, Func func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = func(); - uow.Complete(); - return result; - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func> func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); From b0f17b8876c5db4dbd7bedff08d0436da7c6defd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 24 Dec 2019 18:47:07 +0300 Subject: [PATCH 084/105] remove sync uow methods --- .../MyProjectNameTestBase.cs | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyProjectNameTestBase.cs b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyProjectNameTestBase.cs index 638ef8d4a3..7bcdcfe9c5 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyProjectNameTestBase.cs +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.TestBase/MyProjectNameTestBase.cs @@ -16,26 +16,6 @@ namespace MyCompanyName.MyProjectName options.UseAutofac(); } - protected virtual void WithUnitOfWork(Action action) - { - WithUnitOfWork(new AbpUnitOfWorkOptions(), action); - } - - protected virtual void WithUnitOfWork(AbpUnitOfWorkOptions options, Action action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - action(); - - uow.Complete(); - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); @@ -56,26 +36,6 @@ namespace MyCompanyName.MyProjectName } } - protected virtual TResult WithUnitOfWork(Func func) - { - return WithUnitOfWork(new AbpUnitOfWorkOptions(), func); - } - - protected virtual TResult WithUnitOfWork(AbpUnitOfWorkOptions options, Func func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = func(); - uow.Complete(); - return result; - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func> func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); From 22932675c47968716cf126dbe0e146341ba01706 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 25 Dec 2019 11:12:47 +0300 Subject: [PATCH 085/105] blogging redirect urls --- .../Controllers/HomeController.cs | 11 ++++++++++- .../Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs | 8 ++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/modules/blogging/app/Volo.BloggingTestApp/Controllers/HomeController.cs b/modules/blogging/app/Volo.BloggingTestApp/Controllers/HomeController.cs index 0e4a7acc1d..f64a1da5ae 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/Controllers/HomeController.cs +++ b/modules/blogging/app/Volo.BloggingTestApp/Controllers/HomeController.cs @@ -1,13 +1,22 @@ using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Mvc; +using Volo.Blogging; namespace Volo.BloggingTestApp.Controllers { public class HomeController : AbpController { + private readonly BloggingUrlOptions _blogOptions; + + public HomeController(IOptions blogOptions) + { + _blogOptions = blogOptions.Value; + } public ActionResult Index() { - return Redirect("/blog/"); + var urlPrefix = _blogOptions.RoutePrefix; + return Redirect(urlPrefix); } } } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs index ad2dbc846f..b566b7bbe0 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs @@ -4,6 +4,7 @@ using System.Net; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; using Volo.Blogging.Blogs; using Volo.Blogging.Blogs.Dtos; @@ -16,6 +17,7 @@ namespace Volo.Blogging.Pages.Blog.Posts private readonly IPostAppService _postAppService; private readonly IBlogAppService _blogAppService; private readonly IAuthorizationService _authorization; + private readonly BloggingUrlOptions _blogOptions; [BindProperty(SupportsGet = true)] public string BlogShortName { get; set; } @@ -25,11 +27,12 @@ namespace Volo.Blogging.Pages.Blog.Posts public BlogDto Blog { get; set; } - public NewModel(IPostAppService postAppService, IBlogAppService blogAppService, IAuthorizationService authorization) + public NewModel(IPostAppService postAppService, IBlogAppService blogAppService, IAuthorizationService authorization, IOptions blogOptions) { _postAppService = postAppService; _blogAppService = blogAppService; _authorization = authorization; + _blogOptions = blogOptions.Value; } public async Task OnGetAsync() @@ -54,7 +57,8 @@ namespace Volo.Blogging.Pages.Blog.Posts var postWithDetailsDto = await _postAppService.CreateAsync(ObjectMapper.Map(Post)); //TODO: Try Url.Page(...) - return Redirect(Url.Content($"~/blog/{WebUtility.UrlEncode(blog.ShortName)}/{WebUtility.UrlEncode(postWithDetailsDto.Url)}")); + var urlPrefix = _blogOptions.RoutePrefix; + return Redirect(Url.Content($"~{urlPrefix}{WebUtility.UrlEncode(blog.ShortName)}/{WebUtility.UrlEncode(postWithDetailsDto.Url)}")); } public class CreatePostViewModel From 62cc97a8f6a9528546e969472a6c2ec499374a0d Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 25 Dec 2019 14:55:01 +0300 Subject: [PATCH 086/105] blog new page ian section container --- .../Pages/Blog/Posts/New.cshtml | 90 ++++++++++--------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml index 877c63f9ac..b96a531550 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml @@ -7,64 +7,70 @@ ViewBag.PageTitle = "Blog"; } @section styles { - + } @section scripts { - - + + } -
-
- - - - +
+
+
+
+ + + + + - - -
- - -
-
- - - -
+ + +
+ + +
+
+ + + +
- - + + -
-
-
-
-
+
+
+
+
+
-
-
+
+
-
- @L["MarkdownSupported"] -
+
+ @L["MarkdownSupported"] +
-
@L["FileUploadInfo"].Value
+
@L["FileUploadInfo"].Value
-
-
- +
+ +
+ +
- - -
+
+
From 3005297e845dd718f3d33563be589ddc283aa40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 25 Dec 2019 19:36:19 +0300 Subject: [PATCH 087/105] Increment version to 2.0 --- common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.props b/common.props index 8c87eb2b9d..1a273a3efe 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 1.1.2 + 2.0.0 $(NoWarn);CS1591 https://abp.io/assets/abp_nupkg.png https://abp.io From 1ae083f11a4b8f6c3dfff9c48901eb406159e27d Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 26 Dec 2019 10:25:14 +0800 Subject: [PATCH 088/105] Remove the sync method for tenant & background job module. --- .../Mvc/Client/RemoteTenantStore.cs | 56 ------------------- .../Volo/Abp/MultiTenancy/ITenantStore.cs | 4 -- .../MultiTenantConnectionStringResolver.cs | 3 +- .../Abp/BackgroundJobs/BackgroundJobStore.cs | 7 --- .../IBackgroundJobRepository.cs | 2 - .../EfCoreBackgroundJobRepository.cs | 6 -- .../MongoDB/MongoBackgroundJobRepository.cs | 6 -- .../Abp/TenantManagement/ITenantRepository.cs | 10 ---- .../Volo/Abp/TenantManagement/TenantStore.cs | 28 ---------- 9 files changed, 2 insertions(+), 120 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs index 236387823c..b382655d8b 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs @@ -83,62 +83,6 @@ namespace Volo.Abp.AspNetCore.Mvc.Client return tenantConfiguration; } - public TenantConfiguration Find(string name) - { - var cacheKey = CreateCacheKey(name); - var httpContext = HttpContextAccessor?.HttpContext; - - if (httpContext != null && httpContext.Items[cacheKey] is TenantConfiguration tenantConfiguration) - { - return tenantConfiguration; - } - - tenantConfiguration = Cache.GetOrAdd( - cacheKey, - () => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByNameAsync(name))), - () => new DistributedCacheEntryOptions - { - AbsoluteExpirationRelativeToNow = - TimeSpan.FromMinutes(5) //TODO: Should be configurable. - } - ); - - if (httpContext != null) - { - httpContext.Items[cacheKey] = tenantConfiguration; - } - - return tenantConfiguration; - } - - public TenantConfiguration Find(Guid id) - { - var cacheKey = CreateCacheKey(id); - var httpContext = HttpContextAccessor?.HttpContext; - - if (httpContext != null && httpContext.Items[cacheKey] is TenantConfiguration tenantConfiguration) - { - return tenantConfiguration; - } - - tenantConfiguration = Cache.GetOrAdd( - cacheKey, - () => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByIdAsync(id))), - () => new DistributedCacheEntryOptions - { - AbsoluteExpirationRelativeToNow = - TimeSpan.FromMinutes(5) //TODO: Should be configurable. - } - ); - - if (httpContext != null) - { - httpContext.Items[cacheKey] = tenantConfiguration; - } - - return tenantConfiguration; - } - protected virtual TenantConfiguration CreateTenantConfiguration(FindTenantResultDto tenantResultDto) { if (!tenantResultDto.Success || tenantResultDto.TenantId == null) diff --git a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/ITenantStore.cs b/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/ITenantStore.cs index 7125a97405..b1c8f97f1a 100644 --- a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/ITenantStore.cs +++ b/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/ITenantStore.cs @@ -8,9 +8,5 @@ namespace Volo.Abp.MultiTenancy Task FindAsync(string name); Task FindAsync(Guid id); - - TenantConfiguration Find(string name); - - TenantConfiguration Find(Guid id); } } \ No newline at end of file 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 d92409fe0d..fcae880970 100644 --- a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs +++ b/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; +using Volo.Abp.Threading; namespace Volo.Abp.MultiTenancy { @@ -37,7 +38,7 @@ namespace Volo.Abp.MultiTenancy .ServiceProvider .GetRequiredService(); - var tenant = tenantStore.Find(_currentTenant.Id.Value); + var tenant = AsyncHelper.RunSync(() => tenantStore.FindAsync(_currentTenant.Id.Value)); if (tenant?.ConnectionStrings == null) { diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs index db6f5cc486..b8d30b6940 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs @@ -34,13 +34,6 @@ namespace Volo.Abp.BackgroundJobs ); } - public List GetWaitingJobs(int maxResultCount) - { - return ObjectMapper.Map, List>( - BackgroundJobRepository.GetWaitingList(maxResultCount) - ); - } - public virtual async Task> GetWaitingJobsAsync(int maxResultCount) { return ObjectMapper.Map, List>( diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/IBackgroundJobRepository.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/IBackgroundJobRepository.cs index a34cbd6abb..e12aeff70a 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/IBackgroundJobRepository.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/IBackgroundJobRepository.cs @@ -7,8 +7,6 @@ namespace Volo.Abp.BackgroundJobs { public interface IBackgroundJobRepository : IBasicRepository { - List GetWaitingList(int maxResultCount); - Task> GetWaitingListAsync(int maxResultCount); } } \ No newline at end of file diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/EfCoreBackgroundJobRepository.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/EfCoreBackgroundJobRepository.cs index 8128d18bfb..8c786c9f37 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/EfCoreBackgroundJobRepository.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/EfCoreBackgroundJobRepository.cs @@ -21,12 +21,6 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore Clock = clock; } - public List GetWaitingList(int maxResultCount) - { - return GetWaitingListQuery(maxResultCount) - .ToList(); - } - public async Task> GetWaitingListAsync(int maxResultCount) { return await GetWaitingListQuery(maxResultCount) diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/MongoBackgroundJobRepository.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/MongoBackgroundJobRepository.cs index fe3ffa7e07..33903c1e9f 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/MongoBackgroundJobRepository.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/MongoBackgroundJobRepository.cs @@ -21,12 +21,6 @@ namespace Volo.Abp.BackgroundJobs.MongoDB Clock = clock; } - public List GetWaitingList(int maxResultCount) - { - return GetWaitingListQuery(maxResultCount) - .ToList(); - } - public async Task> GetWaitingListAsync(int maxResultCount) { return await GetWaitingListQuery(maxResultCount) diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs index 1feca866a2..90a4440fe8 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs @@ -13,16 +13,6 @@ namespace Volo.Abp.TenantManagement bool includeDetails = true, CancellationToken cancellationToken = default); - Tenant FindByName( - string name, - bool includeDetails = true - ); - - Tenant FindById( - Guid id, - bool includeDetails = true - ); - Task> GetListAsync( string sorting = null, int maxResultCount = int.MaxValue, diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs index afa9af0cf2..0e5cf9d95b 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs @@ -51,33 +51,5 @@ namespace Volo.Abp.TenantManagement return _objectMapper.Map(tenant); } } - - public TenantConfiguration Find(string name) - { - using (_currentTenant.Change(null)) //TODO: No need this if we can implement to define host side (or tenant-independent) entities! - { - var tenant = _tenantRepository.FindByName(name); - if (tenant == null) - { - return null; - } - - return _objectMapper.Map(tenant); - } - } - - public TenantConfiguration Find(Guid id) - { - using (_currentTenant.Change(null)) //TODO: No need this if we can implement to define host side (or tenant-independent) entities! - { - var tenant = _tenantRepository.FindById(id); - if (tenant == null) - { - return null; - } - - return _objectMapper.Map(tenant); - } - } } } From ee403c37e9e9162dd100c3c4291bee545822985b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 26 Dec 2019 08:25:23 +0300 Subject: [PATCH 089/105] Resolved #2467: Add MaxMaxResultCount to LimitedResultRequestDto. --- .../Application/Dtos/ILimitedResultRequest.cs | 3 +- .../Dtos/LimitedResultRequestDto.cs | 24 +++++++++++++- .../Volo.Abp.Validation.Tests.csproj | 1 + .../ApplicationService_Validation_Tests.cs | 32 +++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ILimitedResultRequest.cs b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ILimitedResultRequest.cs index d0088fe155..36af42363c 100644 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ILimitedResultRequest.cs +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ILimitedResultRequest.cs @@ -6,7 +6,8 @@ namespace Volo.Abp.Application.Dtos public interface ILimitedResultRequest { /// - /// Max expected result count. + /// Maximum result count should be returned. + /// This is generally used to limit result count on paging. /// int MaxResultCount { get; set; } } diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs index 0931d090f3..2273f384b7 100644 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace Volo.Abp.Application.Dtos @@ -7,11 +8,32 @@ namespace Volo.Abp.Application.Dtos /// Simply implements . ///
[Serializable] - public class LimitedResultRequestDto : ILimitedResultRequest + public class LimitedResultRequestDto : ILimitedResultRequest, IValidatableObject { + /// + /// Default value: 10. + /// public static int DefaultMaxResultCount { get; set; } = 10; + /// + /// Maximum possible value of the . + /// Default value: 1,000. + /// + public static int MaxMaxResultCount { get; set; } = 1000; + + /// + /// Maximum result count should be returned. + /// This is generally used to limit result count on paging. + /// [Range(1, int.MaxValue)] public virtual int MaxResultCount { get; set; } = DefaultMaxResultCount; + + public virtual IEnumerable Validate(ValidationContext validationContext) + { + if (MaxResultCount > MaxMaxResultCount) + { + yield return new ValidationResult($"{nameof(MaxResultCount)} can not be more than {MaxMaxResultCount}! Increase {typeof(LimitedResultRequestDto).FullName}.{nameof(MaxMaxResultCount)} on the server side to allow more results.", new []{nameof(MaxResultCount)}); + } + } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj b/framework/test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj index b86adccff8..ac14edcfb2 100644 --- a/framework/test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj +++ b/framework/test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj @@ -9,6 +9,7 @@ + diff --git a/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs b/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs index 4035f2d371..2028ea60ca 100644 --- a/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs +++ b/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs @@ -1,9 +1,11 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Shouldly; +using Volo.Abp.Application.Dtos; using Volo.Abp.Autofac; using Volo.Abp.DependencyInjection; using Volo.Abp.Modularity; @@ -135,6 +137,30 @@ namespace Volo.Abp.Validation }); } + //TODO: Create a Volo.Abp.Ddd.Application.Contracts.Tests project and move this to there and remove Volo.Abp.Ddd.Application.Contracts dependency from this project. + [Fact] + public async Task LimitedResultRequestDto_Should_Throw_Exception_For_Requests_More_Than_MaxMaxResultCount() + { + var exception = await Assert.ThrowsAsync(async () => + { + await _myAppService.MyMethodWithLimitedResult(new LimitedResultRequestDto + { + MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount + 1 + }); + }); + + exception.ValidationErrors.ShouldContain(e => e.MemberNames.Contains(nameof(LimitedResultRequestDto.MaxResultCount))); + } + + [Fact] + public async Task LimitedResultRequestDto_Should_Be_Valid_For_Requests_Less_Than_MaxMaxResultCount() + { + await _myAppService.MyMethodWithLimitedResult(new LimitedResultRequestDto + { + MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount -1 + }); + } + [Fact] public async Task Should_Stop_Recursive_Validation_In_A_Constant_Depth() { @@ -195,6 +221,7 @@ namespace Volo.Abp.Validation Task MyMethod6(MyMethod6Input input); Task MyMethod8(MyClassWithRecursiveReference input); Task MyMethodWithNullableEnum(MyEnum? value); + Task MyMethodWithLimitedResult(LimitedResultRequestDto input); } public class MyAppService : IMyAppService, ITransientDependency @@ -240,6 +267,11 @@ namespace Volo.Abp.Validation return Task.FromResult(new MyMethodOutput { Result = 42 }); } + public Task MyMethodWithLimitedResult(LimitedResultRequestDto input) + { + return Task.CompletedTask; + } + public Task MyMethodWithNullableEnum(MyEnum? value) { return Task.CompletedTask; From 5722c99727af89c3a9bc3651051e518c747dc04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 26 Dec 2019 08:32:13 +0300 Subject: [PATCH 090/105] Remove unused methods from InMemoryBackgroundJobStore --- .../InMemoryBackgroundJobStore.cs | 35 +------------------ 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/InMemoryBackgroundJobStore.cs b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/InMemoryBackgroundJobStore.cs index 30dd7fe090..cafe75b539 100644 --- a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/InMemoryBackgroundJobStore.cs +++ b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/InMemoryBackgroundJobStore.cs @@ -23,21 +23,11 @@ namespace Volo.Abp.BackgroundJobs _jobs = new ConcurrentDictionary(); } - public BackgroundJobInfo Find(Guid jobId) - { - return _jobs.GetOrDefault(jobId); - } - public virtual Task FindAsync(Guid jobId) { return Task.FromResult(_jobs.GetOrDefault(jobId)); } - public void Insert(BackgroundJobInfo jobInfo) - { - _jobs[jobInfo.Id] = jobInfo; - } - public virtual Task InsertAsync(BackgroundJobInfo jobInfo) { _jobs[jobInfo.Id] = jobInfo; @@ -45,17 +35,6 @@ namespace Volo.Abp.BackgroundJobs return Task.FromResult(0); } - public List GetWaitingJobs(int maxResultCount) - { - return _jobs.Values - .Where(t => !t.IsAbandoned && t.NextTryTime <= Clock.Now) - .OrderByDescending(t => t.Priority) - .ThenBy(t => t.TryCount) - .ThenBy(t => t.NextTryTime) - .Take(maxResultCount) - .ToList(); - } - public virtual Task> GetWaitingJobsAsync(int maxResultCount) { var waitingJobs = _jobs.Values @@ -69,10 +48,6 @@ namespace Volo.Abp.BackgroundJobs return Task.FromResult(waitingJobs); } - public void Delete(Guid jobId) - { - _jobs.TryRemove(jobId, out _); - } public virtual Task DeleteAsync(Guid jobId) { @@ -80,15 +55,7 @@ namespace Volo.Abp.BackgroundJobs return Task.FromResult(0); } - - public void Update(BackgroundJobInfo jobInfo) - { - if (jobInfo.IsAbandoned) - { - DeleteAsync(jobInfo.Id); - } - } - + public virtual Task UpdateAsync(BackgroundJobInfo jobInfo) { if (jobInfo.IsAbandoned) From a72fb4e567914fe121553d8b49bff4fc89a526cb Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 26 Dec 2019 13:51:56 +0800 Subject: [PATCH 091/105] Cancel changes to the tenant module. --- .../Mvc/Client/RemoteTenantStore.cs | 56 +++++++++++++++++++ .../Volo/Abp/MultiTenancy/ITenantStore.cs | 4 ++ .../MultiTenantConnectionStringResolver.cs | 3 +- .../Abp/TenantManagement/ITenantRepository.cs | 10 ++++ .../Volo/Abp/TenantManagement/TenantStore.cs | 28 ++++++++++ 5 files changed, 99 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs index b382655d8b..236387823c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs @@ -83,6 +83,62 @@ namespace Volo.Abp.AspNetCore.Mvc.Client return tenantConfiguration; } + public TenantConfiguration Find(string name) + { + var cacheKey = CreateCacheKey(name); + var httpContext = HttpContextAccessor?.HttpContext; + + if (httpContext != null && httpContext.Items[cacheKey] is TenantConfiguration tenantConfiguration) + { + return tenantConfiguration; + } + + tenantConfiguration = Cache.GetOrAdd( + cacheKey, + () => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByNameAsync(name))), + () => new DistributedCacheEntryOptions + { + AbsoluteExpirationRelativeToNow = + TimeSpan.FromMinutes(5) //TODO: Should be configurable. + } + ); + + if (httpContext != null) + { + httpContext.Items[cacheKey] = tenantConfiguration; + } + + return tenantConfiguration; + } + + public TenantConfiguration Find(Guid id) + { + var cacheKey = CreateCacheKey(id); + var httpContext = HttpContextAccessor?.HttpContext; + + if (httpContext != null && httpContext.Items[cacheKey] is TenantConfiguration tenantConfiguration) + { + return tenantConfiguration; + } + + tenantConfiguration = Cache.GetOrAdd( + cacheKey, + () => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByIdAsync(id))), + () => new DistributedCacheEntryOptions + { + AbsoluteExpirationRelativeToNow = + TimeSpan.FromMinutes(5) //TODO: Should be configurable. + } + ); + + if (httpContext != null) + { + httpContext.Items[cacheKey] = tenantConfiguration; + } + + return tenantConfiguration; + } + protected virtual TenantConfiguration CreateTenantConfiguration(FindTenantResultDto tenantResultDto) { if (!tenantResultDto.Success || tenantResultDto.TenantId == null) diff --git a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/ITenantStore.cs b/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/ITenantStore.cs index b1c8f97f1a..7125a97405 100644 --- a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/ITenantStore.cs +++ b/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/ITenantStore.cs @@ -8,5 +8,9 @@ namespace Volo.Abp.MultiTenancy Task FindAsync(string name); Task FindAsync(Guid id); + + TenantConfiguration Find(string name); + + TenantConfiguration Find(Guid id); } } \ No newline at end of file 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 fcae880970..d92409fe0d 100644 --- a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs +++ b/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs @@ -4,7 +4,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; -using Volo.Abp.Threading; namespace Volo.Abp.MultiTenancy { @@ -38,7 +37,7 @@ namespace Volo.Abp.MultiTenancy .ServiceProvider .GetRequiredService(); - var tenant = AsyncHelper.RunSync(() => tenantStore.FindAsync(_currentTenant.Id.Value)); + var tenant = tenantStore.Find(_currentTenant.Id.Value); if (tenant?.ConnectionStrings == null) { diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs index 90a4440fe8..1feca866a2 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs @@ -13,6 +13,16 @@ namespace Volo.Abp.TenantManagement bool includeDetails = true, CancellationToken cancellationToken = default); + Tenant FindByName( + string name, + bool includeDetails = true + ); + + Tenant FindById( + Guid id, + bool includeDetails = true + ); + Task> GetListAsync( string sorting = null, int maxResultCount = int.MaxValue, diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs index 0e5cf9d95b..afa9af0cf2 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs @@ -51,5 +51,33 @@ namespace Volo.Abp.TenantManagement return _objectMapper.Map(tenant); } } + + public TenantConfiguration Find(string name) + { + using (_currentTenant.Change(null)) //TODO: No need this if we can implement to define host side (or tenant-independent) entities! + { + var tenant = _tenantRepository.FindByName(name); + if (tenant == null) + { + return null; + } + + return _objectMapper.Map(tenant); + } + } + + public TenantConfiguration Find(Guid id) + { + using (_currentTenant.Change(null)) //TODO: No need this if we can implement to define host side (or tenant-independent) entities! + { + var tenant = _tenantRepository.FindById(id); + if (tenant == null) + { + return null; + } + + return _objectMapper.Map(tenant); + } + } } } From dc07f3b7001a4b233b243f931a337099c54d32c4 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 26 Dec 2019 15:52:39 +0800 Subject: [PATCH 092/105] Update Part-I.md --- docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-I.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-I.md b/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-I.md index c9a56447ba..f9314e5030 100644 --- a/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-I.md +++ b/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-I.md @@ -225,7 +225,7 @@ using Volo.Abp.Application.Services; namespace Acme.BookStore { public interface IBookAppService : - IAsyncCrudAppService< //定义了CRUD方法 + ICrudAppService< //定义了CRUD方法 BookDto, //用来展示书籍 Guid, //Book实体的主键 PagedAndSortedResultRequestDto, //获取书籍的时候用于分页和排序 @@ -238,8 +238,8 @@ namespace Acme.BookStore ```` * 框架定义应用程序服务的接口不是必需的. 但是,它被建议作为最佳实践. -* `IAsyncCrudAppService`定义了常见的**CRUD**方法:`GetAsync`,`GetListAsync`,`CreateAsync`,`UpdateAsync`和`DeleteAsync`. 你可以从空的`IApplicationService`接口继承并手动定义自己的方法. -* `IAsyncCrudAppService`有一些变体, 你可以在每个方法中使用单独的DTO,也可以分别单独指定. +* `ICrudAppService`定义了常见的**CRUD**方法:`GetAsync`,`GetListAsync`,`CreateAsync`,`UpdateAsync`和`DeleteAsync`. 你可以从空的`IApplicationService`接口继承并手动定义自己的方法. +* `ICrudAppService`有一些变体, 你可以在每个方法中使用单独的DTO,也可以分别单独指定. #### BookAppService @@ -255,7 +255,7 @@ using Volo.Abp.Domain.Repositories; namespace Acme.BookStore { public class BookAppService : - AsyncCrudAppService, IBookAppService { @@ -268,7 +268,7 @@ namespace Acme.BookStore } ```` -* `BookAppService`继承了`AsyncCrudAppService<...>`.`AsyncCrudAppService<...>`实现了上面定义的CRUD方法. +* `BookAppService`继承了`CrudAppService<...>`.它实现了上面定义的CRUD方法. * `BookAppService`注入`IRepository `,这是`Book`实体的默认仓储. ABP自动为每个聚合根(或实体)创建默认仓储. 请参阅[仓储文档](../../Repositories.md) * `BookAppService`使用`IObjectMapper`将`Book`对象转换为`BookDto`对象, 将`CreateUpdateBookDto`对象转换为`Book`对象. 启动模板使用[AutoMapper](http://automapper.org/)库作为对象映射提供程序. 你之前定义了映射, 因此它将按预期工作. From f703db96e50bf149e04ef17cde67efbd760dbcde Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 26 Dec 2019 11:53:40 +0300 Subject: [PATCH 093/105] Localize exception message on LimitedResultRequestDto resolves https://github.com/abpframework/abp/issues/2468 --- .../Volo.Abp.Ddd.Application.Contracts.csproj | 7 +++++++ .../Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs | 8 +++++++- .../Application/Localization/AbpValidationResource.cs | 9 +++++++++ .../Volo/Abp/Application/Localization/en.json | 6 ++++++ .../Volo/Abp/Application/Localization/tr.json | 6 ++++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/AbpValidationResource.cs create mode 100644 framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/en.json create mode 100644 framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/tr.json diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj index 0b6eaee362..3aae9522d5 100644 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj @@ -13,8 +13,15 @@ + + + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs index 2273f384b7..a5f058437e 100644 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using Microsoft.Extensions.Localization; +using Volo.Abp.Application.Localization; namespace Volo.Abp.Application.Dtos { @@ -30,9 +32,13 @@ namespace Volo.Abp.Application.Dtos public virtual IEnumerable Validate(ValidationContext validationContext) { + var l = validationContext.GetService(typeof(IStringLocalizer)) as IStringLocalizer; + if (MaxResultCount > MaxMaxResultCount) { - yield return new ValidationResult($"{nameof(MaxResultCount)} can not be more than {MaxMaxResultCount}! Increase {typeof(LimitedResultRequestDto).FullName}.{nameof(MaxMaxResultCount)} on the server side to allow more results.", new []{nameof(MaxResultCount)}); + yield return new ValidationResult( + errorMessage:l?["MaxResultCountExceededExceptionMessage", nameof(MaxResultCount), MaxMaxResultCount, typeof(LimitedResultRequestDto).FullName, nameof(MaxMaxResultCount)], + new []{nameof(MaxResultCount)}); } } } diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/AbpValidationResource.cs b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/AbpValidationResource.cs new file mode 100644 index 0000000000..412a68287f --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/AbpValidationResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace Volo.Abp.Application.Localization +{ + [LocalizationResourceName("AbpValidation")] + public class AbpValidationResource + { + } +} diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/en.json b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/en.json new file mode 100644 index 0000000000..2c514e6c18 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/en.json @@ -0,0 +1,6 @@ +{ + "culture": "en", + "texts": { + "MaxResultCountExceededExceptionMessage": "{0} can not be more than {1}! Increase {2}.{3} on the server side to allow more results." + } +} diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/tr.json b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/tr.json new file mode 100644 index 0000000000..428f348427 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/tr.json @@ -0,0 +1,6 @@ +{ + "culture": "tr", + "texts": { + "MaxResultCountExceededExceptionMessage": "{0} en fazla {1} olabilir, daha büyük olamaz! Daha fazla sonuca izin vermek için {2}.{3}'ü sunucu tarafında artırın." + } +} \ No newline at end of file From a6b48ab4fe3afe56acfe59c2711278b94b4f77ba Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 26 Dec 2019 14:29:58 +0300 Subject: [PATCH 094/105] Localize exception message on LimitedResultRequestDto cont. --- .../Volo.Abp.Ddd.Application.Contracts.csproj | 3 +-- .../AbpDddApplicationContractsModule.cs | 22 +++++++++++++++++-- .../Dtos/LimitedResultRequestDto.cs | 4 ++-- .../Localization/AbpValidationResource.cs | 9 -------- .../Resources/AbpDdd/AbpDddResource.cs | 9 ++++++++ .../{ => Resources/AbpDdd}/en.json | 0 .../{ => Resources/AbpDdd}/tr.json | 0 7 files changed, 32 insertions(+), 15 deletions(-) delete mode 100644 framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/AbpValidationResource.cs create mode 100644 framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/AbpDddResource.cs rename framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/{ => Resources/AbpDdd}/en.json (100%) rename framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/{ => Resources/AbpDdd}/tr.json (100%) diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj index 3aae9522d5..6f1674f8ce 100644 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj @@ -14,8 +14,7 @@ - - + diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/AbpDddApplicationContractsModule.cs b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/AbpDddApplicationContractsModule.cs index e107072221..3166152e89 100644 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/AbpDddApplicationContractsModule.cs +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/AbpDddApplicationContractsModule.cs @@ -1,12 +1,30 @@ -using Volo.Abp.Auditing; +using Volo.Abp.Application.Localization.Resources.AbpDdd; +using Volo.Abp.Auditing; +using Volo.Abp.Localization; using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.Application { [DependsOn( - typeof(AbpAuditingModule) + typeof(AbpAuditingModule), + typeof(AbpLocalizationModule) )] public class AbpDddApplicationContractsModule : AbpModule { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/Volo/Abp/Application/Localization/Resources/AbpDdd"); + }); + } } } diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs index a5f058437e..9e4375051d 100644 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Microsoft.Extensions.Localization; -using Volo.Abp.Application.Localization; +using Volo.Abp.Application.Localization.Resources.AbpDdd; namespace Volo.Abp.Application.Dtos { @@ -32,7 +32,7 @@ namespace Volo.Abp.Application.Dtos public virtual IEnumerable Validate(ValidationContext validationContext) { - var l = validationContext.GetService(typeof(IStringLocalizer)) as IStringLocalizer; + var l = validationContext.GetService(typeof(IStringLocalizer)) as IStringLocalizer; if (MaxResultCount > MaxMaxResultCount) { diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/AbpValidationResource.cs b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/AbpValidationResource.cs deleted file mode 100644 index 412a68287f..0000000000 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/AbpValidationResource.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Volo.Abp.Localization; - -namespace Volo.Abp.Application.Localization -{ - [LocalizationResourceName("AbpValidation")] - public class AbpValidationResource - { - } -} diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/AbpDddResource.cs b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/AbpDddResource.cs new file mode 100644 index 0000000000..666a962a22 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/AbpDddResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace Volo.Abp.Application.Localization.Resources.AbpDdd +{ + [LocalizationResourceName("AbpDdd")] + public class AbpDddResource + { + } +} diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/en.json b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/en.json similarity index 100% rename from framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/en.json rename to framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/en.json diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/tr.json b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/tr.json similarity index 100% rename from framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/tr.json rename to framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/tr.json From ec67983c6f5aeb110bf89f625141b7418a5fc6ab Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 26 Dec 2019 14:48:24 +0300 Subject: [PATCH 095/105] remove int.MaxValue usages for limitedrequestdtos --- .../Pages/Identity/Users/CreateModal.cshtml.cs | 5 +---- .../Pages/Identity/Users/EditModal.cshtml.cs | 5 +---- .../Volo/Abp/Identity/IdentityRoleAppService_Tests.cs | 5 +---- .../Volo/Abp/Identity/IdentityUserRepository_Tests.cs | 2 +- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs index 21e7702814..7b3822e64b 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs @@ -28,10 +28,7 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users { UserInfo = new UserInfoViewModel(); - var roleDtoList = await _identityRoleAppService.GetListAsync(new PagedAndSortedResultRequestDto - { - MaxResultCount = int.MaxValue - }); + var roleDtoList = await _identityRoleAppService.GetListAsync(new PagedAndSortedResultRequestDto()); Roles = ObjectMapper.Map, AssignedRoleViewModel[]>(roleDtoList.Items); diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs index 3bedfaeda2..4d4adf7a70 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs @@ -31,10 +31,7 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users UserInfo = ObjectMapper.Map(await _identityUserAppService.GetAsync(id)); Roles = ObjectMapper.Map, AssignedRoleViewModel[]>( - (await _identityRoleAppService.GetListAsync(new PagedAndSortedResultRequestDto - { - MaxResultCount = int.MaxValue - })).Items + (await _identityRoleAppService.GetListAsync(new PagedAndSortedResultRequestDto())).Items ); var userRoleNames = (await _identityUserAppService.GetRolesAsync(UserInfo.Id)).Items.Select(r => r.Name).ToList(); diff --git a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs index b05142c912..663cc07786 100644 --- a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs +++ b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs @@ -39,10 +39,7 @@ namespace Volo.Abp.Identity { //Act - var result = await _roleAppService.GetListAsync(new PagedAndSortedResultRequestDto - { - MaxResultCount = int.MaxValue - }); + var result = await _roleAppService.GetListAsync(new PagedAndSortedResultRequestDto()); //Assert diff --git a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityUserRepository_Tests.cs b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityUserRepository_Tests.cs index dca811da0b..4fa407a512 100644 --- a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityUserRepository_Tests.cs +++ b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityUserRepository_Tests.cs @@ -107,7 +107,7 @@ namespace Volo.Abp.Identity ).ShouldBeGreaterThan(0); } - users = await UserRepository.GetListAsync(null, int.MaxValue, 0, "undefined-username"); + users = await UserRepository.GetListAsync(null, 999, 0, "undefined-username"); users.Count.ShouldBe(0); } From 65cd3ea8ab7b919cf4ff958dd272415b38ad7926 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 27 Dec 2019 08:39:58 +0800 Subject: [PATCH 096/105] Localize exception message on limited result request dto. --- .../Application/Localization/Resources/AbpDdd/zh-Hans.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/zh-Hans.json diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/zh-Hans.json b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/zh-Hans.json new file mode 100644 index 0000000000..0bc563e702 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/zh-Hans.json @@ -0,0 +1,6 @@ +{ + "culture": "zh-Hans", + "texts": { + "MaxResultCountExceededExceptionMessage": "{0}不能超过 {1}! 在服务器端增加{2}.{3}以获得更多结果." + } +} From 712cfd56d3b818f2b06e76733de0da516b56ca02 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 27 Dec 2019 10:16:35 +0300 Subject: [PATCH 097/105] Update FeatureManagementModal.cshtml --- .../Pages/FeatureManagement/FeatureManagementModal.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml index 59e80e236c..221b46bea6 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml @@ -24,7 +24,7 @@ @feature.Name - + @if (feature.ValueType is FreeTextStringValueType) { From abc2b3594302bfa49dbe4d715074814fb69bb6fe Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 27 Dec 2019 14:25:54 +0300 Subject: [PATCH 098/105] docs: add and describe a new commit type --- npm/ng-packs/CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/npm/ng-packs/CONTRIBUTING.md b/npm/ng-packs/CONTRIBUTING.md index caee183dd0..76a18c04c3 100644 --- a/npm/ng-packs/CONTRIBUTING.md +++ b/npm/ng-packs/CONTRIBUTING.md @@ -76,6 +76,7 @@ Must be one of the following: - **refactor**: A code change that neither fixes a bug nor adds a feature - **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) - **test**: Adding missing tests or correcting existing tests +- **chore**: Other changes that don't modify src or test files ### Scope From f1d0ebae856406213023af11632ed72849928b3e Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 27 Dec 2019 15:04:59 +0300 Subject: [PATCH 099/105] refactor!: remove deprecated functions, outputs, inputs etc. The functions, outputs and inputs that deprecated before version 2.0 are not available in version 2.0 and later. BREAKING CHANGE: Deprecated functions, outputs, inputs addressed in issue #2476 are removed. Closes #2476 --- .../account/src/lib/account.module.ts | 24 +++++--------- .../account/src/lib/constants/routes.ts | 17 ---------- .../packages/account/src/public-api.ts | 1 - .../packages/core/src/lib/enums/common.ts | 4 --- .../identity/src/lib/constants/routes.ts | 28 ----------------- .../identity/src/lib/identity.module.ts | 8 ----- .../packages/identity/src/public-api.ts | 1 - .../src/lib/constants/index.ts | 1 - .../src/lib/constants/routes.ts | 25 --------------- .../src/lib/tenant-management.module.ts | 8 ----- .../tenant-management/src/public-api.ts | 1 - .../lib/components/button/button.component.ts | 24 ++------------ .../sort-order-icon.component.ts | 31 ++----------------- .../src/lib/models/confirmation.ts | 8 ----- 14 files changed, 13 insertions(+), 168 deletions(-) delete mode 100644 npm/ng-packs/packages/account/src/lib/constants/routes.ts delete mode 100644 npm/ng-packs/packages/identity/src/lib/constants/routes.ts delete mode 100644 npm/ng-packs/packages/tenant-management/src/lib/constants/index.ts delete mode 100644 npm/ng-packs/packages/tenant-management/src/lib/constants/routes.ts diff --git a/npm/ng-packs/packages/account/src/lib/account.module.ts b/npm/ng-packs/packages/account/src/lib/account.module.ts index 341f687d60..3923ff4e17 100644 --- a/npm/ng-packs/packages/account/src/lib/account.module.ts +++ b/npm/ng-packs/packages/account/src/lib/account.module.ts @@ -25,22 +25,14 @@ import { AuthWrapperComponent } from './components/auth-wrapper/auth-wrapper.com ManageProfileComponent, PersonalSettingsComponent, ], - imports: [CoreModule, AccountRoutingModule, ThemeSharedModule, TableModule, NgbDropdownModule, NgxValidateCoreModule], + imports: [ + CoreModule, + AccountRoutingModule, + ThemeSharedModule, + TableModule, + NgbDropdownModule, + NgxValidateCoreModule, + ], exports: [], }) export class AccountModule {} - -/** - * - * @deprecated since version 0.9 - */ -export function AccountProviders(options = {} as Options): Provider[] { - return [ - { provide: ACCOUNT_OPTIONS, useValue: options }, - { - provide: 'ACCOUNT_OPTIONS', - useFactory: optionsFactory, - deps: [ACCOUNT_OPTIONS], - }, - ]; -} diff --git a/npm/ng-packs/packages/account/src/lib/constants/routes.ts b/npm/ng-packs/packages/account/src/lib/constants/routes.ts deleted file mode 100644 index 119bde1e7f..0000000000 --- a/npm/ng-packs/packages/account/src/lib/constants/routes.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ABP, eLayoutType } from '@abp/ng.core'; - -/** - * - * @deprecated since version 0.9 - */ -export const ACCOUNT_ROUTES = { - routes: [ - { - name: 'Account', - path: 'account', - invisible: true, - layout: eLayoutType.application, - children: [{ path: 'login', name: 'Login', order: 1 }, { path: 'register', name: 'Register', order: 2 }], - }, - ] as ABP.FullRoute[], -}; diff --git a/npm/ng-packs/packages/account/src/public-api.ts b/npm/ng-packs/packages/account/src/public-api.ts index c81bfdc9d6..173cb6ea89 100644 --- a/npm/ng-packs/packages/account/src/public-api.ts +++ b/npm/ng-packs/packages/account/src/public-api.ts @@ -1,6 +1,5 @@ export * from './lib/account.module'; export * from './lib/components'; -export * from './lib/constants/routes'; export * from './lib/tokens'; export * from './lib/models'; export * from './lib/services'; diff --git a/npm/ng-packs/packages/core/src/lib/enums/common.ts b/npm/ng-packs/packages/core/src/lib/enums/common.ts index 1ecc29406c..08ddf05b6d 100644 --- a/npm/ng-packs/packages/core/src/lib/enums/common.ts +++ b/npm/ng-packs/packages/core/src/lib/enums/common.ts @@ -2,8 +2,4 @@ export const enum eLayoutType { account = 'account', application = 'application', empty = 'empty', - /** - * @deprecated since version 0.9.0 - */ - setting = 'setting', } diff --git a/npm/ng-packs/packages/identity/src/lib/constants/routes.ts b/npm/ng-packs/packages/identity/src/lib/constants/routes.ts deleted file mode 100644 index 1dfc53245e..0000000000 --- a/npm/ng-packs/packages/identity/src/lib/constants/routes.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { eLayoutType, ABP } from '@abp/ng.core'; - -/** - * - * @deprecated - */ -export const IDENTITY_ROUTES = { - routes: [ - { - name: 'AbpUiNavigation::Menu:Administration', - path: '', - order: 1, - wrapper: true, - }, - { - name: 'AbpIdentity::Menu:IdentityManagement', - path: 'identity', - order: 1, - parentName: 'AbpUiNavigation::Menu:Administration', - layout: eLayoutType.application, - iconClass: 'fa fa-id-card-o', - children: [ - { path: 'roles', name: 'AbpIdentity::Roles', order: 2, requiredPolicy: 'AbpIdentity.Roles' }, - { path: 'users', name: 'AbpIdentity::Users', order: 1, requiredPolicy: 'AbpIdentity.Users' }, - ], - }, - ] as ABP.FullRoute[], -}; diff --git a/npm/ng-packs/packages/identity/src/lib/identity.module.ts b/npm/ng-packs/packages/identity/src/lib/identity.module.ts index 15b1b1c7cb..20a332c6ce 100644 --- a/npm/ng-packs/packages/identity/src/lib/identity.module.ts +++ b/npm/ng-packs/packages/identity/src/lib/identity.module.ts @@ -26,11 +26,3 @@ import { NgxValidateCoreModule } from '@ngx-validate/core'; ], }) export class IdentityModule {} - -/** - * - * @deprecated - */ -export function IdentityProviders(): Provider[] { - return []; -} diff --git a/npm/ng-packs/packages/identity/src/public-api.ts b/npm/ng-packs/packages/identity/src/public-api.ts index b86c993f13..b401fed1c6 100644 --- a/npm/ng-packs/packages/identity/src/public-api.ts +++ b/npm/ng-packs/packages/identity/src/public-api.ts @@ -5,7 +5,6 @@ export * from './lib/identity.module'; export * from './lib/actions/identity.actions'; export * from './lib/components'; -export * from './lib/constants/routes'; export * from './lib/models/identity'; export * from './lib/services'; export * from './lib/states/identity.state'; diff --git a/npm/ng-packs/packages/tenant-management/src/lib/constants/index.ts b/npm/ng-packs/packages/tenant-management/src/lib/constants/index.ts deleted file mode 100644 index a3820983e2..0000000000 --- a/npm/ng-packs/packages/tenant-management/src/lib/constants/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './routes'; diff --git a/npm/ng-packs/packages/tenant-management/src/lib/constants/routes.ts b/npm/ng-packs/packages/tenant-management/src/lib/constants/routes.ts deleted file mode 100644 index ad919c8ee1..0000000000 --- a/npm/ng-packs/packages/tenant-management/src/lib/constants/routes.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ABP, eLayoutType } from '@abp/ng.core'; - -/** - * - * @deprecated since version 0.9.0 - */ -export const TENANT_MANAGEMENT_ROUTES = { - routes: [ - { - name: 'AbpTenantManagement::Menu:TenantManagement', - path: 'tenant-management', - parentName: 'AbpUiNavigation::Menu:Administration', - layout: eLayoutType.application, - iconClass: 'fa fa-users', - children: [ - { - path: 'tenants', - name: 'AbpTenantManagement::Tenants', - order: 1, - requiredPolicy: 'AbpTenantManagement.Tenants', - }, - ], - }, - ] as ABP.FullRoute[], -}; diff --git a/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts b/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts index 5ab4f20716..218eda45fa 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts @@ -24,11 +24,3 @@ import { NgxValidateCoreModule } from '@ngx-validate/core'; ], }) export class TenantManagementModule {} - -/** - * - * @deprecated since version 0.9.0 - */ -export function TenantManagementProviders(): Provider[] { - return []; -} diff --git a/npm/ng-packs/packages/tenant-management/src/public-api.ts b/npm/ng-packs/packages/tenant-management/src/public-api.ts index 67fcf7f195..20cecd353f 100644 --- a/npm/ng-packs/packages/tenant-management/src/public-api.ts +++ b/npm/ng-packs/packages/tenant-management/src/public-api.ts @@ -1,7 +1,6 @@ export * from './lib/tenant-management.module'; export * from './lib/actions'; export * from './lib/components'; -export * from './lib/constants'; export * from './lib/models'; export * from './lib/services'; export * from './lib/states'; diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/button/button.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/button/button.component.ts index 86382b974b..9ff4d1e24e 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/button/button.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/button/button.component.ts @@ -19,9 +19,9 @@ import { ABP } from '@abp/ng.core'; [attr.type]="buttonType" [ngClass]="buttonClass" [disabled]="loading || disabled" - (click.stop)="click.next($event); abpClick.next($event)" - (focus)="focus.next($event); abpFocus.next($event)" - (blur)="blur.next($event); abpBlur.next($event)" + (click.stop)="abpClick.next($event)" + (focus)="abpFocus.next($event)" + (blur)="abpBlur.next($event)" > @@ -49,24 +49,6 @@ export class ButtonComponent implements OnInit { @Input() attributes: ABP.Dictionary; - // tslint:disable - /** - * @deprecated use abpClick instead - */ - @Output() readonly click = new EventEmitter(); - - /** - * @deprecated use abpFocus instead - */ - // tslint:disable-next-line: no-output-native - @Output() readonly focus = new EventEmitter(); - - /** - * @deprecated use abpBlur instead - */ - @Output() readonly blur = new EventEmitter(); - // tslint:enable - @Output() readonly abpClick = new EventEmitter(); @Output() readonly abpFocus = new EventEmitter(); diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/sort-order-icon/sort-order-icon.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/sort-order-icon/sort-order-icon.component.ts index feaad56c5b..1e80f8f585 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/sort-order-icon/sort-order-icon.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/sort-order-icon/sort-order-icon.component.ts @@ -8,17 +8,8 @@ export class SortOrderIconComponent { private _order: 'asc' | 'desc' | ''; private _selectedSortKey: string; - /** - * @deprecated use selectedSortKey instead. - */ @Input() - set selectedKey(value: string) { - this.selectedSortKey = value; - this.selectedKeyChange.emit(value); - } - get selectedKey(): string { - return this._selectedSortKey; - } + sortKey: string; @Input() set selectedSortKey(value: string) { @@ -29,23 +20,6 @@ export class SortOrderIconComponent { return this._selectedSortKey; } - @Output() readonly selectedKeyChange = new EventEmitter(); - @Output() readonly selectedSortKeyChange = new EventEmitter(); - - /** - * @deprecated use sortKey instead. - */ - @Input() - get key(): string { - return this.sortKey; - } - set key(value: string) { - this.sortKey = value; - } - - @Input() - sortKey: string; - @Input() set order(value: 'asc' | 'desc' | '') { this._order = value; @@ -56,6 +30,7 @@ export class SortOrderIconComponent { } @Output() readonly orderChange = new EventEmitter(); + @Output() readonly selectedSortKeyChange = new EventEmitter(); @Input() iconClass: string; @@ -67,7 +42,6 @@ export class SortOrderIconComponent { } sort(key: string) { - this.selectedKey = key; // TODO: To be removed this.selectedSortKey = key; switch (this.order) { case '': @@ -80,7 +54,6 @@ export class SortOrderIconComponent { break; case 'desc': this.order = ''; - this.selectedKey = ''; // TODO: To be removed this.orderChange.emit(''); break; } diff --git a/npm/ng-packs/packages/theme-shared/src/lib/models/confirmation.ts b/npm/ng-packs/packages/theme-shared/src/lib/models/confirmation.ts index c3e203cded..3249860214 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/models/confirmation.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/models/confirmation.ts @@ -7,13 +7,5 @@ export namespace Confirmation { hideYesBtn?: boolean; cancelText?: Config.LocalizationParam; yesText?: Config.LocalizationParam; - /** - * @deprecated to be deleted in v2 - */ - cancelCopy?: Config.LocalizationParam; - /** - * @deprecated to be deleted in v2 - */ - yesCopy?: Config.LocalizationParam; } } From 38662f71074e93f156e12a3e30d3bdb57fea9c28 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 27 Dec 2019 15:13:24 +0300 Subject: [PATCH 100/105] refactor(identity): change sort order icon input --- .../identity/src/lib/components/roles/roles.component.html | 2 +- .../identity/src/lib/components/users/users.component.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html index 99569afefc..0f8a743dae 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html +++ b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html @@ -55,7 +55,7 @@ diff --git a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html index eab3339318..637ffc0778 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html +++ b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html @@ -63,7 +63,7 @@ @@ -72,13 +72,13 @@ {{ 'AbpIdentity::EmailAddress' | abpLocalization }} {{ 'AbpIdentity::PhoneNumber' | abpLocalization }} - + From b63d34cd48ff59b4d5a06eeb1bb33c8506505f5c Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 27 Dec 2019 15:13:44 +0300 Subject: [PATCH 101/105] refactor(tenant-management): change sort order icon input --- .../src/lib/components/tenants/tenants.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html b/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html index 8602c4dc95..203c06e7f9 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html +++ b/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html @@ -63,7 +63,7 @@ From d2f54ef1858410beb3d4bf2ff6326ec2516d554a Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 27 Dec 2019 15:46:06 +0300 Subject: [PATCH 102/105] refactor(identity): change sort order icon key inputs --- .../identity/src/lib/components/roles/roles.component.html | 2 +- .../identity/src/lib/components/users/users.component.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html index 0f8a743dae..0e8bd7ccd4 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html +++ b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html @@ -54,7 +54,7 @@ {{ 'AbpIdentity::RoleName' | abpLocalization }} diff --git a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html index 637ffc0778..9097ca87ea 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html +++ b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html @@ -62,7 +62,7 @@ {{ 'AbpIdentity::UserName' | abpLocalization }} @@ -71,14 +71,14 @@ {{ 'AbpIdentity::EmailAddress' | abpLocalization }} {{ 'AbpIdentity::PhoneNumber' | abpLocalization }} - + From 67f20a6f837f123ce811ce5191d5403b0f4bf0a2 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 27 Dec 2019 15:46:17 +0300 Subject: [PATCH 103/105] refactor(tenant-management): change sort order icon key inputs --- .../src/lib/components/tenants/tenants.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html b/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html index 203c06e7f9..f4ac631533 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html +++ b/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html @@ -62,7 +62,7 @@ {{ 'AbpTenantManagement::TenantName' | abpLocalization }} From 3316bcae977ff33d61dc8eaff796c6f173eb51ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 27 Dec 2019 15:47:00 +0300 Subject: [PATCH 104/105] Revert "AddGlobalFilters method of MongoDbRepository extracted to a service" --- .../MongoDB/IMongoDbRepositoryFilterer.cs | 20 ------ .../Repositories/MongoDB/MongoDbRepository.cs | 55 +++++++++++++-- .../MongoDB/MongoDbRepositoryFilterer.cs | 68 ------------------- 3 files changed, 51 insertions(+), 92 deletions(-) delete mode 100644 framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepositoryFilterer.cs delete mode 100644 framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepositoryFilterer.cs 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 deleted file mode 100644 index 680afce38f..0000000000 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepositoryFilterer.cs +++ /dev/null @@ -1,20 +0,0 @@ -using MongoDB.Driver; -using System.Collections.Generic; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.Domain.Repositories.MongoDB -{ - public interface IMongoDbRepositoryFilterer - where TEntity : class, IEntity - { - void AddGlobalFilters(List> filters); - } - - public interface IMongoDbRepositoryFilterer : IMongoDbRepositoryFilterer - where TEntity : class, IEntity - { - FilterDefinition CreateEntityFilter(TKey id, bool applyFilters = false); - - FilterDefinition CreateEntityFilter(TEntity entity, bool withConcurrencyStamp = false, string concurrencyStamp = null); - } -} 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 454345dacf..4e8ccaa82e 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 @@ -14,6 +14,8 @@ using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Local; using Volo.Abp.Guids; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Reflection; using Volo.Abp.Threading; namespace Volo.Abp.Domain.Repositories.MongoDB @@ -311,8 +313,6 @@ namespace Volo.Abp.Domain.Repositories.MongoDB where TMongoDbContext : IAbpMongoDbContext where TEntity : class, IEntity { - public virtual IMongoDbRepositoryFilterer RepositoryFilterer { get; set; } - public MongoDbRepository(IMongoDbContextProvider dbContextProvider) : base(dbContextProvider) { @@ -340,7 +340,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB CancellationToken cancellationToken = default) { return await Collection - .Find(RepositoryFilterer.CreateEntityFilter(id, true)) + .Find(CreateEntityFilter(id, true)) .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } @@ -350,9 +350,56 @@ namespace Volo.Abp.Domain.Repositories.MongoDB CancellationToken cancellationToken = default) { return Collection.DeleteOneAsync( - RepositoryFilterer.CreateEntityFilter(id), + CreateEntityFilter(id), GetCancellationToken(cancellationToken) ); } + + protected override FilterDefinition CreateEntityFilter(TEntity entity, bool withConcurrencyStamp = false, string concurrencyStamp = null) + { + if (!withConcurrencyStamp || !(entity is IHasConcurrencyStamp entityWithConcurrencyStamp)) + { + return Builders.Filter.Eq(e => e.Id, entity.Id); + } + + if (concurrencyStamp == null) + { + concurrencyStamp = entityWithConcurrencyStamp.ConcurrencyStamp; + } + + return Builders.Filter.And( + Builders.Filter.Eq(e => e.Id, entity.Id), + Builders.Filter.Eq(e => ((IHasConcurrencyStamp)e).ConcurrencyStamp, concurrencyStamp) + ); + } + + protected virtual FilterDefinition CreateEntityFilter(TKey id, bool applyFilters = false) + { + var filters = new List> + { + Builders.Filter.Eq(e => e.Id, id) + }; + + if (applyFilters) + { + AddGlobalFilters(filters); + } + + return Builders.Filter.And(filters); + } + + protected virtual void AddGlobalFilters(List> filters) + { + if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)) && DataFilter.IsEnabled()) + { + 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)); + } + } } } \ 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 deleted file mode 100644 index 5222121cab..0000000000 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepositoryFilterer.cs +++ /dev/null @@ -1,68 +0,0 @@ -using MongoDB.Driver; -using System.Collections.Generic; -using Volo.Abp.Data; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.Domain.Repositories.MongoDB -{ - public class MongoDbRepositoryFilterer : IMongoDbRepositoryFilterer, ITransientDependency - where TEntity : class, IEntity - { - public IDataFilter DataFilter { get; set; } - - public ICurrentTenant CurrentTenant { get; set; } - - public void AddGlobalFilters(List> filters) - { - if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)) && DataFilter.IsEnabled()) - { - 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)); - } - } - } - - public class MongoDbRepositoryFilterer : MongoDbRepositoryFilterer, IMongoDbRepositoryFilterer, ITransientDependency - where TEntity : class, IEntity - { - public FilterDefinition CreateEntityFilter(TKey id, bool applyFilters = false) - { - var filters = new List> - { - Builders.Filter.Eq(e => e.Id, id) - }; - - if (applyFilters) - { - AddGlobalFilters(filters); - } - - return Builders.Filter.And(filters); - } - - public FilterDefinition CreateEntityFilter(TEntity entity, bool withConcurrencyStamp = false, string concurrencyStamp = null) - { - if (!withConcurrencyStamp || !(entity is IHasConcurrencyStamp entityWithConcurrencyStamp)) - { - return Builders.Filter.Eq(e => e.Id, entity.Id); - } - - if (concurrencyStamp == null) - { - concurrencyStamp = entityWithConcurrencyStamp.ConcurrencyStamp; - } - - return Builders.Filter.And( - Builders.Filter.Eq(e => e.Id, entity.Id), - Builders.Filter.Eq(e => ((IHasConcurrencyStamp)e).ConcurrencyStamp, concurrencyStamp) - ); - } - } -} From 3a32436aaa0207bb362142235c547cb6899e377e Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Fri, 27 Dec 2019 16:03:10 +0300 Subject: [PATCH 105/105] test(theme-shared): correct test host component input --- .../src/lib/tests/sort-order-icon.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/tests/sort-order-icon.component.spec.ts b/npm/ng-packs/packages/theme-shared/src/lib/tests/sort-order-icon.component.spec.ts index f37d7e7ef6..d351c39a74 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/tests/sort-order-icon.component.spec.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/tests/sort-order-icon.component.spec.ts @@ -8,7 +8,7 @@ describe('SortOrderIconComponent', () => { beforeEach(() => { spectator = createHost( - '', + '', { hostProps: { selectedSortKey: '',