Browse Source

feat: add ConfigureAwait(false) to all await calls

pull/2500/head
Javier Campos 7 years ago
parent
commit
911ce80a7c
  1. 4
      framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Microsoft/AspNetCore/Builder/JwtTokenMiddleware.cs
  2. 8
      framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs
  3. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs
  4. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs
  5. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLanguageProvider.cs
  6. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemotePermissionChecker.cs
  7. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteSettingProvider.cs
  8. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs
  9. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Breadcrumb/AbpBreadcrumbTagHelperService.cs
  10. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Carousel/AbpCarouselTagHelperService.cs
  11. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs
  12. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionTagHelperService.cs
  13. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs
  14. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs
  15. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperExtensions.cs
  16. 20
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs
  17. 16
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs
  18. 16
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs
  19. 18
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs
  20. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabDropdownTagHelperService.cs
  21. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs
  22. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs
  23. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs
  24. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleItemTagHelperService.cs
  25. 6
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs
  26. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs
  27. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs
  28. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs
  29. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantAppService.cs
  30. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantController.cs
  31. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/TenantSwitchModal.cshtml.cs
  32. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/MainNavbarMenuViewComponent.cs
  33. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/LanguageSwitchViewComponent.cs
  34. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/MainNavbarToolsViewComponent.cs
  35. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/UserMenuViewComponent.cs
  36. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Toolbars/BasicThemeMainTopToolbarContributor.cs
  37. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Toolbars/ToolbarManager.cs
  38. 10
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpViewComponentHelper.cs
  39. 6
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetManager.cs
  40. 15
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs
  41. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs
  42. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs
  43. 4
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs
  44. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs
  45. 6
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Features/AbpFeatureActionFilter.cs
  46. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpDateTimeModelBinder.cs
  47. 14
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs
  48. 4
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/AbpValidationActionFilter.cs
  49. 4
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs
  50. 6
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/DefaultAbpRequestLocalizationOptionsProvider.cs
  51. 6
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs
  52. 6
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs
  53. 2
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs
  54. 4
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs
  55. 4
      framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs
  56. 4
      framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs
  57. 38
      framework/src/Volo.Abp.Authorization/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions.cs
  58. 2
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs
  59. 6
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs
  60. 4
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs
  61. 2
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/PermissionRequirementHandler.cs
  62. 2
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs
  63. 4
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs
  64. 2
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs
  65. 2
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs
  66. 10
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs
  67. 8
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueManager.cs
  68. 4
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/RabbitMqBackgroundJobManager.cs
  69. 4
      framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/DefaultBackgroundJobManager.cs
  70. 4
      framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/BackgroundWorkerManager.cs
  71. 4
      framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/PeriodicBackgroundWorkerBase.cs
  72. 18
      framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs
  73. 2
      framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapter.cs
  74. 4
      framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs
  75. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs
  76. 16
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs
  77. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs
  78. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs
  79. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs
  80. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs
  81. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  82. 10
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs
  83. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs
  84. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/AbpIoApiKeyService.cs
  85. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs
  86. 16
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs
  87. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Analyticses/CliAnalyticsCollect.cs
  88. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleInfoProvider.cs
  89. 10
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleProjectBuilder.cs
  90. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/RemoteServiceExceptionHandler.cs
  91. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs
  92. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs
  93. 12
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
  94. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs
  95. 2
      framework/src/Volo.Abp.Core/System/IO/AbpStreamExtensions.cs
  96. 4
      framework/src/Volo.Abp.Core/Volo/Abp/IO/FileHelper.cs
  97. 4
      framework/src/Volo.Abp.Core/Volo/Abp/Threading/AsyncOneTimeRunner.cs
  98. 40
      framework/src/Volo.Abp.Core/Volo/Abp/Threading/InternalAsyncHelper.cs
  99. 2
      framework/src/Volo.Abp.Data/Volo/Abp/Data/DataSeeder.cs
  100. 2
      framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs

4
framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Microsoft/AspNetCore/Builder/JwtTokenMiddleware.cs

@ -11,14 +11,14 @@ namespace Microsoft.AspNetCore.Builder
{
if (ctx.User.Identity?.IsAuthenticated != true)
{
var result = await ctx.AuthenticateAsync(schema);
var result = await ctx.AuthenticateAsync(schema).ConfigureAwait(false);
if (result.Succeeded && result.Principal != null)
{
ctx.User = result.Principal;
}
}
await next();
await next().ConfigureAwait(false);
});
}
}

8
framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs

@ -33,7 +33,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy
TenantConfiguration tenant = null;
if (resolveResult.TenantIdOrName != null)
{
tenant = await FindTenantAsync(resolveResult.TenantIdOrName);
tenant = await FindTenantAsync(resolveResult.TenantIdOrName).ConfigureAwait(false);
if (tenant == null)
{
//TODO: A better exception?
@ -45,7 +45,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy
using (_currentTenant.Change(tenant?.Id, tenant?.Name))
{
await next(context);
await next(context).ConfigureAwait(false);
}
}
@ -53,11 +53,11 @@ namespace Volo.Abp.AspNetCore.MultiTenancy
{
if (Guid.TryParse(tenantIdOrName, out var parsedTenantId))
{
return await _tenantStore.FindAsync(parsedTenantId);
return await _tenantStore.FindAsync(parsedTenantId).ConfigureAwait(false);
}
else
{
return await _tenantStore.FindAsync(tenantIdOrName);
return await _tenantStore.FindAsync(tenantIdOrName).ConfigureAwait(false);
}
}
}

4
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs

@ -43,12 +43,12 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
configuration = await Cache.GetOrAddAsync(
cacheKey,
async () => await Proxy.Service.GetAsync(),
async () => await Proxy.Service.GetAsync().ConfigureAwait(false),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(120) //TODO: Should be configurable. Default value should be higher (5 mins would be good).
}
);
).ConfigureAwait(false);
if (httpContext != null)
{

2
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs

@ -15,7 +15,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
public override async Task<string> GetOrNullAsync(string name)
{
var configuration = await ConfigurationClient.GetAsync();
var configuration = await ConfigurationClient.GetAsync().ConfigureAwait(false);
return configuration.Features.Values.GetOrDefault(name);
}
}

2
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLanguageProvider.cs

@ -16,7 +16,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
public async Task<IReadOnlyList<LanguageInfo>> GetLanguagesAsync()
{
var configuration = await ConfigurationClient.GetAsync();
var configuration = await ConfigurationClient.GetAsync().ConfigureAwait(false);
return configuration.Localization.Languages;
}
}

4
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemotePermissionChecker.cs

@ -16,7 +16,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
public async Task<bool> IsGrantedAsync(string name)
{
var configuration = await ConfigurationClient.GetAsync();
var configuration = await ConfigurationClient.GetAsync().ConfigureAwait(false);
return configuration.Auth.GrantedPolicies.ContainsKey(name);
}
@ -24,7 +24,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
public async Task<bool> IsGrantedAsync(ClaimsPrincipal claimsPrincipal, string name)
{
/* This provider always works for the current principal. */
return await IsGrantedAsync(name);
return await IsGrantedAsync(name).ConfigureAwait(false);
}
}
}

4
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteSettingProvider.cs

@ -17,13 +17,13 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
public async Task<string> GetOrNullAsync(string name)
{
var configuration = await ConfigurationClient.GetAsync();
var configuration = await ConfigurationClient.GetAsync().ConfigureAwait(false);
return configuration.Setting.Values.GetOrDefault(name);
}
public async Task<List<SettingValue>> GetAllAsync()
{
var configuration = await ConfigurationClient.GetAsync();
var configuration = await ConfigurationClient.GetAsync().ConfigureAwait(false);
return configuration
.Setting.Values
.Select(s => new SettingValue(s.Key, s.Value))

12
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs

@ -39,13 +39,13 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
tenantConfiguration = await Cache.GetOrAddAsync(
cacheKey,
async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByNameAsync(name)),
async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByNameAsync(name).ConfigureAwait(false)),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =
TimeSpan.FromMinutes(5) //TODO: Should be configurable.
}
);
).ConfigureAwait(false);
if (httpContext != null)
{
@ -67,13 +67,13 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
tenantConfiguration = await Cache.GetOrAddAsync(
cacheKey,
async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByIdAsync(id)),
async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByIdAsync(id).ConfigureAwait(false)),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =
TimeSpan.FromMinutes(5) //TODO: Should be configurable.
}
);
).ConfigureAwait(false);
if (httpContext != null)
{
@ -95,7 +95,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
tenantConfiguration = Cache.GetOrAdd(
cacheKey,
() => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByNameAsync(name))),
() => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByNameAsync(name).ConfigureAwait(false))),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =
@ -123,7 +123,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
tenantConfiguration = Cache.GetOrAdd(
cacheKey,
() => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByIdAsync(id))),
() => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByIdAsync(id).ConfigureAwait(false))),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Breadcrumb/AbpBreadcrumbTagHelperService.cs

@ -12,7 +12,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Breadcrumb
{
var list = InitilizeFormGroupContentsContext(context, output);
await output.GetChildContentAsync();
await output.GetChildContentAsync().ConfigureAwait(false);
SetInnerOlTag(context, output);
SetInnerList(context, output, list);

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Carousel/AbpCarouselTagHelperService.cs

@ -19,7 +19,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Carousel
var itemList = InitilizeCarouselItemsContentsContext(context, output);
await output.GetChildContentAsync();
await output.GetChildContentAsync().ConfigureAwait(false);
SetOneItemAsActive(context, output, itemList);
SetItems(context, output, itemList);

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs

@ -12,7 +12,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Collapse
{
SetRandomIdIfNotProvided();
var innerContent = (await output.GetChildContentAsync()).GetContent();
var innerContent = (await output.GetChildContentAsync().ConfigureAwait(false)).GetContent();
var html = GetAccordionHeaderItem(context, output) + GetAccordionContentItem(context, output, innerContent);

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionTagHelperService.cs

@ -20,7 +20,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Collapse
var items = InitilizeFormGroupContentsContext(context, output);
await output.GetChildContentAsync();
await output.GetChildContentAsync().ConfigureAwait(false);
var content = GetContent(items);

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs

@ -22,7 +22,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Collapse
output.Attributes.AddClass("multi-collapse");
}
var innerContent = (await output.GetChildContentAsync()).GetContent();
var innerContent = (await output.GetChildContentAsync().ConfigureAwait(false)).GetContent();
output.Content.SetHtmlContent(innerContent);
}

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs

@ -26,9 +26,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
{
var content = await output.GetChildContentAsync();
var content = await output.GetChildContentAsync().ConfigureAwait(false);
var buttonsAsHtml = await GetButtonsAsHtmlAsync(context, output, content);
var buttonsAsHtml = await GetButtonsAsHtmlAsync(context, output, content).ConfigureAwait(false);
output.PreElement.SetHtmlContent(buttonsAsHtml);
@ -43,13 +43,13 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown
{
var buttonBuilder = new StringBuilder("");
var mainButton = await GetMainButtonAsync(context, output, content);
var mainButton = await GetMainButtonAsync(context, output, content).ConfigureAwait(false);
buttonBuilder.AppendLine(mainButton);
if (TagHelper.DropdownStyle == DropdownStyle.Split)
{
var splitButton = await GetSplitButtonAsync(context, output);
var splitButton = await GetSplitButtonAsync(context, output).ConfigureAwait(false);
buttonBuilder.AppendLine(splitButton);
}
@ -68,7 +68,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown
abpButtonTagHelper.ButtonType = TagHelper.ButtonType;
var attributes = GetAttributesForMainButton(context, output);
var buttonTag = await abpButtonTagHelper.ProcessAndGetOutputAsync(attributes, context, "button", TagMode.StartTagAndEndTag);
var buttonTag = await abpButtonTagHelper.ProcessAndGetOutputAsync(attributes, context, "button", TagMode.StartTagAndEndTag).ConfigureAwait(false);
buttonTag.PreContent.SetHtmlContent(content.GetContent());
@ -89,7 +89,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown
abpButtonTagHelper.ButtonType = TagHelper.ButtonType;
var attributes = GetAttributesForSplitButton(context, output);
return await abpButtonTagHelper.RenderAsync(attributes, context, _htmlEncoder, "button", TagMode.StartTagAndEndTag);
return await abpButtonTagHelper.RenderAsync(attributes, context, _htmlEncoder, "button", TagMode.StartTagAndEndTag).ConfigureAwait(false);
}
protected virtual TagHelperAttributeList GetAttributesForMainButton(TagHelperContext context, TagHelperOutput output)

4
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperExtensions.cs

@ -19,14 +19,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Extensions
tagHelper.Init(context);
await tagHelper.ProcessAsync(innerContext, innerOutput);
await tagHelper.ProcessAsync(innerContext, innerOutput).ConfigureAwait(false);
return innerOutput;
}
public static async Task<string> RenderAsync(this TagHelper tagHelper, TagHelperAttributeList attributeList, TagHelperContext context, HtmlEncoder htmlEncoder, string tagName = "div", TagMode tagMode = TagMode.SelfClosing)
{
var innerOutput = await tagHelper.ProcessAndGetOutputAsync(attributeList, context, tagName, tagMode);
var innerOutput = await tagHelper.ProcessAndGetOutputAsync(attributeList, context, tagName, tagMode).ConfigureAwait(false);
return innerOutput.Render(htmlEncoder);
}

20
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs

@ -37,11 +37,11 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
NormalizeTagMode(context, output);
var childContent = (await output.GetChildContentAsync()).GetContent();
var childContent = (await output.GetChildContentAsync().ConfigureAwait(false)).GetContent();
await ConvertToMvcForm(context, output);
await ConvertToMvcForm(context, output).ConfigureAwait(false);
await ProcessFieldsAsync(context, output);
await ProcessFieldsAsync(context, output).ConfigureAwait(false);
SetContent(context, output, list, childContent);
@ -67,9 +67,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
ViewContext = TagHelper.ViewContext
};
var formTagOutput = await formTagHelper.ProcessAndGetOutputAsync(output.Attributes, context, "form", TagMode.StartTagAndEndTag);
var formTagOutput = await formTagHelper.ProcessAndGetOutputAsync(output.Attributes, context, "form", TagMode.StartTagAndEndTag).ConfigureAwait(false);
await formTagOutput.GetChildContentAsync();
await formTagOutput.GetChildContentAsync().ConfigureAwait(false);
output.PostContent.SetHtmlContent(output.PostContent.GetContent() + formTagOutput.PostContent.GetContent());
output.PreContent.SetHtmlContent(output.PreContent.GetContent() + formTagOutput.PreContent.GetContent());
@ -134,11 +134,11 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
{
if (IsSelectGroup(context, model))
{
await ProcessSelectGroupAsync(context, output, model);
await ProcessSelectGroupAsync(context, output, model).ConfigureAwait(false);
}
else
{
await ProcessInputGroupAsync(context, output, model);
await ProcessInputGroupAsync(context, output, model).ConfigureAwait(false);
}
}
}
@ -147,7 +147,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
{
var abpSelectTagHelper = GetSelectGroupTagHelper(context, output, model);
await abpSelectTagHelper.RenderAsync(new TagHelperAttributeList(), context, _htmlEncoder, "div", TagMode.StartTagAndEndTag);
await abpSelectTagHelper.RenderAsync(new TagHelperAttributeList(), context, _htmlEncoder, "div", TagMode.StartTagAndEndTag).ConfigureAwait(false);
}
protected virtual AbpTagHelper GetSelectGroupTagHelper(TagHelperContext context, TagHelperOutput output, ModelExpression model)
@ -185,7 +185,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
abpButtonTagHelper.Text = "Submit";
abpButtonTagHelper.ButtonType = AbpButtonType.Primary;
return await abpButtonTagHelper.RenderAsync(attributes, context, _htmlEncoder, "button", TagMode.StartTagAndEndTag);
return await abpButtonTagHelper.RenderAsync(attributes, context, _htmlEncoder, "button", TagMode.StartTagAndEndTag).ConfigureAwait(false);
}
protected virtual async Task ProcessInputGroupAsync(TagHelperContext context, TagHelperOutput output, ModelExpression model)
@ -195,7 +195,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
abpInputTagHelper.ViewContext = TagHelper.ViewContext;
abpInputTagHelper.DisplayRequiredSymbol = TagHelper.RequiredSymbols ?? true;
await abpInputTagHelper.RenderAsync(new TagHelperAttributeList(), context, _htmlEncoder, "div", TagMode.StartTagAndEndTag);
await abpInputTagHelper.RenderAsync(new TagHelperAttributeList(), context, _htmlEncoder, "div", TagMode.StartTagAndEndTag).ConfigureAwait(false);
}
protected virtual List<ModelExpression> GetModels(TagHelperContext context, TagHelperOutput output)

16
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs

@ -27,7 +27,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
{
var (innerHtml, isCheckBox) = await GetFormInputGroupAsHtmlAsync(context, output);
var (innerHtml, isCheckBox) = await GetFormInputGroupAsHtmlAsync(context, output).ConfigureAwait(false);
var order = TagHelper.AspFor.ModelExplorer.GetDisplayOrder();
@ -57,12 +57,12 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
protected virtual async Task<(string, bool)> GetFormInputGroupAsHtmlAsync(TagHelperContext context, TagHelperOutput output)
{
var (inputTag, isCheckBox) = await GetInputTagHelperOutputAsync(context, output);
var (inputTag, isCheckBox) = await GetInputTagHelperOutputAsync(context, output).ConfigureAwait(false);
var inputHtml = inputTag.Render(_encoder);
var label = await GetLabelAsHtmlAsync(context, output, inputTag, isCheckBox);
var label = await GetLabelAsHtmlAsync(context, output, inputTag, isCheckBox).ConfigureAwait(false);
var info = GetInfoAsHtml(context, output, inputTag, isCheckBox);
var validation = isCheckBox ? "" : await GetValidationAsHtmlAsync(context, output, inputTag);
var validation = isCheckBox ? "" : await GetValidationAsHtmlAsync(context, output, inputTag).ConfigureAwait(false);
return (GetContent(context, output, label, inputHtml, validation, info, isCheckBox), isCheckBox);
}
@ -82,7 +82,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
var attributeList = new TagHelperAttributeList { { "class", "text-danger" } };
return await validationMessageTagHelper.RenderAsync(attributeList, context, _encoder, "span", TagMode.StartTagAndEndTag);
return await validationMessageTagHelper.RenderAsync(attributeList, context, _encoder, "span", TagMode.StartTagAndEndTag).ConfigureAwait(false);
}
protected virtual string GetContent(TagHelperContext context, TagHelperOutput output, string label, string inputHtml, string validation, string infoHtml, bool isCheckbox)
@ -125,7 +125,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
{
var tagHelper = GetInputTagHelper(context, output);
var inputTagHelperOutput = await tagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "input");
var inputTagHelperOutput = await tagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "input").ConfigureAwait(false);
ConvertToTextAreaIfTextArea(inputTagHelperOutput);
AddDisabledAttribute(inputTagHelperOutput);
@ -227,7 +227,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
if (string.IsNullOrEmpty(TagHelper.Label))
{
return await GetLabelAsHtmlUsingTagHelperAsync(context, output, isCheckbox) + GetRequiredSymbol(context, output);
return await GetLabelAsHtmlUsingTagHelperAsync(context, output, isCheckbox).ConfigureAwait(false) + GetRequiredSymbol(context, output);
}
var checkboxClass = isCheckbox ? "class=\"custom-control-label\" " : "";
@ -301,7 +301,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
attributeList.AddClass("custom-control-label");
}
return await labelTagHelper.RenderAsync(attributeList, context, _encoder, "label", TagMode.StartTagAndEndTag);
return await labelTagHelper.RenderAsync(attributeList, context, _encoder, "label", TagMode.StartTagAndEndTag).ConfigureAwait(false);
}
protected virtual void ConvertToTextAreaIfTextArea(TagHelperOutput tagHelperOutput)

16
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs

@ -30,7 +30,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
{
var innerHtml = await GetFormInputGroupAsHtmlAsync(context, output);
var innerHtml = await GetFormInputGroupAsHtmlAsync(context, output).ConfigureAwait(false);
var order = TagHelper.AspFor.ModelExplorer.GetDisplayOrder();
@ -52,10 +52,10 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
protected virtual async Task<string> GetFormInputGroupAsHtmlAsync(TagHelperContext context, TagHelperOutput output)
{
var selectTag = await GetSelectTagAsync(context, output);
var selectTag = await GetSelectTagAsync(context, output).ConfigureAwait(false);
var selectAsHtml = selectTag.Render(_encoder);
var label = await GetLabelAsHtmlAsync(context, output, selectTag);
var validation = await GetValidationAsHtmlAsync(context, output, selectTag);
var label = await GetLabelAsHtmlAsync(context, output, selectTag).ConfigureAwait(false);
var validation = await GetValidationAsHtmlAsync(context, output, selectTag).ConfigureAwait(false);
var infoText = GetInfoAsHtml(context, output, selectTag);
return label + Environment.NewLine + selectAsHtml + Environment.NewLine + infoText + Environment.NewLine + validation;
@ -75,7 +75,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
ViewContext = TagHelper.ViewContext
};
var selectTagHelperOutput = await selectTagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag);
var selectTagHelperOutput = await selectTagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag).ConfigureAwait(false);
selectTagHelperOutput.Attributes.AddClass("form-control");
selectTagHelperOutput.Attributes.AddClass(GetSize(context, output));
@ -123,7 +123,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
return "<label " + GetIdAttributeAsString(selectTag) + ">" + TagHelper.Label + "</label>" + GetRequiredSymbol(context, output);
}
return await GetLabelAsHtmlUsingTagHelperAsync(context, output) + GetRequiredSymbol(context, output);
return await GetLabelAsHtmlUsingTagHelperAsync(context, output).ConfigureAwait(false) + GetRequiredSymbol(context, output);
}
protected virtual string GetRequiredSymbol(TagHelperContext context, TagHelperOutput output)
@ -242,7 +242,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
ViewContext = TagHelper.ViewContext
};
return await labelTagHelper.RenderAsync(new TagHelperAttributeList(), context, _encoder, "label", TagMode.StartTagAndEndTag);
return await labelTagHelper.RenderAsync(new TagHelperAttributeList(), context, _encoder, "label", TagMode.StartTagAndEndTag).ConfigureAwait(false);
}
protected virtual async Task<string> GetValidationAsHtmlAsync(TagHelperContext context, TagHelperOutput output, TagHelperOutput inputTag)
@ -255,7 +255,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
var attributeList = new TagHelperAttributeList { { "class", "text-danger" } };
return await validationMessageTagHelper.RenderAsync(attributeList, context, _encoder, "span", TagMode.StartTagAndEndTag);
return await validationMessageTagHelper.RenderAsync(attributeList, context, _encoder, "span", TagMode.StartTagAndEndTag).ConfigureAwait(false);
}
protected virtual string GetSize(TagHelperContext context, TagHelperOutput output)

18
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs

@ -31,7 +31,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination
}
ProcessMainTag(context, output);
await SetContentAsHtmlAsync(context, output);
await SetContentAsHtmlAsync(context, output).ConfigureAwait(false);
}
protected virtual async Task SetContentAsHtmlAsync(TagHelperContext context, TagHelperOutput output)
@ -39,9 +39,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination
var html = new StringBuilder("");
html.AppendLine(GetOpeningTags(context, output));
html.AppendLine(await GetPreviousButtonAsync(context, output));
html.AppendLine(await GetPagesAsync(context, output));
html.AppendLine(await GetNextButton(context, output));
html.AppendLine(await GetPreviousButtonAsync(context, output).ConfigureAwait(false));
html.AppendLine(await GetPagesAsync(context, output).ConfigureAwait(false));
html.AppendLine(await GetNextButton(context, output).ConfigureAwait(false));
html.AppendLine(GetClosingTags(context, output));
output.Content.SetHtmlContent(html.ToString());
@ -61,7 +61,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination
foreach (var page in TagHelper.Model.Pages)
{
pagesHtml.AppendLine(await GetPageAsync(context, output, page));
pagesHtml.AppendLine(await GetPageAsync(context, output, page).ConfigureAwait(false));
}
return pagesHtml.ToString();
@ -86,7 +86,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination
}
else
{
pageHtml.AppendLine(await RenderAnchorTagHelperLinkHtmlAsync(context, output, page.Index.ToString(), page.Index.ToString()));
pageHtml.AppendLine(await RenderAnchorTagHelperLinkHtmlAsync(context, output, page.Index.ToString(), page.Index.ToString()).ConfigureAwait(false));
}
pageHtml.AppendLine("</li>");
@ -102,7 +102,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination
: (TagHelper.Model.CurrentPage - 1).ToString();
return
"<li class=\"page-item " + (TagHelper.Model.CurrentPage == 1 ? "disabled" : "") + "\">\r\n" +
(await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey)) + " </li>";
(await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey).ConfigureAwait(false)) + " </li>";
}
protected virtual async Task<string> GetNextButton(TagHelperContext context, TagHelperOutput output)
@ -111,7 +111,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination
var currentPage = (TagHelper.Model.CurrentPage + 1).ToString();
return
"<li class=\"page-item " + (TagHelper.Model.CurrentPage >= TagHelper.Model.TotalPageCount ? "disabled" : "") + "\">\r\n" +
(await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey)) +
(await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey).ConfigureAwait(false)) +
" </li>";
}
@ -121,7 +121,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination
var anchorTagHelper = GetAnchorTagHelper(currentPage, out var attributeList);
var tagHelperOutput = await anchorTagHelper.ProcessAndGetOutputAsync(attributeList, context, "a", TagMode.StartTagAndEndTag);
var tagHelperOutput = await anchorTagHelper.ProcessAndGetOutputAsync(attributeList, context, "a", TagMode.StartTagAndEndTag).ConfigureAwait(false);
tagHelperOutput.Content.SetHtmlContent(localizer[localizationKey]);

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabDropdownTagHelperService.cs

@ -15,7 +15,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab
throw new Exception("Name of tab dropdown tag can not bu null or empty.");
}
await output.GetChildContentAsync();
await output.GetChildContentAsync().ConfigureAwait(false);
var tabHeader = GetTabHeaderItem(context, output);
var tabHeaderItems = context.GetValue<List<TabItem>>(TabItems);

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs

@ -12,7 +12,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab
{
SetPlaceholderForNameIfNotProvided();
var innerContent = await output.GetChildContentAsync();
var innerContent = await output.GetChildContentAsync().ConfigureAwait(false);
var tabHeader = GetTabHeaderItem(context, output);
var tabContent = GetTabContentItem(context, output, innerContent.GetContent());

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs

@ -17,7 +17,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab
var items = InitilizeFormGroupContentsContext(context, output);
await output.GetChildContentAsync();
await output.GetChildContentAsync().ConfigureAwait(false);
var headers = GetHeaders(context, output, items);
var contents = GetConents(context, output, items);

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs

@ -61,12 +61,12 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling
public virtual async Task<IReadOnlyList<string>> GetStyleBundleFilesAsync(string bundleName)
{
return await GetBundleFilesAsync(Options.StyleBundles, bundleName, StyleBundler);
return await GetBundleFilesAsync(Options.StyleBundles, bundleName, StyleBundler).ConfigureAwait(false);
}
public virtual async Task<IReadOnlyList<string>> GetScriptBundleFilesAsync(string bundleName)
{
return await GetBundleFilesAsync(Options.ScriptBundles, bundleName, ScriptBundler);
return await GetBundleFilesAsync(Options.ScriptBundles, bundleName, ScriptBundler).ConfigureAwait(false);
}
protected virtual async Task<IReadOnlyList<string>> GetBundleFilesAsync(BundleConfigurationCollection bundles, string bundleName, IBundler bundler)
@ -185,17 +185,17 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling
foreach (var contributor in contributors)
{
await contributor.PreConfigureBundleAsync(context);
await contributor.PreConfigureBundleAsync(context).ConfigureAwait(false);
}
foreach (var contributor in contributors)
{
await contributor.ConfigureBundleAsync(context);
await contributor.ConfigureBundleAsync(context).ConfigureAwait(false);
}
foreach (var contributor in contributors)
{
await contributor.PostConfigureBundleAsync(context);
await contributor.PostConfigureBundleAsync(context).ConfigureAwait(false);
}
return context.Files;
@ -207,7 +207,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling
foreach (var contributor in contributors)
{
await contributor.ConfigureDynamicResourcesAsync(context);
await contributor.ConfigureDynamicResourcesAsync(context).ConfigureAwait(false);
}
return context.Files;

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleItemTagHelperService.cs

@ -33,7 +33,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers
TagHelper.CreateBundleTagHelperItem()
},
TagHelper.GetNameOrNull()
);
).ConfigureAwait(false);
}
}
}

6
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs

@ -20,16 +20,16 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers
await ResourceService.ProcessAsync(
context,
output,
await GetBundleItems(context, output),
await GetBundleItems(context, output).ConfigureAwait(false),
TagHelper.GetNameOrNull()
);
).ConfigureAwait(false);
}
protected virtual async Task<List<BundleTagHelperItem>> GetBundleItems(TagHelperContext context, TagHelperOutput output)
{
var bundleItems = new List<BundleTagHelperItem>();
context.Items[AbpTagHelperConsts.ContextBundleItemListKey] = bundleItems;
await output.GetChildContentAsync(); //TODO: Is there a way of executing children without getting content?
await output.GetChildContentAsync().ConfigureAwait(false); //TODO: Is there a way of executing children without getting content?
return bundleItems;
}
}

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs

@ -56,7 +56,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers
CreateBundle(bundleName, bundleItems);
var bundleFiles = await GetBundleFilesAsync(bundleName);
var bundleFiles = await GetBundleFilesAsync(bundleName).ConfigureAwait(false);
output.Content.Clear();

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs

@ -36,7 +36,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers
protected override async Task<IReadOnlyList<string>> GetBundleFilesAsync(string bundleName)
{
return await BundleManager.GetScriptBundleFilesAsync(bundleName);
return await BundleManager.GetScriptBundleFilesAsync(bundleName).ConfigureAwait(false);
}
protected override void AddHtmlTag(TagHelperContext context, TagHelperOutput output, string file)

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs

@ -36,7 +36,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers
protected override async Task<IReadOnlyList<string>> GetBundleFilesAsync(string bundleName)
{
return await BundleManager.GetStyleBundleFilesAsync(bundleName);
return await BundleManager.GetStyleBundleFilesAsync(bundleName).ConfigureAwait(false);
}
protected override void AddHtmlTag(TagHelperContext context, TagHelperOutput output, string file)

4
framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantAppService.cs

@ -17,7 +17,7 @@ namespace Pages.Abp.MultiTenancy
public async Task<FindTenantResultDto> FindTenantByNameAsync(string name)
{
var tenant = await TenantStore.FindAsync(name);
var tenant = await TenantStore.FindAsync(name).ConfigureAwait(false);
if (tenant == null)
{
@ -34,7 +34,7 @@ namespace Pages.Abp.MultiTenancy
public async Task<FindTenantResultDto> FindTenantByIdAsync(Guid id)
{
var tenant = await TenantStore.FindAsync(id);
var tenant = await TenantStore.FindAsync(id).ConfigureAwait(false);
if (tenant == null)
{

4
framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantController.cs

@ -21,14 +21,14 @@ namespace Pages.Abp.MultiTenancy
[Route("tenants/by-name/{name}")]
public async Task<FindTenantResultDto> FindTenantByNameAsync(string name)
{
return await _abpTenantAppService.FindTenantByNameAsync(name);
return await _abpTenantAppService.FindTenantByNameAsync(name).ConfigureAwait(false);
}
[HttpGet]
[Route("tenants/by-id/{id}")]
public async Task<FindTenantResultDto> FindTenantByIdAsync(Guid id)
{
return await _abpTenantAppService.FindTenantByIdAsync(id);
return await _abpTenantAppService.FindTenantByIdAsync(id).ConfigureAwait(false);
}
}
}

4
framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/TenantSwitchModal.cshtml.cs

@ -34,7 +34,7 @@ namespace Pages.Abp.MultiTenancy
if (CurrentTenant.IsAvailable)
{
var tenant = await TenantStore.FindAsync(CurrentTenant.GetId());
var tenant = await TenantStore.FindAsync(CurrentTenant.GetId()).ConfigureAwait(false);
Input.Name = tenant?.Name;
}
}
@ -47,7 +47,7 @@ namespace Pages.Abp.MultiTenancy
}
else
{
var tenant = await TenantStore.FindAsync(Input.Name);
var tenant = await TenantStore.FindAsync(Input.Name).ConfigureAwait(false);
if (tenant == null)
{
throw new UserFriendlyException(L["GivenTenantIsNotAvailable", Input.Name]);

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/MainNavbarMenuViewComponent.cs

@ -15,7 +15,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Menu
public async Task<IViewComponentResult> InvokeAsync()
{
var menu = await _menuManager.GetAsync(StandardMenus.Main);
var menu = await _menuManager.GetAsync(StandardMenus.Main).ConfigureAwait(false);
return View("~/Themes/Basic/Components/Menu/Default.cshtml", menu);
}
}

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/LanguageSwitchViewComponent.cs

@ -17,7 +17,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar
public async Task<IViewComponentResult> InvokeAsync()
{
var languages = await _languageProvider.GetLanguagesAsync();
var languages = await _languageProvider.GetLanguagesAsync().ConfigureAwait(false);
var currentLanguage = languages.FindByCulture(
CultureInfo.CurrentCulture.Name,
CultureInfo.CurrentUICulture.Name

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/MainNavbarToolsViewComponent.cs

@ -15,7 +15,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar
public async Task<IViewComponentResult> InvokeAsync()
{
var toolbar = await _toolbarManager.GetAsync(StandardToolbars.Main);
var toolbar = await _toolbarManager.GetAsync(StandardToolbars.Main).ConfigureAwait(false);
return View("~/Themes/Basic/Components/Toolbar/Default.cshtml", toolbar);
}
}

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/UserMenuViewComponent.cs

@ -15,7 +15,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar
public async Task<IViewComponentResult> InvokeAsync()
{
var menu = await _menuManager.GetAsync(StandardMenus.User);
var menu = await _menuManager.GetAsync(StandardMenus.User).ConfigureAwait(false);
return View("~/Themes/Basic/Components/Toolbar/UserMenu/Default.cshtml", menu);
}
}

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Toolbars/BasicThemeMainTopToolbarContributor.cs

@ -25,7 +25,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Toolbars
var languageProvider = context.ServiceProvider.GetService<ILanguageProvider>();
//TODO: This duplicates GetLanguages() usage. Can we eleminate this?
var languages = await languageProvider.GetLanguagesAsync();
var languages = await languageProvider.GetLanguagesAsync().ConfigureAwait(false);
if (languages.Count > 1)
{
context.Toolbar.Items.Add(new ToolbarItem(typeof(LanguageSwitchViewComponent)));

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Toolbars/ToolbarManager.cs

@ -33,7 +33,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Toolbars
foreach (var contributor in Options.Contributors)
{
await contributor.ConfigureToolbarAsync(context);
await contributor.ConfigureToolbarAsync(context).ConfigureAwait(false);
}
}

10
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpViewComponentHelper.cs

@ -33,10 +33,10 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets
var widget = Options.Widgets.Find(name);
if (widget == null)
{
return await DefaultViewComponentHelper.InvokeAsync(name, arguments);
return await DefaultViewComponentHelper.InvokeAsync(name, arguments).ConfigureAwait(false);
}
return await InvokeWidgetAsync(arguments, widget);
return await InvokeWidgetAsync(arguments, widget).ConfigureAwait(false);
}
public virtual async Task<IHtmlContent> InvokeAsync(Type componentType, object arguments)
@ -44,10 +44,10 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets
var widget = Options.Widgets.Find(componentType);
if (widget == null)
{
return await DefaultViewComponentHelper.InvokeAsync(componentType, arguments);
return await DefaultViewComponentHelper.InvokeAsync(componentType, arguments).ConfigureAwait(false);
}
return await InvokeWidgetAsync(arguments, widget);
return await InvokeWidgetAsync(arguments, widget).ConfigureAwait(false);
}
public virtual void Contextualize(ViewContext viewContext)
@ -68,7 +68,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets
return new HtmlContentBuilder()
.AppendHtml($"<div {wrapperAttributesBuilder}>")
.AppendHtml(await DefaultViewComponentHelper.InvokeAsync(widget.ViewComponentType, arguments))
.AppendHtml(await DefaultViewComponentHelper.InvokeAsync(widget.ViewComponentType, arguments).ConfigureAwait(false))
.AppendHtml("</div>");
}
}

6
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetManager.cs

@ -27,14 +27,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets
{
var widget = Options.Widgets.Find(widgetComponentType);
return await IsGrantedAsyncInternal(widget, widgetComponentType.FullName);
return await IsGrantedAsyncInternal(widget, widgetComponentType.FullName).ConfigureAwait(false);
}
public async Task<bool> IsGrantedAsync(string name)
{
var widget = Options.Widgets.Find(name);
return await IsGrantedAsyncInternal(widget, name);
return await IsGrantedAsyncInternal(widget, name).ConfigureAwait(false);
}
private async Task<bool> IsGrantedAsyncInternal(WidgetDefinition widget, string wantedWidgetName)
@ -48,7 +48,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets
{
foreach (var requiredPolicy in widget.RequiredPolicies)
{
if (!(await AuthorizationService.AuthorizeAsync(requiredPolicy)).Succeeded)
if (!(await AuthorizationService.AuthorizeAsync(requiredPolicy).ConfigureAwait(false)).Succeeded)
{
return false;
}

15
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs

@ -56,11 +56,12 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
return new ApplicationConfigurationDto
{
Auth = await GetAuthConfigAsync(),
Features = await GetFeaturesConfigAsync(),
Localization = await GetLocalizationConfigAsync(),
Auth = await GetAuthConfigAsync().ConfigureAwait(false),
Features = await GetFeaturesConfigAsync().ConfigureAwait(false),
Localization = await GetLocalizationConfigAsync().ConfigureAwait(false),
CurrentUser = GetCurrentUser(),
Setting = await GetSettingConfigAsync()
.ConfigureAwait(false)
};
}
@ -81,7 +82,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
var authConfig = new ApplicationAuthConfigurationDto();
var policyNames = await _abpAuthorizationPolicyProvider.GetPoliciesNamesAsync();
var policyNames = await _abpAuthorizationPolicyProvider.GetPoliciesNamesAsync().ConfigureAwait(false);
Logger.LogDebug($"GetPoliciesNamesAsync returns {policyNames.Count} items.");
@ -91,7 +92,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
Logger.LogDebug($"_authorizationService.IsGrantedAsync? {policyName}");
if (await _authorizationService.IsGrantedAsync(policyName))
if (await _authorizationService.IsGrantedAsync(policyName).ConfigureAwait(false))
{
authConfig.GrantedPolicies[policyName] = true;
}
@ -174,7 +175,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
continue;
}
result.Values[settingDefinition.Name] = await _settingProvider.GetOrNullAsync(settingDefinition.Name);
result.Values[settingDefinition.Name] = await _settingProvider.GetOrNullAsync(settingDefinition.Name).ConfigureAwait(false);
}
Logger.LogDebug("Executed AbpApplicationConfigurationAppService.GetSettingConfigAsync()");
@ -195,7 +196,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
continue;
}
result.Values[featureDefinition.Name] = await FeatureChecker.GetOrNullAsync(featureDefinition.Name);
result.Values[featureDefinition.Name] = await FeatureChecker.GetOrNullAsync(featureDefinition.Name).ConfigureAwait(false);
}
Logger.LogDebug("Executed AbpApplicationConfigurationAppService.GetFeaturesConfigAsync()");

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs

@ -17,7 +17,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
[HttpGet]
public async Task<ApplicationConfigurationDto> GetAsync()
{
return await _applicationConfigurationAppService.GetAsync();
return await _applicationConfigurationAppService.GetAsync().ConfigureAwait(false);
}
}
}

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs

@ -35,7 +35,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
[Produces(MimeTypes.Application.Javascript, MimeTypes.Text.Plain)]
public async Task<ActionResult> Get()
{
var script = CreateAbpExtendScript(await _configurationAppService.GetAsync());
var script = CreateAbpExtendScript(await _configurationAppService.GetAsync().ConfigureAwait(false));
return Content(
_options.MinifyGeneratedScript == true

4
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs

@ -27,7 +27,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
{
if (!ShouldSaveAudit(context, out var auditLog, out var auditLogAction))
{
await next();
await next().ConfigureAwait(false);
return;
}
@ -37,7 +37,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
try
{
var result = await next();
var result = await next().ConfigureAwait(false);
if (result.Exception != null && !result.ExceptionHandled)
{

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs

@ -40,7 +40,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication
[HttpGet]
public async Task<ActionResult> Logout(string returnUrl = "", string returnUrlHash = "")
{
await HttpContext.SignOutAsync();
await HttpContext.SignOutAsync().ConfigureAwait(false);
return RedirectSafely(returnUrl, returnUrlHash);
}

6
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Features/AbpFeatureActionFilter.cs

@ -23,7 +23,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Features
{
if (!context.ActionDescriptor.IsControllerAction())
{
await next();
await next().ConfigureAwait(false);
return;
}
@ -33,9 +33,9 @@ namespace Volo.Abp.AspNetCore.Mvc.Features
{
await _methodInvocationAuthorizationService.CheckAsync(
new MethodInvocationFeatureCheckerContext(methodInfo)
);
).ConfigureAwait(false);
await next();
await next().ConfigureAwait(false);
}
}
}

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpDateTimeModelBinder.cs

@ -24,7 +24,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ModelBinding
public async Task BindModelAsync(ModelBindingContext bindingContext)
{
await _simpleTypeModelBinder.BindModelAsync(bindingContext);
await _simpleTypeModelBinder.BindModelAsync(bindingContext).ConfigureAwait(false);
if (!bindingContext.Result.IsModelSet)
{

14
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs

@ -25,7 +25,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Uow
{
if (!context.ActionDescriptor.IsControllerAction())
{
await next();
await next().ConfigureAwait(false);
return;
}
@ -39,7 +39,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Uow
if (unitOfWorkAttr?.IsDisabled == true)
{
await next();
await next().ConfigureAwait(false);
return;
}
@ -48,10 +48,10 @@ namespace Volo.Abp.AspNetCore.Mvc.Uow
//Trying to begin a reserved UOW by AbpUnitOfWorkMiddleware
if (_unitOfWorkManager.TryBeginReserved(AbpUnitOfWorkMiddleware.UnitOfWorkReservationName, options))
{
var result = await next();
var result = await next().ConfigureAwait(false);
if (!Succeed(result))
{
await RollbackAsync(context);
await RollbackAsync(context).ConfigureAwait(false);
}
return;
@ -60,10 +60,10 @@ namespace Volo.Abp.AspNetCore.Mvc.Uow
//Begin a new, independent unit of work
using (var uow = _unitOfWorkManager.Begin(options))
{
var result = await next();
var result = await next().ConfigureAwait(false);
if (Succeed(result))
{
await uow.CompleteAsync(context.HttpContext.RequestAborted);
await uow.CompleteAsync(context.HttpContext.RequestAborted).ConfigureAwait(false);
}
}
}
@ -89,7 +89,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Uow
var currentUow = _unitOfWorkManager.Current;
if (currentUow != null)
{
await currentUow.RollbackAsync(context.HttpContext.RequestAborted);
await currentUow.RollbackAsync(context.HttpContext.RequestAborted).ConfigureAwait(false);
}
}

4
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/AbpValidationActionFilter.cs

@ -22,12 +22,12 @@ namespace Volo.Abp.AspNetCore.Mvc.Validation
if (!context.ActionDescriptor.IsControllerAction() ||
!context.ActionDescriptor.HasObjectResult())
{
await next();
await next().ConfigureAwait(false);
return;
}
_validator.Validate(context.ModelState);
await next();
await next().ConfigureAwait(false);
}
}
}

4
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs

@ -27,11 +27,11 @@ namespace Microsoft.AspNetCore.RequestLocalization
next,
new OptionsWrapper<RequestLocalizationOptions>(
await _requestLocalizationOptionsProvider.GetLocalizationOptionsAsync()
),
.ConfigureAwait(false)),
_loggerFactory
);
await middleware.Invoke(context);
await middleware.Invoke(context).ConfigureAwait(false);
}
}
}

6
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/DefaultAbpRequestLocalizationOptionsProvider.cs

@ -36,15 +36,15 @@ namespace Microsoft.AspNetCore.RequestLocalization
{
if (_requestLocalizationOptions == null)
{
using (await _syncSemaphore.LockAsync())
using (await _syncSemaphore.LockAsync().ConfigureAwait(false))
{
using (var serviceScope = _serviceProviderFactory.CreateScope())
{
var languageProvider = serviceScope.ServiceProvider.GetRequiredService<ILanguageProvider>();
var settingProvider = serviceScope.ServiceProvider.GetRequiredService<ISettingProvider>();
var languages = await languageProvider.GetLanguagesAsync();
var defaultLanguage = await settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage);
var languages = await languageProvider.GetLanguagesAsync().ConfigureAwait(false);
var defaultLanguage = await settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage).ConfigureAwait(false);
var options = !languages.Any()
? new RequestLocalizationOptions()

6
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs

@ -30,7 +30,7 @@ namespace Volo.Abp.AspNetCore.Auditing
{
if (!ShouldWriteAuditLog(context))
{
await next(context);
await next(context).ConfigureAwait(false);
return;
}
@ -38,11 +38,11 @@ namespace Volo.Abp.AspNetCore.Auditing
{
try
{
await next(context);
await next(context).ConfigureAwait(false);
}
finally
{
await scope.SaveAsync();
await scope.SaveAsync().ConfigureAwait(false);
}
}
}

6
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs

@ -29,7 +29,7 @@ namespace Volo.Abp.AspNetCore.ExceptionHandling
{
try
{
await next(context);
await next(context).ConfigureAwait(false);
}
catch (Exception ex)
{
@ -44,7 +44,7 @@ namespace Volo.Abp.AspNetCore.ExceptionHandling
{
if (actionInfo.IsObjectResult) //TODO: Align with AbpExceptionFilter.ShouldHandleException!
{
await HandleAndWrapException(context, ex);
await HandleAndWrapException(context, ex).ConfigureAwait(false);
return;
}
}
@ -72,7 +72,7 @@ namespace Volo.Abp.AspNetCore.ExceptionHandling
errorInfoConverter.Convert(exception)
)
)
);
).ConfigureAwait(false);
}
private Task ClearCacheHeaders(object state)

2
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs

@ -24,7 +24,7 @@ namespace Volo.Abp.AspNetCore.Tracing
try
{
await next(context);
await next(context).ConfigureAwait(false);
}
finally
{

4
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs

@ -20,8 +20,8 @@ namespace Volo.Abp.AspNetCore.Uow
{
using (var uow = _unitOfWorkManager.Reserve(UnitOfWorkReservationName))
{
await next(context);
await uow.CompleteAsync(context.RequestAborted);
await next(context).ConfigureAwait(false);
await uow.CompleteAsync(context.RequestAborted).ConfigureAwait(false);
}
}
}

4
framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs

@ -22,7 +22,7 @@ namespace Volo.Abp.Auditing
{
if (!ShouldIntercept(invocation, out var auditLog, out var auditLogAction))
{
await invocation.ProceedAsync();
await invocation.ProceedAsync().ConfigureAwait(false);
return;
}
@ -30,7 +30,7 @@ namespace Volo.Abp.Auditing
try
{
await invocation.ProceedAsync();
await invocation.ProceedAsync().ConfigureAwait(false);
}
catch (Exception ex)
{

4
framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs

@ -116,7 +116,7 @@ namespace Volo.Abp.Auditing
if (ShouldSave(saveHandle.AuditLog))
{
await _auditingStore.SaveAsync(saveHandle.AuditLog);
await _auditingStore.SaveAsync(saveHandle.AuditLog).ConfigureAwait(false);
}
}
@ -152,7 +152,7 @@ namespace Volo.Abp.Auditing
public async Task SaveAsync()
{
await _auditingManager.SaveAsync(this);
await _auditingManager.SaveAsync(this).ConfigureAwait(false);
}
public void Dispose()

38
framework/src/Volo.Abp.Authorization/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions.cs

@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Authorization
authorizationService,
null,
policyName
);
).ConfigureAwait(false);
}
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, IAuthorizationRequirement requirement)
@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Authorization
authorizationService.AsAbpAuthorizationService().CurrentPrincipal,
resource,
requirement
);
).ConfigureAwait(false);
}
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, AuthorizationPolicy policy)
@ -31,16 +31,16 @@ namespace Microsoft.AspNetCore.Authorization
authorizationService.AsAbpAuthorizationService().CurrentPrincipal,
resource,
policy
);
).ConfigureAwait(false);
}
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, AuthorizationPolicy policy)
{
return await AuthorizeAsync(
authorizationService,
authorizationService,
null,
policy
);
).ConfigureAwait(false);
}
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, IEnumerable<IAuthorizationRequirement> requirements)
@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.Authorization
authorizationService.AsAbpAuthorizationService().CurrentPrincipal,
resource,
requirements
);
).ConfigureAwait(false);
}
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, string policyName)
@ -58,42 +58,42 @@ namespace Microsoft.AspNetCore.Authorization
authorizationService.AsAbpAuthorizationService().CurrentPrincipal,
resource,
policyName
);
).ConfigureAwait(false);
}
public static async Task<bool> IsGrantedAsync(this IAuthorizationService authorizationService, string policyName)
{
return (await authorizationService.AuthorizeAsync(policyName)).Succeeded;
return (await authorizationService.AuthorizeAsync(policyName).ConfigureAwait(false)).Succeeded;
}
public static async Task<bool> IsGrantedAsync(this IAuthorizationService authorizationService, object resource, IAuthorizationRequirement requirement)
{
return (await authorizationService.AuthorizeAsync(resource, requirement)).Succeeded;
return (await authorizationService.AuthorizeAsync(resource, requirement).ConfigureAwait(false)).Succeeded;
}
public static async Task<bool> IsGrantedAsync(this IAuthorizationService authorizationService, object resource, AuthorizationPolicy policy)
{
return (await authorizationService.AuthorizeAsync(resource, policy)).Succeeded;
return (await authorizationService.AuthorizeAsync(resource, policy).ConfigureAwait(false)).Succeeded;
}
public static async Task<bool> IsGrantedAsync(this IAuthorizationService authorizationService, AuthorizationPolicy policy)
{
return (await authorizationService.AuthorizeAsync(policy)).Succeeded;
return (await authorizationService.AuthorizeAsync(policy).ConfigureAwait(false)).Succeeded;
}
public static async Task<bool> IsGrantedAsync(this IAuthorizationService authorizationService, object resource, IEnumerable<IAuthorizationRequirement> requirements)
{
return (await authorizationService.AuthorizeAsync(resource, requirements)).Succeeded;
return (await authorizationService.AuthorizeAsync(resource, requirements).ConfigureAwait(false)).Succeeded;
}
public static async Task<bool> IsGrantedAsync(this IAuthorizationService authorizationService, object resource, string policyName)
{
return (await authorizationService.AuthorizeAsync(resource, policyName)).Succeeded;
return (await authorizationService.AuthorizeAsync(resource, policyName).ConfigureAwait(false)).Succeeded;
}
public static async Task CheckAsync(this IAuthorizationService authorizationService, string policyName)
{
if (!await authorizationService.IsGrantedAsync(policyName))
if (!await authorizationService.IsGrantedAsync(policyName).ConfigureAwait(false))
{
throw new AbpAuthorizationException("Authorization failed! Given policy has not granted: " + policyName);
}
@ -101,7 +101,7 @@ namespace Microsoft.AspNetCore.Authorization
public static async Task CheckAsync(this IAuthorizationService authorizationService, object resource, IAuthorizationRequirement requirement)
{
if (!await authorizationService.IsGrantedAsync(resource, requirement))
if (!await authorizationService.IsGrantedAsync(resource, requirement).ConfigureAwait(false))
{
throw new AbpAuthorizationException("Authorization failed! Given requirement has not granted for given resource: " + resource);
}
@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Authorization
public static async Task CheckAsync(this IAuthorizationService authorizationService, object resource, AuthorizationPolicy policy)
{
if (!await authorizationService.IsGrantedAsync(resource, policy))
if (!await authorizationService.IsGrantedAsync(resource, policy).ConfigureAwait(false))
{
throw new AbpAuthorizationException("Authorization failed! Given policy has not granted for given resource: " + resource);
}
@ -117,7 +117,7 @@ namespace Microsoft.AspNetCore.Authorization
public static async Task CheckAsync(this IAuthorizationService authorizationService, AuthorizationPolicy policy)
{
if (!await authorizationService.IsGrantedAsync(policy))
if (!await authorizationService.IsGrantedAsync(policy).ConfigureAwait(false))
{
throw new AbpAuthorizationException("Authorization failed! Given policy has not granted.");
}
@ -125,7 +125,7 @@ namespace Microsoft.AspNetCore.Authorization
public static async Task CheckAsync(this IAuthorizationService authorizationService, object resource, IEnumerable<IAuthorizationRequirement> requirements)
{
if (!await authorizationService.IsGrantedAsync(resource, requirements))
if (!await authorizationService.IsGrantedAsync(resource, requirements).ConfigureAwait(false))
{
throw new AbpAuthorizationException("Authorization failed! Given requirements have not granted for given resource: " + resource);
}
@ -133,7 +133,7 @@ namespace Microsoft.AspNetCore.Authorization
public static async Task CheckAsync(this IAuthorizationService authorizationService, object resource, string policyName)
{
if (!await authorizationService.IsGrantedAsync(resource, policyName))
if (!await authorizationService.IsGrantedAsync(resource, policyName).ConfigureAwait(false))
{
throw new AbpAuthorizationException("Authorization failed! Given polist has not granted for given resource: " + resource);
}

2
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs

@ -25,7 +25,7 @@ namespace Volo.Abp.Authorization
public override async Task<AuthorizationPolicy> GetPolicyAsync(string policyName)
{
var policy = await base.GetPolicyAsync(policyName);
var policy = await base.GetPolicyAsync(policyName).ConfigureAwait(false);
if (policy != null)
{
return policy;

6
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs

@ -15,8 +15,8 @@ namespace Volo.Abp.Authorization
public override async Task InterceptAsync(IAbpMethodInvocation invocation)
{
await AuthorizeAsync(invocation);
await invocation.ProceedAsync();
await AuthorizeAsync(invocation).ConfigureAwait(false);
await invocation.ProceedAsync().ConfigureAwait(false);
}
protected virtual async Task AuthorizeAsync(IAbpMethodInvocation invocation)
@ -25,7 +25,7 @@ namespace Volo.Abp.Authorization
new MethodInvocationAuthorizationContext(
invocation.Method
)
);
).ConfigureAwait(false);
}
}
}

4
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs

@ -34,7 +34,7 @@ namespace Volo.Abp.Authorization
foreach (var authorizationAttribute in GetAuthorizationDataAttributes(context.Method))
{
await CheckAsync(authorizationAttribute);
await CheckAsync(authorizationAttribute).ConfigureAwait(false);
}
}
@ -74,7 +74,7 @@ namespace Volo.Abp.Authorization
}
else
{
await _authorizationService.CheckAsync(authorizationAttribute.Policy);
await _authorizationService.CheckAsync(authorizationAttribute.Policy).ConfigureAwait(false);
}
//TODO: What about roles and other props?

2
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/PermissionRequirementHandler.cs

@ -17,7 +17,7 @@ namespace Volo.Abp.Authorization
AuthorizationHandlerContext context,
PermissionRequirement requirement)
{
if (await _permissionChecker.IsGrantedAsync(context.User, requirement.PermissionName))
if (await _permissionChecker.IsGrantedAsync(context.User, requirement.PermissionName).ConfigureAwait(false))
{
context.Succeed(requirement);
}

2
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs

@ -25,7 +25,7 @@ namespace Volo.Abp.Authorization.Permissions
}
return await PermissionStore.IsGrantedAsync(context.Permission.Name, Name, clientId)
? PermissionGrantResult.Granted
.ConfigureAwait(false) ? PermissionGrantResult.Granted
: PermissionGrantResult.Undefined;
}
}

4
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs

@ -29,7 +29,7 @@ namespace Volo.Abp.Authorization.Permissions
public virtual async Task<bool> IsGrantedAsync(string name)
{
return await IsGrantedAsync(PrincipalAccessor.Principal, name);
return await IsGrantedAsync(PrincipalAccessor.Principal, name).ConfigureAwait(false);
}
public virtual async Task<bool> IsGrantedAsync(ClaimsPrincipal claimsPrincipal, string name)
@ -56,7 +56,7 @@ namespace Volo.Abp.Authorization.Permissions
continue;
}
var result = await provider.CheckAsync(context);
var result = await provider.CheckAsync(context).ConfigureAwait(false);
if (result == PermissionGrantResult.Granted)
{

2
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs

@ -27,7 +27,7 @@ namespace Volo.Abp.Authorization.Permissions
foreach (var role in roles)
{
if (await PermissionStore.IsGrantedAsync(context.Permission.Name, Name, role))
if (await PermissionStore.IsGrantedAsync(context.Permission.Name, Name, role).ConfigureAwait(false))
{
return PermissionGrantResult.Granted;
}

2
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs

@ -25,7 +25,7 @@ namespace Volo.Abp.Authorization.Permissions
}
return await PermissionStore.IsGrantedAsync(context.Permission.Name, Name, userId)
? PermissionGrantResult.Granted
.ConfigureAwait(false) ? PermissionGrantResult.Granted
: PermissionGrantResult.Undefined;
}
}

10
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs

@ -71,11 +71,11 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
{
CheckDisposed();
using (await SyncObj.LockAsync())
using (await SyncObj.LockAsync().ConfigureAwait(false))
{
await EnsureInitializedAsync();
await EnsureInitializedAsync().ConfigureAwait(false);
await PublishAsync(args, priority, delay);
await PublishAsync(args, priority, delay).ConfigureAwait(false);
return null;
}
@ -90,9 +90,9 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
return;
}
using (await SyncObj.LockAsync())
using (await SyncObj.LockAsync().ConfigureAwait(false))
{
await EnsureInitializedAsync();
await EnsureInitializedAsync().ConfigureAwait(false);
}
}

8
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueManager.cs

@ -40,7 +40,7 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
foreach (var jobConfiguration in Options.GetJobs())
{
var jobQueue = (IRunnable)ServiceProvider.GetRequiredService(typeof(IJobQueue<>).MakeGenericType(jobConfiguration.ArgsType));
await jobQueue.StartAsync(cancellationToken);
await jobQueue.StartAsync(cancellationToken).ConfigureAwait(false);
JobQueues[jobConfiguration.JobName] = jobQueue;
}
}
@ -49,7 +49,7 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
{
foreach (var jobQueue in JobQueues.Values)
{
await jobQueue.StopAsync(cancellationToken);
await jobQueue.StopAsync(cancellationToken).ConfigureAwait(false);
}
JobQueues.Clear();
@ -64,7 +64,7 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
return (IJobQueue<TArgs>)jobQueue;
}
using (await SyncSemaphore.LockAsync())
using (await SyncSemaphore.LockAsync().ConfigureAwait(false))
{
if (JobQueues.TryGetValue(jobConfiguration.JobName, out jobQueue))
{
@ -74,7 +74,7 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
jobQueue = (IJobQueue<TArgs>)ServiceProvider
.GetRequiredService(typeof(IJobQueue<>).MakeGenericType(typeof(TArgs)));
await jobQueue.StartAsync();
await jobQueue.StartAsync().ConfigureAwait(false);
JobQueues.TryAdd(jobConfiguration.JobName, jobQueue);

4
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/RabbitMqBackgroundJobManager.cs

@ -19,8 +19,8 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
BackgroundJobPriority priority = BackgroundJobPriority.Normal,
TimeSpan? delay = null)
{
var jobQueue = await _jobQueueManager.GetAsync<TArgs>();
return await jobQueue.EnqueueAsync(args, priority, delay);
var jobQueue = await _jobQueueManager.GetAsync<TArgs>().ConfigureAwait(false);
return await jobQueue.EnqueueAsync(args, priority, delay).ConfigureAwait(false);
}
}
}

4
framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/DefaultBackgroundJobManager.cs

@ -32,7 +32,7 @@ namespace Volo.Abp.BackgroundJobs
public virtual async Task<string> EnqueueAsync<TArgs>(TArgs args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, TimeSpan? delay = null)
{
var jobName = BackgroundJobNameAttribute.GetName<TArgs>();
var jobId = await EnqueueAsync(jobName, args, priority, delay);
var jobId = await EnqueueAsync(jobName, args, priority, delay).ConfigureAwait(false);
return jobId.ToString();
}
@ -53,7 +53,7 @@ namespace Volo.Abp.BackgroundJobs
jobInfo.NextTryTime = Clock.Now.Add(delay.Value);
}
await Store.InsertAsync(jobInfo);
await Store.InsertAsync(jobInfo).ConfigureAwait(false);
return jobInfo.Id;
}

4
framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/BackgroundWorkerManager.cs

@ -56,7 +56,7 @@ namespace Volo.Abp.BackgroundWorkers
foreach (var worker in _backgroundWorkers)
{
await worker.StartAsync(cancellationToken);
await worker.StartAsync(cancellationToken).ConfigureAwait(false);
}
}
@ -66,7 +66,7 @@ namespace Volo.Abp.BackgroundWorkers
foreach (var worker in _backgroundWorkers)
{
await worker.StopAsync(cancellationToken);
await worker.StopAsync(cancellationToken).ConfigureAwait(false);
}
}
}

4
framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/PeriodicBackgroundWorkerBase.cs

@ -25,14 +25,14 @@ namespace Volo.Abp.BackgroundWorkers
public override async Task StartAsync(CancellationToken cancellationToken = default)
{
await base.StartAsync(cancellationToken);
await base.StartAsync(cancellationToken).ConfigureAwait(false);
Timer.Start(cancellationToken);
}
public override async Task StopAsync(CancellationToken cancellationToken = default)
{
Timer.Stop(cancellationToken);
await base.StopAsync(cancellationToken);
await base.StopAsync(cancellationToken).ConfigureAwait(false);
}
private void Timer_Elapsed(object sender, System.EventArgs e)

18
framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs

@ -175,7 +175,7 @@ namespace Volo.Abp.Caching
cachedBytes = await Cache.GetAsync(
NormalizeKey(key),
CancellationTokenProvider.FallbackToProvider(token)
);
).ConfigureAwait(false);
}
catch (Exception ex)
{
@ -250,22 +250,22 @@ namespace Volo.Abp.Caching
CancellationToken token = default)
{
token = CancellationTokenProvider.FallbackToProvider(token);
var value = await GetAsync(key, hideErrors, token);
var value = await GetAsync(key, hideErrors, token).ConfigureAwait(false);
if (value != null)
{
return value;
}
using (await SyncSemaphore.LockAsync(token))
using (await SyncSemaphore.LockAsync(token).ConfigureAwait(false))
{
value = await GetAsync(key, hideErrors, token);
value = await GetAsync(key, hideErrors, token).ConfigureAwait(false);
if (value != null)
{
return value;
}
value = await factory();
await SetAsync(key, value, optionsFactory?.Invoke(), hideErrors, token);
value = await factory().ConfigureAwait(false);
await SetAsync(key, value, optionsFactory?.Invoke(), hideErrors, token).ConfigureAwait(false);
}
return value;
@ -331,7 +331,7 @@ namespace Volo.Abp.Caching
Serializer.Serialize(value),
options ?? DefaultCacheOptions,
CancellationTokenProvider.FallbackToProvider(token)
);
).ConfigureAwait(false);
}
catch (Exception ex)
{
@ -387,7 +387,7 @@ namespace Volo.Abp.Caching
try
{
await Cache.RefreshAsync(NormalizeKey(key), CancellationTokenProvider.FallbackToProvider(token));
await Cache.RefreshAsync(NormalizeKey(key), CancellationTokenProvider.FallbackToProvider(token)).ConfigureAwait(false);
}
catch (Exception ex)
{
@ -443,7 +443,7 @@ namespace Volo.Abp.Caching
try
{
await Cache.RemoveAsync(NormalizeKey(key), CancellationTokenProvider.FallbackToProvider(token));
await Cache.RemoveAsync(NormalizeKey(key), CancellationTokenProvider.FallbackToProvider(token)).ConfigureAwait(false);
}
catch (Exception ex)
{

2
framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapter.cs

@ -20,7 +20,7 @@ namespace Volo.Abp.Castle.DynamicProxy
public override async Task ProceedAsync()
{
await Proceed(Invocation, ProceedInfo);
await Proceed(Invocation, ProceedInfo).ConfigureAwait(false);
}
}
}

4
framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs

@ -19,7 +19,7 @@ namespace Volo.Abp.Castle.DynamicProxy
{
await _abpInterceptor.InterceptAsync(
new CastleAbpMethodInvocationAdapter(invocation, proceedInfo, proceed)
);
).ConfigureAwait(false);
}
protected override async Task<TResult> InterceptAsync<TResult>(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func<IInvocation, IInvocationProceedInfo, Task<TResult>> proceed)
@ -28,7 +28,7 @@ namespace Volo.Abp.Castle.DynamicProxy
await _abpInterceptor.InterceptAsync(
adapter
);
).ConfigureAwait(false);
return (TResult)adapter.ReturnValue;
}

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs

@ -35,7 +35,7 @@ namespace Volo.Abp.Cli.Auth
configuration["[o]abp-organization-name"] = organizationName;
}
var accessToken = await AuthenticationService.GetAccessTokenAsync(configuration);
var accessToken = await AuthenticationService.GetAccessTokenAsync(configuration).ConfigureAwait(false);
File.WriteAllText(CliPaths.AccessToken, accessToken, Encoding.UTF8);
}

16
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs

@ -41,7 +41,7 @@ namespace Volo.Abp.Cli
{
Logger.LogInformation("ABP CLI (https://abp.io)");
await CheckCliVersionAsync();
await CheckCliVersionAsync().ConfigureAwait(false);
var commandLineArgs = CommandLineArgumentParser.Parse(args);
var commandType = CommandSelector.Select(commandLineArgs);
@ -52,7 +52,7 @@ namespace Volo.Abp.Cli
try
{
await command.ExecuteAsync(commandLineArgs);
await command.ExecuteAsync(commandLineArgs).ConfigureAwait(false);
}
catch (CliUsageException usageException)
{
@ -69,14 +69,14 @@ namespace Volo.Abp.Cli
{
var assembly = typeof(CliService).Assembly;
var toolPath = GetToolPath(assembly);
var currentCliVersion = await GetCurrentCliVersion(assembly);
var currentCliVersion = await GetCurrentCliVersion(assembly).ConfigureAwait(false);
var updateChannel = GetUpdateChannel(currentCliVersion);
Logger.LogInformation($"Version {currentCliVersion} ({updateChannel} channel)");
try
{
var latestVersion = await GetLatestVersion(updateChannel);
var latestVersion = await GetLatestVersion(updateChannel).ConfigureAwait(false);
if (latestVersion != null && latestVersion > currentCliVersion)
{
@ -106,7 +106,7 @@ namespace Volo.Abp.Cli
var consoleOutput = new StringReader(CmdHelper.RunCmdAndGetOutput($"dotnet tool list -g"));
string line;
while ((line = await consoleOutput.ReadLineAsync()) != null)
while ((line = await consoleOutput.ReadLineAsync().ConfigureAwait(false)) != null)
{
if (line.StartsWith("volo.abp.cli", StringComparison.InvariantCultureIgnoreCase))
{
@ -155,13 +155,13 @@ namespace Volo.Abp.Cli
switch (updateChannel)
{
case UpdateChannel.Stable:
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli");
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli").ConfigureAwait(false);
case UpdateChannel.Prerelease:
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli", includePreviews: true);
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli", includePreviews: true).ConfigureAwait(false);
case UpdateChannel.Nightly:
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli", includeNightly: true);
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli", includeNightly: true).ConfigureAwait(false);
default:
return default;

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs

@ -42,7 +42,7 @@ namespace Volo.Abp.Cli.Commands
commandLineArgs.Target,
commandLineArgs.Options.GetOrNull(Options.StartupProject.Short, Options.StartupProject.Long),
skipDbMigrations
);
).ConfigureAwait(false);
}
public string GetUsageInfo()

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs

@ -37,7 +37,7 @@ namespace Volo.Abp.Cli.Commands
await ProjectNugetPackageAdder.AddAsync(
GetProjectFile(commandLineArgs),
commandLineArgs.Target
);
).ConfigureAwait(false);
}
public string GetUsageInfo()

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs

@ -79,7 +79,7 @@ namespace Volo.Abp.Cli.Commands
gitHubLocalRepositoryPath,
commandLineArgs.Options
)
);
).ConfigureAwait(false);
using (var templateFileStream = new MemoryStream(result.ZipContent))
{

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs

@ -48,7 +48,7 @@ namespace Volo.Abp.Cli.Commands
commandLineArgs.Target,
password,
commandLineArgs.Options.GetOrNull(Options.Organization.Short, Options.Organization.Long)
);
).ConfigureAwait(false);
Logger.LogInformation($"Successfully logged in as '{commandLineArgs.Target}'");
}

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -97,7 +97,7 @@ namespace Volo.Abp.Cli.Commands
gitHubLocalRepositoryPath,
commandLineArgs.Options
)
);
).ConfigureAwait(false);
using (var templateFileStream = new MemoryStream(result.ZipContent))
{

10
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs

@ -36,12 +36,12 @@ namespace Volo.Abp.Cli.Commands
case "install":
Logger.LogInformation("Installing ABP Suite...");
await InstallSuiteAsync();
await InstallSuiteAsync().ConfigureAwait(false);
break;
case "update":
Logger.LogInformation("Updating ABP Suite...");
await UpdateSuiteAsync();
await UpdateSuiteAsync().ConfigureAwait(false);
break;
case "remove":
@ -53,7 +53,7 @@ namespace Volo.Abp.Cli.Commands
private async Task InstallSuiteAsync()
{
var nugetIndexUrl = await GetNuGetIndexUrlAsync();
var nugetIndexUrl = await GetNuGetIndexUrlAsync().ConfigureAwait(false);
if (nugetIndexUrl == null)
{
@ -71,7 +71,7 @@ namespace Volo.Abp.Cli.Commands
private async Task UpdateSuiteAsync()
{
var nugetIndexUrl = await GetNuGetIndexUrlAsync();
var nugetIndexUrl = await GetNuGetIndexUrlAsync().ConfigureAwait(false);
if (nugetIndexUrl == null)
{
@ -106,7 +106,7 @@ namespace Volo.Abp.Cli.Commands
private async Task<string> GetNuGetIndexUrlAsync()
{
var apiKeyResult = await _apiKeyService.GetApiKeyOrNullAsync();
var apiKeyResult = await _apiKeyService.GetApiKeyOrNullAsync().ConfigureAwait(false);
if (apiKeyResult == null || string.IsNullOrEmpty(apiKeyResult.ApiKey))
{

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs

@ -37,7 +37,7 @@ namespace Volo.Abp.Cli.Commands
if (updateNuget || !updateNpm)
{
await UpdateNugetPackages(commandLineArgs, directory);
await UpdateNugetPackages(commandLineArgs, directory).ConfigureAwait(false);
}
if (updateNpm || !updateNuget)
@ -62,7 +62,7 @@ namespace Volo.Abp.Cli.Commands
{
var solutionName = Path.GetFileName(solution).RemovePostFix(".sln");
await _nugetPackagesVersionUpdater.UpdateSolutionAsync(solution, includePreviews);
await _nugetPackagesVersionUpdater.UpdateSolutionAsync(solution, includePreviews).ConfigureAwait(false);
Logger.LogInformation($"Volo packages are updated in {solutionName} solution.");
return;
@ -74,7 +74,7 @@ namespace Volo.Abp.Cli.Commands
{
var projectName = Path.GetFileName(project).RemovePostFix(".csproj");
await _nugetPackagesVersionUpdater.UpdateProjectAsync(project, includePreviews);
await _nugetPackagesVersionUpdater.UpdateProjectAsync(project, includePreviews).ConfigureAwait(false);
Logger.LogInformation($"Volo packages are updated in {projectName} project.");
return;

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/AbpIoApiKeyService.cs

@ -55,16 +55,16 @@ namespace Volo.Abp.Cli.Licensing
$"Waiting {timeSpan.TotalSeconds} secs for the next try...");
}
})
.ExecuteAsync(async () => await client.GetAsync($"{CliUrls.WwwAbpIo}api/license/api-key"));
.ExecuteAsync(async () => await client.GetAsync($"{CliUrls.WwwAbpIo}api/license/api-key").ConfigureAwait(false)).ConfigureAwait(false);
if (!response.IsSuccessStatusCode)
{
throw new Exception($"ERROR: Remote server returns '{response.StatusCode}'");
}
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response);
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response).ConfigureAwait(false);
var responseContent = await response.Content.ReadAsStringAsync();
var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
return JsonSerializer.Deserialize<DeveloperApiKeyResult>(responseContent);
}
}

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs

@ -38,11 +38,11 @@ namespace Volo.Abp.Cli.NuGet
$"https://www.myget.org/F/abp-nightly/api/v3/flatcontainer/{packageId.ToLowerInvariant()}/index.json" :
$"https://api.nuget.org/v3-flatcontainer/{packageId.ToLowerInvariant()}/index.json";
var responseMessage = await client.GetAsync(url, CancellationTokenProvider.Token);
var responseMessage = await client.GetAsync(url, CancellationTokenProvider.Token).ConfigureAwait(false);
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage);
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage).ConfigureAwait(false);
var result = await responseMessage.Content.ReadAsStringAsync();
var result = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
var versions = JsonSerializer.Deserialize<NuGetVersionResultDto>(result).Versions.Select(x => SemanticVersion.Parse(x));

16
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs

@ -49,7 +49,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
string version = null)
{
var latestVersion = await GetLatestSourceCodeVersionAsync(name, type);
var latestVersion = await GetLatestSourceCodeVersionAsync(name, type).ConfigureAwait(false);
if (version == null)
{
version = latestVersion;
@ -73,7 +73,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
Type = type,
Version = version
}
);
).ConfigureAwait(false);
if (Options.CacheTemplates)
{
@ -98,11 +98,11 @@ namespace Volo.Abp.Cli.ProjectBuilding
MimeTypes.Application.Json
),
CancellationTokenProvider.Token
);
).ConfigureAwait(false);
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response);
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response).ConfigureAwait(false);
var result = await response.Content.ReadAsStringAsync();
var result = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
return JsonSerializer.Deserialize<GetLatestSourceCodeVersionResultDto>(result).Version;
}
@ -118,11 +118,11 @@ namespace Volo.Abp.Cli.ProjectBuilding
$"{CliUrls.WwwAbpIo}api/download/{input.Type}/",
new StringContent(postData, Encoding.UTF8, MimeTypes.Application.Json),
CancellationTokenProvider.Token
);
).ConfigureAwait(false);
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage);
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage).ConfigureAwait(false);
return await responseMessage.Content.ReadAsByteArrayAsync();
return await responseMessage.Content.ReadAsByteArrayAsync().ConfigureAwait(false);
}
}

4
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Analyticses/CliAnalyticsCollect.cs

@ -38,12 +38,12 @@ namespace Volo.Abp.Cli.ProjectBuilding.Analyticses
$"{CliUrls.WwwAbpIo}api/clianalytics/collect",
new StringContent(postData, Encoding.UTF8, MimeTypes.Application.Json),
_cancellationTokenProvider.Token
);
).ConfigureAwait(false);
if (!responseMessage.IsSuccessStatusCode)
{
var exceptionMessage = "Remote server returns '" + (int)responseMessage.StatusCode + "-" + responseMessage.ReasonPhrase + "'. ";
var remoteServiceErrorMessage = await _remoteServiceExceptionHandler.GetAbpRemoteServiceErrorAsync(responseMessage);
var remoteServiceErrorMessage = await _remoteServiceExceptionHandler.GetAbpRemoteServiceErrorAsync(responseMessage).ConfigureAwait(false);
if (remoteServiceErrorMessage != null)
{

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleInfoProvider.cs

@ -28,7 +28,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
public async Task<ModuleInfo> GetAsync(string name)
{
var moduleList = await GetModuleListAsync();
var moduleList = await GetModuleListAsync().ConfigureAwait(false);
var module = moduleList.FirstOrDefault(m => m.Name == name);
@ -47,10 +47,10 @@ namespace Volo.Abp.Cli.ProjectBuilding
var responseMessage = await client.GetAsync(
$"{CliUrls.WwwAbpIo}api/download/modules/",
CancellationTokenProvider.Token
);
).ConfigureAwait(false);
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage);
var result = await responseMessage.Content.ReadAsStringAsync();
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage).ConfigureAwait(false);
var result = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
return JsonSerializer.Deserialize<List<ModuleInfo>>(result);
}
}

10
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleProjectBuilder.cs

@ -43,15 +43,15 @@ namespace Volo.Abp.Cli.ProjectBuilding
public async Task<ProjectBuildResult> BuildAsync(ProjectBuildArgs args)
{
var moduleInfo = await GetModuleInfoAsync(args);
var moduleInfo = await GetModuleInfoAsync(args).ConfigureAwait(false);
var templateFile = await SourceCodeStore.GetAsync(
args.TemplateName,
SourceCodeTypes.Module,
args.Version
);
).ConfigureAwait(false);
var apiKeyResult = await ApiKeyService.GetApiKeyOrNullAsync();
var apiKeyResult = await ApiKeyService.GetApiKeyOrNullAsync().ConfigureAwait(false);
if (apiKeyResult?.ApiKey != null)
{
args.ExtraProperties["api-key"] = apiKeyResult.ApiKey;
@ -96,14 +96,14 @@ namespace Volo.Abp.Cli.ProjectBuilding
ProjectName = null,
TemplateName = args.TemplateName,
TemplateVersion = templateFile.Version
});
}).ConfigureAwait(false);
return new ProjectBuildResult(context.Result.ZipContent, args.TemplateName);
}
private async Task<ModuleInfo> GetModuleInfoAsync(ProjectBuildArgs args)
{
return await ModuleInfoProvider.GetAsync(args.TemplateName);
return await ModuleInfoProvider.GetAsync(args.TemplateName).ConfigureAwait(false);
}
}
}

4
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/RemoteServiceExceptionHandler.cs

@ -35,7 +35,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
var exceptionMessage = "Remote server returns '" + (int) responseMessage.StatusCode + "-" +
responseMessage.ReasonPhrase + "'. ";
var remoteServiceErrorMessage = await GetAbpRemoteServiceErrorAsync(responseMessage);
var remoteServiceErrorMessage = await GetAbpRemoteServiceErrorAsync(responseMessage).ConfigureAwait(false);
if (remoteServiceErrorMessage != null)
{
exceptionMessage += remoteServiceErrorMessage;
@ -52,7 +52,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
errorResult = _jsonSerializer.Deserialize<RemoteServiceErrorResponse>
(
await responseMessage.Content.ReadAsStringAsync()
);
.ConfigureAwait(false));
}
catch (JsonReaderException)
{

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs

@ -51,9 +51,9 @@ namespace Volo.Abp.Cli.ProjectBuilding
args.TemplateName,
SourceCodeTypes.Template,
args.Version
);
).ConfigureAwait(false);
var apiKeyResult = await ApiKeyService.GetApiKeyOrNullAsync();
var apiKeyResult = await ApiKeyService.GetApiKeyOrNullAsync().ConfigureAwait(false);
if (apiKeyResult?.ApiKey != null)
{
args.ExtraProperties["api-key"] = apiKeyResult.ApiKey;
@ -103,7 +103,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
ProjectName = args.SolutionName.FullName,
TemplateName = args.TemplateName,
TemplateVersion = templateFile.Version
});
}).ConfigureAwait(false);
return new ProjectBuildResult(context.Result.ZipContent, args.SolutionName.ProjectName);
}

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs

@ -45,7 +45,7 @@ namespace Volo.Abp.Cli.ProjectModification
await AddAsync(
projectFile,
await FindNugetPackageInfoAsync(packageName)
);
.ConfigureAwait(false)).ConfigureAwait(false);
}
public async Task AddAsync(string projectFile, NugetPackageInfo package)
@ -79,7 +79,7 @@ namespace Volo.Abp.Cli.ProjectModification
{
var url = $"{CliUrls.WwwAbpIo}api/app/nugetPackage/byName/?name=" + moduleName;
var response = await client.GetAsync(url);
var response = await client.GetAsync(url).ConfigureAwait(false);
if (!response.IsSuccessStatusCode)
{
@ -88,10 +88,10 @@ namespace Volo.Abp.Cli.ProjectModification
throw new CliUsageException($"'{moduleName}' nuget package could not be found!");
}
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response);
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response).ConfigureAwait(false);
}
var responseContent = await response.Content.ReadAsStringAsync();
var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
return JsonSerializer.Deserialize<NugetPackageInfo>(responseContent);
}
}

12
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs

@ -57,7 +57,7 @@ namespace Volo.Abp.Cli.ProjectModification
Check.NotNull(solutionFile, nameof(solutionFile));
Check.NotNull(moduleName, nameof(moduleName));
var module = await FindModuleInfoAsync(moduleName);
var module = await FindModuleInfoAsync(moduleName).ConfigureAwait(false);
Logger.LogInformation($"Installing module '{module.Name}' to the solution '{Path.GetFileNameWithoutExtension(solutionFile)}'");
@ -72,7 +72,7 @@ namespace Volo.Abp.Cli.ProjectModification
continue;
}
await ProjectNugetPackageAdder.AddAsync(targetProjectFile, nugetPackage);
await ProjectNugetPackageAdder.AddAsync(targetProjectFile, nugetPackage).ConfigureAwait(false);
}
if (!module.NpmPackages.IsNullOrEmpty())
@ -86,7 +86,7 @@ namespace Volo.Abp.Cli.ProjectModification
{
foreach (var npmPackage in module.NpmPackages.Where(p => p.ApplicationType.HasFlag(NpmApplicationType.Mvc)))
{
await ProjectNpmPackageAdder.AddAsync(Path.GetDirectoryName(targetProject), npmPackage);
await ProjectNpmPackageAdder.AddAsync(Path.GetDirectoryName(targetProject), npmPackage).ConfigureAwait(false);
}
}
}
@ -137,7 +137,7 @@ namespace Volo.Abp.Cli.ProjectModification
{
var url = $"{CliUrls.WwwAbpIo}api/app/module/byName/?name=" + moduleName;
var response = await client.GetAsync(url);
var response = await client.GetAsync(url).ConfigureAwait(false);
if (!response.IsSuccessStatusCode)
{
@ -146,10 +146,10 @@ namespace Volo.Abp.Cli.ProjectModification
throw new CliUsageException($"ERROR: '{moduleName}' module could not be found!");
}
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response);
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response).ConfigureAwait(false);
}
var responseContent = await response.Content.ReadAsStringAsync();
var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
return JsonSerializer.Deserialize<ModuleInfo>(responseContent);
}
}

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs

@ -22,20 +22,20 @@ namespace Volo.Abp.Cli.ProjectModification
foreach (var filePath in projectPaths)
{
await UpdateInternalAsync(filePath, includePreviews);
await UpdateInternalAsync(filePath, includePreviews).ConfigureAwait(false);
}
}
public async Task UpdateProjectAsync(string projectPath, bool includePreviews)
{
await UpdateInternalAsync(projectPath, includePreviews);
await UpdateInternalAsync(projectPath, includePreviews).ConfigureAwait(false);
}
protected virtual async Task UpdateInternalAsync(string projectPath, bool includePreviews)
{
var fileContent = File.ReadAllText(projectPath);
File.WriteAllText(projectPath, await UpdateVoloPackagesAsync(fileContent, includePreviews));
File.WriteAllText(projectPath, await UpdateVoloPackagesAsync(fileContent, includePreviews).ConfigureAwait(false));
}
private async Task<string> UpdateVoloPackagesAsync(string content, bool includePreviews)
@ -49,7 +49,7 @@ namespace Volo.Abp.Cli.ProjectModification
var packageId = package.Attributes["Include"].Value;
var packageVersion = SemanticVersion.Parse(versionAttribute.Value);
var latestVersion = await _nuGetService.GetLatestVersionOrNullAsync(packageId, includePreviews);
var latestVersion = await _nuGetService.GetLatestVersionOrNullAsync(packageId, includePreviews).ConfigureAwait(false);
if (latestVersion != null && packageVersion < latestVersion)
{

2
framework/src/Volo.Abp.Core/System/IO/AbpStreamExtensions.cs

@ -17,7 +17,7 @@ namespace System.IO
{
using (var memoryStream = new MemoryStream())
{
await stream.CopyToAsync(memoryStream);
await stream.CopyToAsync(memoryStream).ConfigureAwait(false);
return memoryStream.ToArray();
}
}

4
framework/src/Volo.Abp.Core/Volo/Abp/IO/FileHelper.cs

@ -54,7 +54,7 @@ namespace Volo.Abp.IO
{
using (var reader = File.OpenText(path))
{
return await reader.ReadToEndAsync();
return await reader.ReadToEndAsync().ConfigureAwait(false);
}
}
@ -68,7 +68,7 @@ namespace Volo.Abp.IO
using (var stream = File.Open(path, FileMode.Open))
{
var result = new byte[stream.Length];
await stream.ReadAsync(result, 0, (int)stream.Length);
await stream.ReadAsync(result, 0, (int)stream.Length).ConfigureAwait(false);
return result;
}
}

4
framework/src/Volo.Abp.Core/Volo/Abp/Threading/AsyncOneTimeRunner.cs

@ -21,14 +21,14 @@ namespace Volo.Abp.Threading
return;
}
using (await _semaphore.LockAsync())
using (await _semaphore.LockAsync().ConfigureAwait(false))
{
if (_runBefore)
{
return;
}
await action();
await action().ConfigureAwait(false);
_runBefore = true;
}

40
framework/src/Volo.Abp.Core/Volo/Abp/Threading/InternalAsyncHelper.cs

@ -14,8 +14,8 @@ namespace Volo.Abp.Threading
Exception exception = null;
try
{
await actualReturnValue;
{
await actualReturnValue.ConfigureAwait(false);
}
catch (Exception ex)
{
@ -33,9 +33,9 @@ namespace Volo.Abp.Threading
Exception exception = null;
try
{
await actualReturnValue;
await postAction();
{
await actualReturnValue.ConfigureAwait(false);
await postAction().ConfigureAwait(false);
}
catch (Exception ex)
{
@ -55,15 +55,15 @@ namespace Volo.Abp.Threading
try
{
if (preAction != null)
{
await preAction();
}
await actualReturnValue();
{
await preAction().ConfigureAwait(false);
}
await actualReturnValue().ConfigureAwait(false);
if (postAction != null)
{
await postAction();
{
await postAction().ConfigureAwait(false);
}
}
catch (Exception ex)
@ -86,7 +86,7 @@ namespace Volo.Abp.Threading
try
{
return await actualReturnValue;
return await actualReturnValue.ConfigureAwait(false);
}
catch (Exception ex)
{
@ -114,8 +114,8 @@ namespace Volo.Abp.Threading
try
{
var result = await actualReturnValue;
await postAction();
var result = await actualReturnValue.ConfigureAwait(false);
await postAction().ConfigureAwait(false);
return result;
}
catch (Exception ex)
@ -145,15 +145,15 @@ namespace Volo.Abp.Threading
try
{
if (preAction != null)
{
await preAction();
{
await preAction().ConfigureAwait(false);
}
var result = await actualReturnValue();
var result = await actualReturnValue().ConfigureAwait(false);
if (postAction != null)
{
await postAction();
{
await postAction().ConfigureAwait(false);
}
return result;

2
framework/src/Volo.Abp.Data/Volo/Abp/Data/DataSeeder.cs

@ -31,7 +31,7 @@ namespace Volo.Abp.Data
.ServiceProvider
.GetRequiredService(contributorType);
await contributor.SeedAsync(context);
await contributor.SeedAsync(context).ConfigureAwait(false);
}
}
}

2
framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs

@ -146,7 +146,7 @@ namespace Volo.Abp.Application.Services
return;
}
await AuthorizationService.CheckAsync(policyName);
await AuthorizationService.CheckAsync(policyName).ConfigureAwait(false);
}
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save