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] 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,