diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Microsoft/AspNetCore/Builder/JwtTokenMiddleware.cs b/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Microsoft/AspNetCore/Builder/JwtTokenMiddleware.cs index 4ff54f39bf..e93f558afd 100644 --- a/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Microsoft/AspNetCore/Builder/JwtTokenMiddleware.cs +++ b/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); }); } } diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs index ba8802a80e..b260df4247 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs @@ -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); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs index 1fbb72bb3e..a4f7eb0567 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs @@ -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) { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs index f769f512a5..9671703db8 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs +++ b/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 GetOrNullAsync(string name) { - var configuration = await ConfigurationClient.GetAsync(); + var configuration = await ConfigurationClient.GetAsync().ConfigureAwait(false); return configuration.Features.Values.GetOrDefault(name); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLanguageProvider.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLanguageProvider.cs index 02c97c0598..42b6eeb543 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLanguageProvider.cs +++ b/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> GetLanguagesAsync() { - var configuration = await ConfigurationClient.GetAsync(); + var configuration = await ConfigurationClient.GetAsync().ConfigureAwait(false); return configuration.Localization.Languages; } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemotePermissionChecker.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemotePermissionChecker.cs index 18f5272e7b..553160029b 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemotePermissionChecker.cs +++ b/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 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 IsGrantedAsync(ClaimsPrincipal claimsPrincipal, string name) { /* This provider always works for the current principal. */ - return await IsGrantedAsync(name); + return await IsGrantedAsync(name).ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteSettingProvider.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteSettingProvider.cs index db3ea6e9a6..d6526a0b7b 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteSettingProvider.cs +++ b/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 GetOrNullAsync(string name) { - var configuration = await ConfigurationClient.GetAsync(); + var configuration = await ConfigurationClient.GetAsync().ConfigureAwait(false); return configuration.Setting.Values.GetOrDefault(name); } public async Task> 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)) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs index 236387823c..8e95376663 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs @@ -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 = diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Breadcrumb/AbpBreadcrumbTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Breadcrumb/AbpBreadcrumbTagHelperService.cs index 8eeeb1e929..4b3a4dd471 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Breadcrumb/AbpBreadcrumbTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Breadcrumb/AbpBreadcrumbTagHelperService.cs @@ -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); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Carousel/AbpCarouselTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Carousel/AbpCarouselTagHelperService.cs index ffba80fb6f..65cffd8cb6 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Carousel/AbpCarouselTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Carousel/AbpCarouselTagHelperService.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Carousel var itemList = InitilizeCarouselItemsContentsContext(context, output); - await output.GetChildContentAsync(); + await output.GetChildContentAsync().ConfigureAwait(false); SetOneItemAsActive(context, output, itemList); SetItems(context, output, itemList); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs index 9dc279334b..509b801ba9 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs @@ -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); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionTagHelperService.cs index 20e62604a9..c6c5c2eb5e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionTagHelperService.cs @@ -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); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs index 10e49b92a7..2b81961f67 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs @@ -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); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs index 673204b302..459a7be318 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs @@ -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) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperExtensions.cs index d925fd11e8..6767e2bf1d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperExtensions.cs +++ b/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 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); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs index ee2a920980..5fb439b6f7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs @@ -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 GetModels(TagHelperContext context, TagHelperOutput output) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs index 75fe4f23e7..b1195b729e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs @@ -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) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs index b18bc6ed75..f1260883ef 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs @@ -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 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 "" + 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 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) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs index 25307c3fee..f1d2f5c02f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs @@ -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(""); @@ -102,7 +102,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination : (TagHelper.Model.CurrentPage - 1).ToString(); return "
  • \r\n" + - (await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey)) + "
  • "; + (await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey).ConfigureAwait(false)) + " "; } protected virtual async Task 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 "
  • = TagHelper.Model.TotalPageCount ? "disabled" : "") + "\">\r\n" + - (await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey)) + + (await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey).ConfigureAwait(false)) + "
  • "; } @@ -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]); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabDropdownTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabDropdownTagHelperService.cs index fb724af9c8..1b74a338dd 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabDropdownTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabDropdownTagHelperService.cs @@ -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>(TabItems); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs index 2de18d0592..7d8dc7224c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs @@ -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()); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs index 0098cbc1f0..37d307ac05 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs @@ -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); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs index f5806364f3..5683a2039f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs +++ b/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> GetStyleBundleFilesAsync(string bundleName) { - return await GetBundleFilesAsync(Options.StyleBundles, bundleName, StyleBundler); + return await GetBundleFilesAsync(Options.StyleBundles, bundleName, StyleBundler).ConfigureAwait(false); } public virtual async Task> GetScriptBundleFilesAsync(string bundleName) { - return await GetBundleFilesAsync(Options.ScriptBundles, bundleName, ScriptBundler); + return await GetBundleFilesAsync(Options.ScriptBundles, bundleName, ScriptBundler).ConfigureAwait(false); } protected virtual async Task> 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; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleItemTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleItemTagHelperService.cs index fc59051720..a7c504054c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleItemTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleItemTagHelperService.cs @@ -33,7 +33,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers TagHelper.CreateBundleTagHelperItem() }, TagHelper.GetNameOrNull() - ); + ).ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs index a8eadce1e8..45aeffaf92 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpBundleTagHelperService.cs @@ -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> GetBundleItems(TagHelperContext context, TagHelperOutput output) { var bundleItems = new List(); 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; } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs index 73b6e025ea..9095fdf335 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs +++ b/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(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs index b087db517f..8ab0dffc15 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs @@ -36,7 +36,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers protected override async Task> 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) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs index 2d273345cb..f82606fa03 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs @@ -36,7 +36,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers protected override async Task> 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) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantAppService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantAppService.cs index d0bea87196..7cb02623f1 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantAppService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantAppService.cs @@ -17,7 +17,7 @@ namespace Pages.Abp.MultiTenancy public async Task 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 FindTenantByIdAsync(Guid id) { - var tenant = await TenantStore.FindAsync(id); + var tenant = await TenantStore.FindAsync(id).ConfigureAwait(false); if (tenant == null) { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantController.cs index 5da47875d9..c36d36f61f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/AbpTenantController.cs +++ b/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 FindTenantByNameAsync(string name) { - return await _abpTenantAppService.FindTenantByNameAsync(name); + return await _abpTenantAppService.FindTenantByNameAsync(name).ConfigureAwait(false); } [HttpGet] [Route("tenants/by-id/{id}")] public async Task FindTenantByIdAsync(Guid id) { - return await _abpTenantAppService.FindTenantByIdAsync(id); + return await _abpTenantAppService.FindTenantByIdAsync(id).ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/TenantSwitchModal.cshtml.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/TenantSwitchModal.cshtml.cs index bfdbb98db8..da4d6d207d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Pages/Abp/MultiTenancy/TenantSwitchModal.cshtml.cs +++ b/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]); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/MainNavbarMenuViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/MainNavbarMenuViewComponent.cs index 0369457165..bccd8e00de 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/MainNavbarMenuViewComponent.cs +++ b/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 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); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/LanguageSwitchViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/LanguageSwitchViewComponent.cs index c6921d3210..e58190060b 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/LanguageSwitchViewComponent.cs +++ b/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 InvokeAsync() { - var languages = await _languageProvider.GetLanguagesAsync(); + var languages = await _languageProvider.GetLanguagesAsync().ConfigureAwait(false); var currentLanguage = languages.FindByCulture( CultureInfo.CurrentCulture.Name, CultureInfo.CurrentUICulture.Name diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/MainNavbarToolsViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/MainNavbarToolsViewComponent.cs index bfd02bbf4a..862dbe7e2f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/MainNavbarToolsViewComponent.cs +++ b/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 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); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/UserMenuViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/UserMenuViewComponent.cs index cde4208578..feb7fb09a5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/UserMenuViewComponent.cs +++ b/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 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); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Toolbars/BasicThemeMainTopToolbarContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Toolbars/BasicThemeMainTopToolbarContributor.cs index 1ed1d2d5d3..01e812adfe 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Toolbars/BasicThemeMainTopToolbarContributor.cs +++ b/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(); //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))); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Toolbars/ToolbarManager.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Toolbars/ToolbarManager.cs index f1ac30779a..e2d66a7d11 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Toolbars/ToolbarManager.cs +++ b/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); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpViewComponentHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpViewComponentHelper.cs index 826c7635cf..e148947c77 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpViewComponentHelper.cs +++ b/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 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($"
    ") - .AppendHtml(await DefaultViewComponentHelper.InvokeAsync(widget.ViewComponentType, arguments)) + .AppendHtml(await DefaultViewComponentHelper.InvokeAsync(widget.ViewComponentType, arguments).ConfigureAwait(false)) .AppendHtml("
    "); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetManager.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetManager.cs index ffd03d28dc..2249090bd8 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetManager.cs +++ b/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 IsGrantedAsync(string name) { var widget = Options.Widgets.Find(name); - return await IsGrantedAsyncInternal(widget, name); + return await IsGrantedAsyncInternal(widget, name).ConfigureAwait(false); } private async Task 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; } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs index 5015d146e8..1744658d41 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs +++ b/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()"); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs index 67672986be..ae41e579c9 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs +++ b/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 GetAsync() { - return await _applicationConfigurationAppService.GetAsync(); + return await _applicationConfigurationAppService.GetAsync().ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs index 6cc01966a5..00cef65179 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs @@ -35,7 +35,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations [Produces(MimeTypes.Application.Javascript, MimeTypes.Text.Plain)] public async Task Get() { - var script = CreateAbpExtendScript(await _configurationAppService.GetAsync()); + var script = CreateAbpExtendScript(await _configurationAppService.GetAsync().ConfigureAwait(false)); return Content( _options.MinifyGeneratedScript == true diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs index 33932137cb..4699689d76 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs +++ b/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) { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs index de8958920d..d3a8025813 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs +++ b/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 Logout(string returnUrl = "", string returnUrlHash = "") { - await HttpContext.SignOutAsync(); + await HttpContext.SignOutAsync().ConfigureAwait(false); return RedirectSafely(returnUrl, returnUrlHash); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Features/AbpFeatureActionFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Features/AbpFeatureActionFilter.cs index 577acda339..ffca5b12ee 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Features/AbpFeatureActionFilter.cs +++ b/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); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpDateTimeModelBinder.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpDateTimeModelBinder.cs index 1916b9aa16..1e31da90f8 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpDateTimeModelBinder.cs +++ b/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) { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs index 552ce7e04e..56153fedea 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs +++ b/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); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/AbpValidationActionFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/AbpValidationActionFilter.cs index ca87f2b962..963459ab58 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/AbpValidationActionFilter.cs +++ b/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); } } } diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs index a7dfa5044c..32fed42dc2 100644 --- a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs @@ -27,11 +27,11 @@ namespace Microsoft.AspNetCore.RequestLocalization next, new OptionsWrapper( await _requestLocalizationOptionsProvider.GetLocalizationOptionsAsync() - ), +.ConfigureAwait(false)), _loggerFactory ); - await middleware.Invoke(context); + await middleware.Invoke(context).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/DefaultAbpRequestLocalizationOptionsProvider.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/DefaultAbpRequestLocalizationOptionsProvider.cs index c30eafb9d0..51932953ed 100644 --- a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/DefaultAbpRequestLocalizationOptionsProvider.cs +++ b/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(); var settingProvider = serviceScope.ServiceProvider.GetRequiredService(); - 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() diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs index 78ae28e63f..d56c29709a 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs +++ b/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); } } } diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs index cdd921dae4..d9954dc424 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs +++ b/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) diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs index b3ee565100..068adffefb 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs +++ b/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 { diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs index c9ac1be509..46572b4450 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs +++ b/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); } } } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs index 5a401a218e..a49145298a 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs +++ b/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) { diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs index 070684f48a..25738843c0 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs +++ b/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() diff --git a/framework/src/Volo.Abp.Authorization/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions.cs b/framework/src/Volo.Abp.Authorization/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions.cs index d682d4f0c8..ef033170f6 100644 --- a/framework/src/Volo.Abp.Authorization/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions.cs +++ b/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 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 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 AuthorizeAsync(this IAuthorizationService authorizationService, AuthorizationPolicy policy) { return await AuthorizeAsync( - authorizationService, + authorizationService, null, policy - ); + ).ConfigureAwait(false); } public static async Task AuthorizeAsync(this IAuthorizationService authorizationService, object resource, IEnumerable requirements) @@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.Authorization authorizationService.AsAbpAuthorizationService().CurrentPrincipal, resource, requirements - ); + ).ConfigureAwait(false); } public static async Task 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 IsGrantedAsync(this IAuthorizationService authorizationService, string policyName) { - return (await authorizationService.AuthorizeAsync(policyName)).Succeeded; + return (await authorizationService.AuthorizeAsync(policyName).ConfigureAwait(false)).Succeeded; } public static async Task 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 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 IsGrantedAsync(this IAuthorizationService authorizationService, AuthorizationPolicy policy) { - return (await authorizationService.AuthorizeAsync(policy)).Succeeded; + return (await authorizationService.AuthorizeAsync(policy).ConfigureAwait(false)).Succeeded; } public static async Task IsGrantedAsync(this IAuthorizationService authorizationService, object resource, IEnumerable requirements) { - return (await authorizationService.AuthorizeAsync(resource, requirements)).Succeeded; + return (await authorizationService.AuthorizeAsync(resource, requirements).ConfigureAwait(false)).Succeeded; } public static async Task 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 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); } diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs index f636877fc1..61454b76e1 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs @@ -25,7 +25,7 @@ namespace Volo.Abp.Authorization public override async Task GetPolicyAsync(string policyName) { - var policy = await base.GetPolicyAsync(policyName); + var policy = await base.GetPolicyAsync(policyName).ConfigureAwait(false); if (policy != null) { return policy; diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs index 44466884dd..5c7afbd7c7 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs +++ b/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); } } } diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs index 56baba8ce4..1e063f1f0e 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/MethodInvocationAuthorizationService.cs +++ b/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? diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/PermissionRequirementHandler.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/PermissionRequirementHandler.cs index d4ec7c1d3c..89c0a1f71b 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/PermissionRequirementHandler.cs +++ b/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); } diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs index d6975e38ec..33aeb568b2 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs @@ -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; } } diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs index 51c8530ee6..165a354743 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs @@ -29,7 +29,7 @@ namespace Volo.Abp.Authorization.Permissions public virtual async Task IsGrantedAsync(string name) { - return await IsGrantedAsync(PrincipalAccessor.Principal, name); + return await IsGrantedAsync(PrincipalAccessor.Principal, name).ConfigureAwait(false); } public virtual async Task 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) { diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs index b98867a78e..f5322b4f12 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs @@ -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; } diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs index c7f327c40c..49a1eec366 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs @@ -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; } } diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs index f2b00345a1..7675a64ca0 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs +++ b/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); } } diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueManager.cs b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueManager.cs index f07564ad5a..6c50460003 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueManager.cs +++ b/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)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)ServiceProvider .GetRequiredService(typeof(IJobQueue<>).MakeGenericType(typeof(TArgs))); - await jobQueue.StartAsync(); + await jobQueue.StartAsync().ConfigureAwait(false); JobQueues.TryAdd(jobConfiguration.JobName, jobQueue); diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/RabbitMqBackgroundJobManager.cs b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/RabbitMqBackgroundJobManager.cs index f70d553128..8945beb6cb 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/RabbitMqBackgroundJobManager.cs +++ b/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(); - return await jobQueue.EnqueueAsync(args, priority, delay); + var jobQueue = await _jobQueueManager.GetAsync().ConfigureAwait(false); + return await jobQueue.EnqueueAsync(args, priority, delay).ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/DefaultBackgroundJobManager.cs b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/DefaultBackgroundJobManager.cs index 0994029f70..266bb37fde 100644 --- a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/DefaultBackgroundJobManager.cs +++ b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/DefaultBackgroundJobManager.cs @@ -32,7 +32,7 @@ namespace Volo.Abp.BackgroundJobs public virtual async Task EnqueueAsync(TArgs args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, TimeSpan? delay = null) { var jobName = BackgroundJobNameAttribute.GetName(); - 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; } diff --git a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/BackgroundWorkerManager.cs b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/BackgroundWorkerManager.cs index a8b884e096..27a0b05173 100644 --- a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/BackgroundWorkerManager.cs +++ b/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); } } } diff --git a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/PeriodicBackgroundWorkerBase.cs b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/PeriodicBackgroundWorkerBase.cs index e699e4cbc8..e2b0f5b53a 100644 --- a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/PeriodicBackgroundWorkerBase.cs +++ b/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) diff --git a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs index dbcfb184eb..daa64060f7 100644 --- a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs +++ b/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) { diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapter.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapter.cs index 89f3713521..7fbc9fdf0a 100644 --- a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapter.cs +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAbpMethodInvocationAdapter.cs @@ -20,7 +20,7 @@ namespace Volo.Abp.Castle.DynamicProxy public override async Task ProceedAsync() { - await Proceed(Invocation, ProceedInfo); + await Proceed(Invocation, ProceedInfo).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs index 8a0c4fdd45..bd379f442d 100644 --- a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/DynamicProxy/CastleAsyncAbpInterceptorAdapter.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.Castle.DynamicProxy { await _abpInterceptor.InterceptAsync( new CastleAbpMethodInvocationAdapter(invocation, proceedInfo, proceed) - ); + ).ConfigureAwait(false); } protected override async Task InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func> proceed) @@ -28,7 +28,7 @@ namespace Volo.Abp.Castle.DynamicProxy await _abpInterceptor.InterceptAsync( adapter - ); + ).ConfigureAwait(false); return (TResult)adapter.ReturnValue; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs index 66d16f9305..3fdd0aae1d 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs +++ b/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); } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs index 436e169aad..b53327cba3 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs +++ b/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; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs index 58adc65fc4..d8715c2700 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs +++ b/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() diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs index 03e228f255..cbfde5610f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs +++ b/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() diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs index e1536c2973..edd7bd985a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs +++ b/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)) { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs index fe9ed2d98f..175f45aa75 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs +++ b/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}'"); } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index 9cfa702fd7..1314f058c2 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs @@ -97,7 +97,7 @@ namespace Volo.Abp.Cli.Commands gitHubLocalRepositoryPath, commandLineArgs.Options ) - ); + ).ConfigureAwait(false); using (var templateFileStream = new MemoryStream(result.ZipContent)) { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs index a47a865617..1697489d71 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs +++ b/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 GetNuGetIndexUrlAsync() { - var apiKeyResult = await _apiKeyService.GetApiKeyOrNullAsync(); + var apiKeyResult = await _apiKeyService.GetApiKeyOrNullAsync().ConfigureAwait(false); if (apiKeyResult == null || string.IsNullOrEmpty(apiKeyResult.ApiKey)) { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs index d201790c94..166720c64e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs +++ b/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; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/AbpIoApiKeyService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/AbpIoApiKeyService.cs index 1b9539d012..68e2ac2dd3 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/AbpIoApiKeyService.cs +++ b/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(responseContent); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs index 1a067243d5..802c4e0a2e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs +++ b/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(result).Versions.Select(x => SemanticVersion.Parse(x)); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs index fd0a0e5246..a422f0ff44 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs +++ b/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(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); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Analyticses/CliAnalyticsCollect.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Analyticses/CliAnalyticsCollect.cs index fdfbb8b5d3..79fc70cfcc 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Analyticses/CliAnalyticsCollect.cs +++ b/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) { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleInfoProvider.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleInfoProvider.cs index 10b3a07172..8f8310977e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleInfoProvider.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleInfoProvider.cs @@ -28,7 +28,7 @@ namespace Volo.Abp.Cli.ProjectBuilding public async Task 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>(result); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleProjectBuilder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleProjectBuilder.cs index 48f109e1d3..f853a9ec15 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleProjectBuilder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleProjectBuilder.cs @@ -43,15 +43,15 @@ namespace Volo.Abp.Cli.ProjectBuilding public async Task 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 GetModuleInfoAsync(ProjectBuildArgs args) { - return await ModuleInfoProvider.GetAsync(args.TemplateName); + return await ModuleInfoProvider.GetAsync(args.TemplateName).ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/RemoteServiceExceptionHandler.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/RemoteServiceExceptionHandler.cs index 744641bb8a..8a1af93f23 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/RemoteServiceExceptionHandler.cs +++ b/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 ( await responseMessage.Content.ReadAsStringAsync() - ); +.ConfigureAwait(false)); } catch (JsonReaderException) { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs index 9d31e10200..87c399181d 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs +++ b/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); } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs index 1bacd7cd61..4bfe3ef4b8 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs +++ b/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(responseContent); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs index 5950872419..5e20904812 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs +++ b/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(responseContent); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs index 9f6b80b792..09c5a69ac1 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs +++ b/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 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) { diff --git a/framework/src/Volo.Abp.Core/System/IO/AbpStreamExtensions.cs b/framework/src/Volo.Abp.Core/System/IO/AbpStreamExtensions.cs index e87ab67527..206de7be0d 100644 --- a/framework/src/Volo.Abp.Core/System/IO/AbpStreamExtensions.cs +++ b/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(); } } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/IO/FileHelper.cs b/framework/src/Volo.Abp.Core/Volo/Abp/IO/FileHelper.cs index 21ca7c2086..49a86c388a 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/IO/FileHelper.cs +++ b/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; } } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Threading/AsyncOneTimeRunner.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Threading/AsyncOneTimeRunner.cs index 7b440ebfe6..44bd73c074 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Threading/AsyncOneTimeRunner.cs +++ b/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; } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Threading/InternalAsyncHelper.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Threading/InternalAsyncHelper.cs index 9972e59d3d..ce04a02479 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Threading/InternalAsyncHelper.cs +++ b/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; diff --git a/framework/src/Volo.Abp.Data/Volo/Abp/Data/DataSeeder.cs b/framework/src/Volo.Abp.Data/Volo/Abp/Data/DataSeeder.cs index c20badbeb7..a6a073b67b 100644 --- a/framework/src/Volo.Abp.Data/Volo/Abp/Data/DataSeeder.cs +++ b/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); } } } diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs index 0de23c826b..038ba0cf29 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs +++ b/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); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppService.cs index 4134b59a4c..e5febca25b 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppService.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppService.cs @@ -93,24 +93,24 @@ namespace Volo.Abp.Application.Services public virtual async Task GetAsync(TKey id) { - await CheckGetPolicyAsync(); + await CheckGetPolicyAsync().ConfigureAwait(false); - var entity = await GetEntityByIdAsync(id); + var entity = await GetEntityByIdAsync(id).ConfigureAwait(false); return MapToGetOutputDto(entity); } public virtual async Task> GetListAsync(TGetListInput input) { - await CheckGetListPolicyAsync(); + await CheckGetListPolicyAsync().ConfigureAwait(false); var query = CreateFilteredQuery(input); - var totalCount = await AsyncQueryableExecuter.CountAsync(query); + var totalCount = await AsyncQueryableExecuter.CountAsync(query).ConfigureAwait(false); query = ApplySorting(query, input); query = ApplyPaging(query, input); - var entities = await AsyncQueryableExecuter.ToListAsync(query); + var entities = await AsyncQueryableExecuter.ToListAsync(query).ConfigureAwait(false); return new PagedResultDto( totalCount, @@ -120,34 +120,34 @@ namespace Volo.Abp.Application.Services public virtual async Task CreateAsync(TCreateInput input) { - await CheckCreatePolicyAsync(); + await CheckCreatePolicyAsync().ConfigureAwait(false); var entity = MapToEntity(input); TryToSetTenantId(entity); - await Repository.InsertAsync(entity, autoSave: true); + await Repository.InsertAsync(entity, autoSave: true).ConfigureAwait(false); return MapToGetOutputDto(entity); } public virtual async Task UpdateAsync(TKey id, TUpdateInput input) { - await CheckUpdatePolicyAsync(); + await CheckUpdatePolicyAsync().ConfigureAwait(false); - var entity = await GetEntityByIdAsync(id); + var entity = await GetEntityByIdAsync(id).ConfigureAwait(false); //TODO: Check if input has id different than given id and normalize if it's default value, throw ex otherwise MapToEntity(input, entity); - await Repository.UpdateAsync(entity, autoSave: true); + await Repository.UpdateAsync(entity, autoSave: true).ConfigureAwait(false); return MapToGetOutputDto(entity); } public virtual async Task DeleteAsync(TKey id) { - await CheckDeletePolicyAsync(); + await CheckDeletePolicyAsync().ConfigureAwait(false); - await Repository.DeleteAsync(id); + await Repository.DeleteAsync(id).ConfigureAwait(false); } protected virtual Task GetEntityByIdAsync(TKey id) @@ -157,27 +157,27 @@ namespace Volo.Abp.Application.Services protected virtual async Task CheckGetPolicyAsync() { - await CheckPolicyAsync(GetPolicyName); + await CheckPolicyAsync(GetPolicyName).ConfigureAwait(false); } protected virtual async Task CheckGetListPolicyAsync() { - await CheckPolicyAsync(GetListPolicyName); + await CheckPolicyAsync(GetListPolicyName).ConfigureAwait(false); } protected virtual async Task CheckCreatePolicyAsync() { - await CheckPolicyAsync(CreatePolicyName); + await CheckPolicyAsync(CreatePolicyName).ConfigureAwait(false); } protected virtual async Task CheckUpdatePolicyAsync() { - await CheckPolicyAsync(UpdatePolicyName); + await CheckPolicyAsync(UpdatePolicyName).ConfigureAwait(false); } protected virtual async Task CheckDeletePolicyAsync() { - await CheckPolicyAsync(DeletePolicyName); + await CheckPolicyAsync(DeletePolicyName).ConfigureAwait(false); } /// diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs index c9219feffc..47e3571ffd 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs @@ -36,14 +36,14 @@ namespace Volo.Abp.Domain.Entities.Events public async Task TriggerEventsAsync(EntityChangeReport changeReport) { - await TriggerEventsInternalAsync(changeReport); + await TriggerEventsInternalAsync(changeReport).ConfigureAwait(false); if (changeReport.IsEmpty() || UnitOfWorkManager.Current == null) { return; } - await UnitOfWorkManager.Current.SaveChangesAsync(); + await UnitOfWorkManager.Current.SaveChangesAsync().ConfigureAwait(false); } public virtual async Task TriggerEntityCreatingEventAsync(object entity) @@ -53,7 +53,7 @@ namespace Volo.Abp.Domain.Entities.Events typeof(EntityCreatingEventData<>), entity, true - ); + ).ConfigureAwait(false); } public virtual async Task TriggerEntityCreatedEventOnUowCompletedAsync(object entity) @@ -63,7 +63,7 @@ namespace Volo.Abp.Domain.Entities.Events typeof(EntityCreatedEventData<>), entity, false - ); + ).ConfigureAwait(false); var eto = EntityToEtoMapper.Map(entity); if (eto != null) @@ -73,7 +73,7 @@ namespace Volo.Abp.Domain.Entities.Events typeof(EntityCreatedEto<>), eto, false - ); + ).ConfigureAwait(false); } } @@ -84,7 +84,7 @@ namespace Volo.Abp.Domain.Entities.Events typeof(EntityUpdatingEventData<>), entity, true - ); + ).ConfigureAwait(false); } public virtual async Task TriggerEntityUpdatedEventOnUowCompletedAsync(object entity) @@ -94,7 +94,7 @@ namespace Volo.Abp.Domain.Entities.Events typeof(EntityUpdatedEventData<>), entity, false - ); + ).ConfigureAwait(false); var eto = EntityToEtoMapper.Map(entity); if (eto != null) @@ -104,7 +104,7 @@ namespace Volo.Abp.Domain.Entities.Events typeof(EntityUpdatedEto<>), eto, false - ); + ).ConfigureAwait(false); } } @@ -115,7 +115,7 @@ namespace Volo.Abp.Domain.Entities.Events typeof(EntityDeletingEventData<>), entity, true - ); + ).ConfigureAwait(false); } public virtual async Task TriggerEntityDeletedEventOnUowCompletedAsync(object entity) @@ -125,7 +125,7 @@ namespace Volo.Abp.Domain.Entities.Events typeof(EntityDeletedEventData<>), entity, false - ); + ).ConfigureAwait(false); var eto = EntityToEtoMapper.Map(entity); if (eto != null) @@ -135,15 +135,15 @@ namespace Volo.Abp.Domain.Entities.Events typeof(EntityDeletedEto<>), EntityToEtoMapper.Map(entity), false - ); + ).ConfigureAwait(false); } } protected virtual async Task TriggerEventsInternalAsync(EntityChangeReport changeReport) { - await TriggerEntityChangeEvents(changeReport.ChangedEntities); - await TriggerLocalEvents(changeReport.DomainEvents); - await TriggerDistributedEvents(changeReport.DistributedEvents); + await TriggerEntityChangeEvents(changeReport.ChangedEntities).ConfigureAwait(false); + await TriggerLocalEvents(changeReport.DomainEvents).ConfigureAwait(false); + await TriggerDistributedEvents(changeReport.DistributedEvents).ConfigureAwait(false); } protected virtual async Task TriggerEntityChangeEvents(List changedEntities) @@ -153,16 +153,16 @@ namespace Volo.Abp.Domain.Entities.Events switch (changedEntity.ChangeType) { case EntityChangeType.Created: - await TriggerEntityCreatingEventAsync(changedEntity.Entity); - await TriggerEntityCreatedEventOnUowCompletedAsync(changedEntity.Entity); + await TriggerEntityCreatingEventAsync(changedEntity.Entity).ConfigureAwait(false); + await TriggerEntityCreatedEventOnUowCompletedAsync(changedEntity.Entity).ConfigureAwait(false); break; case EntityChangeType.Updated: - await TriggerEntityUpdatingEventAsync(changedEntity.Entity); - await TriggerEntityUpdatedEventOnUowCompletedAsync(changedEntity.Entity); + await TriggerEntityUpdatingEventAsync(changedEntity.Entity).ConfigureAwait(false); + await TriggerEntityUpdatedEventOnUowCompletedAsync(changedEntity.Entity).ConfigureAwait(false); break; case EntityChangeType.Deleted: - await TriggerEntityDeletingEventAsync(changedEntity.Entity); - await TriggerEntityDeletedEventOnUowCompletedAsync(changedEntity.Entity); + await TriggerEntityDeletingEventAsync(changedEntity.Entity).ConfigureAwait(false); + await TriggerEntityDeletedEventOnUowCompletedAsync(changedEntity.Entity).ConfigureAwait(false); break; default: throw new AbpException("Unknown EntityChangeType: " + changedEntity.ChangeType); @@ -174,7 +174,7 @@ namespace Volo.Abp.Domain.Entities.Events { foreach (var localEvent in localEvents) { - await LocalEventBus.PublishAsync(localEvent.EventData.GetType(), localEvent.EventData); + await LocalEventBus.PublishAsync(localEvent.EventData.GetType(), localEvent.EventData).ConfigureAwait(false); } } @@ -182,7 +182,7 @@ namespace Volo.Abp.Domain.Entities.Events { foreach (var distributedEvent in distributedEvents) { - await DistributedEventBus.PublishAsync(distributedEvent.EventData.GetType(), distributedEvent.EventData); + await DistributedEventBus.PublishAsync(distributedEvent.EventData.GetType(), distributedEvent.EventData).ConfigureAwait(false); } } @@ -193,7 +193,7 @@ namespace Volo.Abp.Domain.Entities.Events if (triggerInCurrentUnitOfWork || UnitOfWorkManager.Current == null) { - await eventPublisher.PublishAsync(eventType, Activator.CreateInstance(eventType, entity)); + await eventPublisher.PublishAsync(eventType, Activator.CreateInstance(eventType, entity)).ConfigureAwait(false); return; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs index d13d52ed97..ae438fdd01 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs @@ -46,7 +46,7 @@ namespace Volo.Abp.Domain.Repositories { public virtual async Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) { - var entity = await FindAsync(id, includeDetails, cancellationToken); + var entity = await FindAsync(id, includeDetails, cancellationToken).ConfigureAwait(false); if (entity == null) { @@ -60,13 +60,13 @@ namespace Volo.Abp.Domain.Repositories public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) { - var entity = await FindAsync(id, cancellationToken: cancellationToken); + var entity = await FindAsync(id, cancellationToken: cancellationToken).ConfigureAwait(false); if (entity == null) { return; } - await DeleteAsync(entity, autoSave, cancellationToken); + await DeleteAsync(entity, autoSave, cancellationToken).ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs index 29814f4de6..358d36733e 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs @@ -75,13 +75,13 @@ namespace Volo.Abp.Domain.Repositories public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) { - var entity = await FindAsync(id, cancellationToken: cancellationToken); + var entity = await FindAsync(id, cancellationToken: cancellationToken).ConfigureAwait(false); if (entity == null) { return; } - await DeleteAsync(entity, autoSave, cancellationToken); + await DeleteAsync(entity, autoSave, cancellationToken).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs index 40ebca015e..915b97a7d4 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs @@ -22,7 +22,7 @@ namespace Volo.Abp.Domain.Repositories var repo = ProxyHelper.UnProxy(repository) as ISupportsExplicitLoading; if (repo != null) { - await repo.EnsureCollectionLoadedAsync(entity, propertyExpression, cancellationToken); + await repo.EnsureCollectionLoadedAsync(entity, propertyExpression, cancellationToken).ConfigureAwait(false); } } @@ -38,7 +38,7 @@ namespace Volo.Abp.Domain.Repositories var repo = ProxyHelper.UnProxy(repository) as ISupportsExplicitLoading; if (repo != null) { - await repo.EnsurePropertyLoadedAsync(entity, propertyExpression, cancellationToken); + await repo.EnsurePropertyLoadedAsync(entity, propertyExpression, cancellationToken).ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderBase.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderBase.cs index f6588de9fb..aa38f874d6 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderBase.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderBase.cs @@ -32,29 +32,29 @@ namespace Volo.Abp.Emailing Subject = subject, Body = body, IsBodyHtml = isBodyHtml - }); + }).ConfigureAwait(false); } public virtual async Task SendAsync(string from, string to, string subject, string body, bool isBodyHtml = true) { - await SendAsync(new MailMessage(from, to, subject, body) { IsBodyHtml = isBodyHtml }); + await SendAsync(new MailMessage(from, to, subject, body) { IsBodyHtml = isBodyHtml }).ConfigureAwait(false); } public virtual async Task SendAsync(MailMessage mail, bool normalize = true) { if (normalize) { - await NormalizeMailAsync(mail); + await NormalizeMailAsync(mail).ConfigureAwait(false); } - await SendEmailAsync(mail); + await SendEmailAsync(mail).ConfigureAwait(false); } public virtual async Task QueueAsync(string to, string subject, string body, bool isBodyHtml = true) { if (!BackgroundJobManager.IsAvailable()) { - await SendAsync(to, subject, body, isBodyHtml); + await SendAsync(to, subject, body, isBodyHtml).ConfigureAwait(false); return; } @@ -66,7 +66,7 @@ namespace Volo.Abp.Emailing Body = body, IsBodyHtml = isBodyHtml } - ); + ).ConfigureAwait(false); } /// @@ -86,8 +86,8 @@ namespace Volo.Abp.Emailing if (mail.From == null || mail.From.Address.IsNullOrEmpty()) { mail.From = new MailAddress( - await Configuration.GetDefaultFromAddressAsync(), - await Configuration.GetDefaultFromDisplayNameAsync(), + await Configuration.GetDefaultFromAddressAsync().ConfigureAwait(false), + await Configuration.GetDefaultFromDisplayNameAsync().ConfigureAwait(false), Encoding.UTF8 ); } diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderConfiguration.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderConfiguration.cs index e02b78badd..dafd5b8a4f 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderConfiguration.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderConfiguration.cs @@ -37,7 +37,7 @@ namespace Volo.Abp.Emailing /// Value of the setting protected async Task GetNotEmptySettingValueAsync(string name) { - var value = await SettingProvider.GetOrNullAsync(name); + var value = await SettingProvider.GetOrNullAsync(name).ConfigureAwait(false); if (value.IsNullOrEmpty()) { diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/SmtpEmailSender.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/SmtpEmailSender.cs index f97fd57b18..84af1bf348 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/SmtpEmailSender.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/SmtpEmailSender.cs @@ -28,19 +28,19 @@ namespace Volo.Abp.Emailing.Smtp public async Task BuildClientAsync() { - var host = await SmtpConfiguration.GetHostAsync(); - var port = await SmtpConfiguration.GetPortAsync(); + var host = await SmtpConfiguration.GetHostAsync().ConfigureAwait(false); + var port = await SmtpConfiguration.GetPortAsync().ConfigureAwait(false); var smtpClient = new SmtpClient(host, port); try { - if (await SmtpConfiguration.GetEnableSslAsync()) + if (await SmtpConfiguration.GetEnableSslAsync().ConfigureAwait(false)) { smtpClient.EnableSsl = true; } - if (await SmtpConfiguration.GetUseDefaultCredentialsAsync()) + if (await SmtpConfiguration.GetUseDefaultCredentialsAsync().ConfigureAwait(false)) { smtpClient.UseDefaultCredentials = true; } @@ -48,11 +48,11 @@ namespace Volo.Abp.Emailing.Smtp { smtpClient.UseDefaultCredentials = false; - var userName = await SmtpConfiguration.GetUserNameAsync(); + var userName = await SmtpConfiguration.GetUserNameAsync().ConfigureAwait(false); if (!userName.IsNullOrEmpty()) { - var password = await SmtpConfiguration.GetPasswordAsync(); - var domain = await SmtpConfiguration.GetDomainAsync(); + var password = await SmtpConfiguration.GetPasswordAsync().ConfigureAwait(false); + var domain = await SmtpConfiguration.GetDomainAsync().ConfigureAwait(false); smtpClient.Credentials = !domain.IsNullOrEmpty() ? new NetworkCredential(userName, password, domain) : new NetworkCredential(userName, password); @@ -70,9 +70,9 @@ namespace Volo.Abp.Emailing.Smtp protected override async Task SendEmailAsync(MailMessage mail) { - using (var smtpClient = await BuildClientAsync()) + using (var smtpClient = await BuildClientAsync().ConfigureAwait(false)) { - await smtpClient.SendMailAsync(mail); + await smtpClient.SendMailAsync(mail).ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Templates/EmailTemplateProvider.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Templates/EmailTemplateProvider.cs index c67af27757..374470e418 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Templates/EmailTemplateProvider.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Templates/EmailTemplateProvider.cs @@ -27,12 +27,12 @@ namespace Volo.Abp.Emailing.Templates public async Task GetAsync(string name) { - return await GetAsync(name, CultureInfo.CurrentUICulture.Name); + return await GetAsync(name, CultureInfo.CurrentUICulture.Name).ConfigureAwait(false); } public async Task GetAsync(string name, string cultureName) { - return await GetInternalAsync(name, cultureName); + return await GetInternalAsync(name, cultureName).ConfigureAwait(false); } protected virtual async Task GetInternalAsync(string name, string cultureName) @@ -59,11 +59,11 @@ namespace Volo.Abp.Emailing.Templates { var emailTemplate = new EmailTemplate(emailTemplateString, emailTemplateDefinition); - await SetLayoutAsync(emailTemplateDefinition, emailTemplate, cultureName); + await SetLayoutAsync(emailTemplateDefinition, emailTemplate, cultureName).ConfigureAwait(false); if (emailTemplateDefinition.SingleTemplateFile) { - await LocalizeAsync(emailTemplateDefinition, emailTemplate, cultureName); + await LocalizeAsync(emailTemplateDefinition, emailTemplate, cultureName).ConfigureAwait(false); } return emailTemplate; @@ -87,7 +87,7 @@ namespace Volo.Abp.Emailing.Templates layout = Options.DefaultLayout; } - var layoutTemplate = await GetInternalAsync(layout, cultureName); + var layoutTemplate = await GetInternalAsync(layout, cultureName).ConfigureAwait(false); emailTemplate.SetLayout(layoutTemplate); } diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Templates/TemplateRender.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Templates/TemplateRender.cs index 8c4e24017c..1713cf9f3f 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Templates/TemplateRender.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Templates/TemplateRender.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.Emailing.Templates public async Task RenderAsync(string template, object model = null) { var scribanTemplate = Template.Parse(template); - return await scribanTemplate.RenderAsync(model); + return await scribanTemplate.RenderAsync(model).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs index 4131a774b5..7890b9b50d 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs @@ -46,7 +46,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore if (autoSave) { - await DbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)); + await DbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } return savedEntity; @@ -60,7 +60,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore if (autoSave) { - await DbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)); + await DbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } return updatedEntity; @@ -72,7 +72,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore if (autoSave) { - await DbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)); + await DbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } } @@ -80,12 +80,12 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore { return includeDetails ? await WithDetails().ToListAsync(GetCancellationToken(cancellationToken)) - : await DbSet.ToListAsync(GetCancellationToken(cancellationToken)); +.ConfigureAwait(false) : await DbSet.ToListAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public override async Task GetCountAsync(CancellationToken cancellationToken = default) { - return await DbSet.LongCountAsync(GetCancellationToken(cancellationToken)); + return await DbSet.LongCountAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } protected override IQueryable GetQueryable() @@ -97,7 +97,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore { var entities = await GetQueryable() .Where(predicate) - .ToListAsync(GetCancellationToken(cancellationToken)); + .ToListAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); foreach (var entity in entities) { @@ -106,7 +106,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore if (autoSave) { - await DbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)); + await DbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } } @@ -119,7 +119,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore await DbContext .Entry(entity) .Collection(propertyExpression) - .LoadAsync(GetCancellationToken(cancellationToken)); + .LoadAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public virtual async Task EnsurePropertyLoadedAsync( @@ -131,7 +131,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore await DbContext .Entry(entity) .Reference(propertyExpression) - .LoadAsync(GetCancellationToken(cancellationToken)); + .LoadAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public override IQueryable WithDetails() @@ -187,7 +187,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore public virtual async Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) { - var entity = await FindAsync(id, includeDetails, GetCancellationToken(cancellationToken)); + var entity = await FindAsync(id, includeDetails, GetCancellationToken(cancellationToken)).ConfigureAwait(false); if (entity == null) { @@ -208,18 +208,18 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore { return includeDetails ? await WithDetails().FirstOrDefaultAsync(e => e.Id.Equals(id), GetCancellationToken(cancellationToken)) - : await DbSet.FindAsync(new object[] { id }, GetCancellationToken(cancellationToken)); +.ConfigureAwait(false) : await DbSet.FindAsync(new object[] { id }, GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) { - var entity = await FindAsync(id, cancellationToken: cancellationToken); + var entity = await FindAsync(id, cancellationToken: cancellationToken).ConfigureAwait(false); if (entity == null) { return; } - await DeleteAsync(entity, autoSave, cancellationToken); + await DeleteAsync(entity, autoSave, cancellationToken).ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs index 87de3f1247..dea620f1e9 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs @@ -117,9 +117,9 @@ namespace Volo.Abp.EntityFrameworkCore var changeReport = ApplyAbpConcepts(); - var result = await base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken); + var result = await base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken).ConfigureAwait(false); - await EntityChangeEventHelper.TriggerEventsAsync(changeReport); + await EntityChangeEventHelper.TriggerEventsAsync(changeReport).ConfigureAwait(false); if (auditLog != null) { diff --git a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs index c530437e6f..9df352837a 100644 --- a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs +++ b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs @@ -85,7 +85,7 @@ namespace Volo.Abp.EventBus.RabbitMq var eventData = Serializer.Deserialize(ea.Body, eventType); - await TriggerHandlersAsync(eventType, eventData); + await TriggerHandlersAsync(eventType, eventData).ConfigureAwait(false); } public IDisposable Subscribe(IDistributedEventHandler handler) where TEvent : class diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/ActionEventHandler.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/ActionEventHandler.cs index a8763edd89..3594ce3c96 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/ActionEventHandler.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/ActionEventHandler.cs @@ -32,7 +32,7 @@ namespace Volo.Abp.EventBus /// public async Task HandleEventAsync(TEvent eventData) { - await Action(eventData); + await Action(eventData).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs index cb8ae75336..76d508cfc5 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs @@ -89,7 +89,7 @@ namespace Volo.Abp.EventBus { var exceptions = new List(); - await TriggerHandlersAsync(eventType, eventData, exceptions); + await TriggerHandlersAsync(eventType, eventData, exceptions).ConfigureAwait(false); if (exceptions.Any()) { @@ -110,7 +110,7 @@ namespace Volo.Abp.EventBus { foreach (var handlerFactory in handlerFactories.EventHandlerFactories) { - await TriggerHandlerAsync(handlerFactory, handlerFactories.EventType, eventData, exceptions); + await TriggerHandlerAsync(handlerFactory, handlerFactories.EventType, eventData, exceptions).ConfigureAwait(false); } } @@ -126,7 +126,7 @@ namespace Volo.Abp.EventBus var baseEventType = eventType.GetGenericTypeDefinition().MakeGenericType(baseArg); var constructorArgs = ((IEventDataWithInheritableGenericArgument)eventData).GetConstructorArgs(); var baseEventData = Activator.CreateInstance(baseEventType, constructorArgs); - await PublishAsync(baseEventType, baseEventData); + await PublishAsync(baseEventType, baseEventData).ConfigureAwait(false); } } } @@ -171,7 +171,7 @@ namespace Volo.Abp.EventBus new[] { eventType } ); - await (Task)method.Invoke(eventHandlerWrapper.EventHandler, new[] { eventData }); + await (Task)method.Invoke(eventHandlerWrapper.EventHandler, new[] { eventData }).ConfigureAwait(false); } else if (ReflectionHelper.IsAssignableToGenericType(handlerType, typeof(IDistributedEventHandler<>))) { @@ -182,7 +182,7 @@ namespace Volo.Abp.EventBus new[] { eventType } ); - await (Task)method.Invoke(eventHandlerWrapper.EventHandler, new[] { eventData }); + await (Task)method.Invoke(eventHandlerWrapper.EventHandler, new[] { eventData }).ConfigureAwait(false); } else { diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs index 7db5c18f01..117eeeb06f 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs @@ -119,7 +119,7 @@ namespace Volo.Abp.EventBus.Local { var exceptions = new List(); - await TriggerHandlersAsync(eventType, eventData, exceptions); + await TriggerHandlersAsync(eventType, eventData, exceptions).ConfigureAwait(false); if (exceptions.Any()) { diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs index 49ea1b3f4c..75c9c7ae5f 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs @@ -26,7 +26,7 @@ namespace Volo.Abp.Features return null; } - return await FeatureStore.GetOrNullAsync(feature.Name, Name, editionId.Value.ToString()); + return await FeatureStore.GetOrNullAsync(feature.Name, Name, editionId.Value.ToString()).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs index 0c653c3448..0c90ea7573 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs @@ -46,7 +46,7 @@ namespace Volo.Abp.Features providers = providers.Where(p => featureDefinition.AllowedProviders.Contains(p.Name)); } - return await GetOrNullValueFromProvidersAsync(providers, featureDefinition); + return await GetOrNullValueFromProvidersAsync(providers, featureDefinition).ConfigureAwait(false); } protected virtual async Task GetOrNullValueFromProvidersAsync( @@ -55,7 +55,7 @@ namespace Volo.Abp.Features { foreach (var provider in providers) { - var value = await provider.GetOrNullAsync(feature); + var value = await provider.GetOrNullAsync(feature).ConfigureAwait(false); if (value != null) { return value; diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureCheckerBase.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureCheckerBase.cs index a24e0901f7..23c5c37431 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureCheckerBase.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureCheckerBase.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.Features public virtual async Task IsEnabledAsync(string name) { - var value = await GetOrNullAsync(name); + var value = await GetOrNullAsync(name).ConfigureAwait(false); if (value == null) { return false; diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureCheckerExtensions.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureCheckerExtensions.cs index 8850408df0..d26f7be841 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureCheckerExtensions.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureCheckerExtensions.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.Features Check.NotNull(featureChecker, nameof(featureChecker)); Check.NotNull(name, nameof(name)); - var value = await featureChecker.GetOrNullAsync(name); + var value = await featureChecker.GetOrNullAsync(name).ConfigureAwait(false); return value?.To() ?? defaultValue; } @@ -32,7 +32,7 @@ namespace Volo.Abp.Features { foreach (var featureName in featureNames) { - if (!(await featureChecker.IsEnabledAsync(featureName))) + if (!(await featureChecker.IsEnabledAsync(featureName).ConfigureAwait(false))) { return false; } @@ -43,7 +43,7 @@ namespace Volo.Abp.Features foreach (var featureName in featureNames) { - if (await featureChecker.IsEnabledAsync(featureName)) + if (await featureChecker.IsEnabledAsync(featureName).ConfigureAwait(false)) { return true; } @@ -54,7 +54,7 @@ namespace Volo.Abp.Features public static async Task CheckEnabledAsync(this IFeatureChecker featureChecker, string featureName) { - if (!(await featureChecker.IsEnabledAsync(featureName))) + if (!(await featureChecker.IsEnabledAsync(featureName).ConfigureAwait(false))) { throw new AbpAuthorizationException("Feature is not enabled: " + featureName); } @@ -71,7 +71,7 @@ namespace Volo.Abp.Features { foreach (var featureName in featureNames) { - if (!(await featureChecker.IsEnabledAsync(featureName))) + if (!(await featureChecker.IsEnabledAsync(featureName).ConfigureAwait(false))) { throw new AbpAuthorizationException( "Required features are not enabled. All of these features must be enabled: " + @@ -84,7 +84,7 @@ namespace Volo.Abp.Features { foreach (var featureName in featureNames) { - if (await featureChecker.IsEnabledAsync(featureName)) + if (await featureChecker.IsEnabledAsync(featureName).ConfigureAwait(false)) { return; } diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureInterceptor.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureInterceptor.cs index 9986af6275..9f3d5dc356 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureInterceptor.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureInterceptor.cs @@ -19,12 +19,12 @@ namespace Volo.Abp.Features { if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.FeatureChecking)) { - await invocation.ProceedAsync(); + await invocation.ProceedAsync().ConfigureAwait(false); return; } - await CheckFeaturesAsync(invocation); - await invocation.ProceedAsync(); + await CheckFeaturesAsync(invocation).ConfigureAwait(false); + await invocation.ProceedAsync().ConfigureAwait(false); } protected virtual async Task CheckFeaturesAsync(IAbpMethodInvocation invocation) @@ -33,7 +33,7 @@ namespace Volo.Abp.Features new MethodInvocationFeatureCheckerContext( invocation.Method ) - ); + ).ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/MethodInvocationFeatureCheckerService.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/MethodInvocationFeatureCheckerService.cs index da7becc61f..bff6405d57 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/MethodInvocationFeatureCheckerService.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/MethodInvocationFeatureCheckerService.cs @@ -25,7 +25,7 @@ namespace Volo.Abp.Features foreach (var requiresFeatureAttribute in GetRequiredFeatureAttributes(context.Method)) { - await _featureChecker.CheckEnabledAsync(requiresFeatureAttribute.RequiresAll, requiresFeatureAttribute.Features); + await _featureChecker.CheckEnabledAsync(requiresFeatureAttribute.RequiresAll, requiresFeatureAttribute.Features).ConfigureAwait(false); } } diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/TenantFeatureValueProvider.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/TenantFeatureValueProvider.cs index 5ae4b5f876..71cdfe3f59 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/TenantFeatureValueProvider.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/TenantFeatureValueProvider.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.Features public override async Task GetOrNullAsync(FeatureDefinition feature) { - return await FeatureStore.GetOrNullAsync(feature.Name, Name, CurrentTenant.Id?.ToString()); + return await FeatureStore.GetOrNullAsync(feature.Name, Name, CurrentTenant.Id?.ToString()).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo/Abp/Http/Client/IdentityModel/IdentityModelRemoteServiceHttpClientAuthenticator.cs b/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo/Abp/Http/Client/IdentityModel/IdentityModelRemoteServiceHttpClientAuthenticator.cs index 25763efbd5..efc61907dc 100644 --- a/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo/Abp/Http/Client/IdentityModel/IdentityModelRemoteServiceHttpClientAuthenticator.cs +++ b/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo/Abp/Http/Client/IdentityModel/IdentityModelRemoteServiceHttpClientAuthenticator.cs @@ -25,7 +25,7 @@ namespace Volo.Abp.Http.Client.IdentityModel { if (context.RemoteService.GetUseCurrentAccessToken() != false) { - var accessToken = await GetAccessTokenFromHttpContextOrNullAsync(); + var accessToken = await GetAccessTokenFromHttpContextOrNullAsync().ConfigureAwait(false); if (accessToken != null) { context.Request.SetBearerToken(accessToken); @@ -36,7 +36,7 @@ namespace Volo.Abp.Http.Client.IdentityModel await IdentityModelAuthenticationService.TryAuthenticateAsync( context.Client, context.RemoteService.GetIdentityClient() - ); + ).ConfigureAwait(false); } protected virtual async Task GetAccessTokenFromHttpContextOrNullAsync() @@ -47,7 +47,7 @@ namespace Volo.Abp.Http.Client.IdentityModel return null; } - return await httpContext.GetTokenAsync("access_token"); + return await httpContext.GetTokenAsync("access_token").ConfigureAwait(false); } } } diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionCache.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionCache.cs index 9d1ea2dbbe..b9932124be 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionCache.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionCache.cs @@ -27,12 +27,12 @@ namespace Volo.Abp.Http.Client.DynamicProxying string baseUrl, Func> factory) { - using (await _semaphore.LockAsync(CancellationTokenProvider.Token)) + using (await _semaphore.LockAsync(CancellationTokenProvider.Token).ConfigureAwait(false)) { var model = _cache.GetOrDefault(baseUrl); if (model == null) { - _cache[baseUrl] = model = await factory(); + _cache[baseUrl] = model = await factory().ConfigureAwait(false); } return model; diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs index 9b9c8e804c..eb57641c28 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs @@ -34,7 +34,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying public async Task FindActionAsync(string baseUrl, Type serviceType, MethodInfo method) { - var apiDescription = await GetApiDescriptionAsync(baseUrl); + var apiDescription = await GetApiDescriptionAsync(baseUrl).ConfigureAwait(false); //TODO: Cache finding? @@ -78,7 +78,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying public virtual async Task GetApiDescriptionAsync(string baseUrl) { - return await Cache.GetAsync(baseUrl, () => GetApiDescriptionFromServerAsync(baseUrl)); + return await Cache.GetAsync(baseUrl, () => GetApiDescriptionFromServerAsync(baseUrl)).ConfigureAwait(false); } protected virtual async Task GetApiDescriptionFromServerAsync(string baseUrl) @@ -88,14 +88,14 @@ namespace Volo.Abp.Http.Client.DynamicProxying var response = await client.GetAsync( baseUrl.EnsureEndsWith('/') + "api/abp/api-definition", CancellationTokenProvider.Token - ); + ).ConfigureAwait(false); if (!response.IsSuccessStatusCode) { throw new AbpException("Remote service returns error! StatusCode = " + response.StatusCode); } - var content = await response.Content.ReadAsStringAsync(); + var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var result = JsonConvert.DeserializeObject( content, diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs index 3e0124237f..d60b79b3a5 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs @@ -78,7 +78,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying { if (invocation.Method.ReturnType.GenericTypeArguments.IsNullOrEmpty()) { - await MakeRequestAsync(invocation); + await MakeRequestAsync(invocation).ConfigureAwait(false); } else { @@ -89,14 +89,14 @@ namespace Volo.Abp.Http.Client.DynamicProxying invocation.ReturnValue = await GetResultAsync( result, invocation.Method.ReturnType.GetGenericArguments()[0] - ); + ).ConfigureAwait(false); } } private async Task GetResultAsync(Task task, Type resultType) { - await task; + await task.ConfigureAwait(false); return typeof(Task<>) .MakeGenericType(resultType) .GetProperty(nameof(Task.Result), BindingFlags.Instance | BindingFlags.Public) @@ -105,7 +105,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying private async Task MakeRequestAndGetResultAsync(IAbpMethodInvocation invocation) { - var responseAsString = await MakeRequestAsync(invocation); + var responseAsString = await MakeRequestAsync(invocation).ConfigureAwait(false); //TODO: Think on that if (TypeHelper.IsPrimitiveExtended(typeof(T), true)) @@ -123,7 +123,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying var client = HttpClientFactory.Create(clientConfig.RemoteServiceName); - var action = await ApiDescriptionFinder.FindActionAsync(remoteServiceConfig.BaseUrl, typeof(TService), invocation.Method); + var action = await ApiDescriptionFinder.FindActionAsync(remoteServiceConfig.BaseUrl, typeof(TService), invocation.Method).ConfigureAwait(false); var apiVersion = GetApiVersionInfo(action); var url = remoteServiceConfig.BaseUrl.EnsureEndsWith('/') + UrlBuilder.GenerateUrlWithParameters(action, invocation.ArgumentsDictionary, apiVersion); @@ -141,16 +141,16 @@ namespace Volo.Abp.Http.Client.DynamicProxying remoteServiceConfig, clientConfig.RemoteServiceName ) - ); + ).ConfigureAwait(false); - var response = await client.SendAsync(requestMessage, GetCancellationToken()); + var response = await client.SendAsync(requestMessage, GetCancellationToken()).ConfigureAwait(false); if (!response.IsSuccessStatusCode) { - await ThrowExceptionForResponseAsync(response); + await ThrowExceptionForResponseAsync(response).ConfigureAwait(false); } - return await response.Content.ReadAsStringAsync(); + return await response.Content.ReadAsStringAsync().ConfigureAwait(false); } private ApiVersionInfo GetApiVersionInfo(ActionApiDescriptionModel action) @@ -240,7 +240,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying { var errorResponse = JsonSerializer.Deserialize( await response.Content.ReadAsStringAsync() - ); +.ConfigureAwait(false)); throw new AbpRemoteCallException(errorResponse.Error); } diff --git a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs index ca6e41d60d..488745836e 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs +++ b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs @@ -35,7 +35,7 @@ namespace Volo.Abp.IdentityModel [NotNull] HttpClient client, string identityClientName = null) { - var accessToken = await GetAccessTokenOrNullAsync(identityClientName); + var accessToken = await GetAccessTokenOrNullAsync(identityClientName).ConfigureAwait(false); if (accessToken == null) { return false; @@ -55,18 +55,18 @@ namespace Volo.Abp.IdentityModel return null; } - return await GetAccessTokenAsync(configuration); + return await GetAccessTokenAsync(configuration).ConfigureAwait(false); } public virtual async Task GetAccessTokenAsync(IdentityClientConfiguration configuration) { - var discoveryResponse = await GetDiscoveryResponse(configuration); + var discoveryResponse = await GetDiscoveryResponse(configuration).ConfigureAwait(false); if (discoveryResponse.IsError) { throw new AbpException($"Could not retrieve the OpenId Connect discovery document! ErrorType: {discoveryResponse.ErrorType}. Error: {discoveryResponse.Error}"); } - var tokenResponse = await GetTokenResponse(discoveryResponse, configuration); + var tokenResponse = await GetTokenResponse(discoveryResponse, configuration).ConfigureAwait(false); if (tokenResponse.IsError) { throw new AbpException($"Could not get token from the OpenId Connect server! ErrorType: {tokenResponse.ErrorType}. Error: {tokenResponse.Error}. ErrorDescription: {tokenResponse.ErrorDescription}. HttpStatusCode: {tokenResponse.HttpStatusCode}"); @@ -104,7 +104,7 @@ namespace Volo.Abp.IdentityModel { RequireHttps = configuration.RequireHttps } - }); + }).ConfigureAwait(false); } } @@ -118,14 +118,14 @@ namespace Volo.Abp.IdentityModel { case OidcConstants.GrantTypes.ClientCredentials: return await httpClient.RequestClientCredentialsTokenAsync( - await CreateClientCredentialsTokenRequestAsync(discoveryResponse, configuration), + await CreateClientCredentialsTokenRequestAsync(discoveryResponse, configuration).ConfigureAwait(false), CancellationTokenProvider.Token - ); + ).ConfigureAwait(false); case OidcConstants.GrantTypes.Password: return await httpClient.RequestPasswordTokenAsync( - await CreatePasswordTokenRequestAsync(discoveryResponse, configuration), + await CreatePasswordTokenRequestAsync(discoveryResponse, configuration).ConfigureAwait(false), CancellationTokenProvider.Token - ); + ).ConfigureAwait(false); default: throw new AbpException("Grant type was not implemented: " + configuration.GrantType); } diff --git a/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs b/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs index da99e7d4de..f798ebf01e 100644 --- a/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs +++ b/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs @@ -30,11 +30,11 @@ namespace Volo.Abp.MailKit protected override async Task SendEmailAsync(MailMessage mail) { - using (var client = await BuildClientAsync()) + using (var client = await BuildClientAsync().ConfigureAwait(false)) { var message = MimeMessage.CreateFromMailMessage(mail); - await client.SendAsync(message); - await client.DisconnectAsync(true); + await client.SendAsync(message).ConfigureAwait(false); + await client.DisconnectAsync(true).ConfigureAwait(false); } } @@ -44,7 +44,7 @@ namespace Volo.Abp.MailKit try { - await ConfigureClient(client); + await ConfigureClient(client).ConfigureAwait(false); return client; } catch @@ -57,20 +57,20 @@ namespace Volo.Abp.MailKit protected virtual async Task ConfigureClient(SmtpClient client) { client.Connect( - await SmtpConfiguration.GetHostAsync(), - await SmtpConfiguration.GetPortAsync(), + await SmtpConfiguration.GetHostAsync().ConfigureAwait(false), + await SmtpConfiguration.GetPortAsync().ConfigureAwait(false), await GetSecureSocketOption() - ); +.ConfigureAwait(false)); - if (await SmtpConfiguration.GetUseDefaultCredentialsAsync()) + if (await SmtpConfiguration.GetUseDefaultCredentialsAsync().ConfigureAwait(false)) { return; } client.Authenticate( - await SmtpConfiguration.GetUserNameAsync(), + await SmtpConfiguration.GetUserNameAsync().ConfigureAwait(false), await SmtpConfiguration.GetPasswordAsync() - ); +.ConfigureAwait(false)); } protected virtual async Task GetSecureSocketOption() @@ -81,7 +81,7 @@ namespace Volo.Abp.MailKit } return await SmtpConfiguration.GetEnableSslAsync() - ? SecureSocketOptions.SslOnConnect +.ConfigureAwait(false) ? SecureSocketOptions.SslOnConnect : SecureSocketOptions.StartTlsWhenAvailable; } } diff --git a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs index b81aa7ae87..d554e09de1 100644 --- a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs +++ b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs @@ -101,7 +101,7 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb public virtual async Task GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) { - var entity = await FindAsync(id, includeDetails, cancellationToken); + var entity = await FindAsync(id, includeDetails, cancellationToken).ConfigureAwait(false); if (entity == null) { @@ -118,13 +118,13 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) { - var entity = await FindAsync(id, cancellationToken: cancellationToken); + var entity = await FindAsync(id, cancellationToken: cancellationToken).ConfigureAwait(false); if (entity == null) { return; } - await DeleteAsync(entity, autoSave, cancellationToken); + await DeleteAsync(entity, autoSave, cancellationToken).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index 4e8ccaa82e..1ee3cbf80d 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -58,12 +58,12 @@ namespace Volo.Abp.Domain.Repositories.MongoDB bool autoSave = false, CancellationToken cancellationToken = default) { - await ApplyAbpConceptsForAddedEntityAsync(entity); + await ApplyAbpConceptsForAddedEntityAsync(entity).ConfigureAwait(false); await Collection.InsertOneAsync( entity, cancellationToken: GetCancellationToken(cancellationToken) - ); + ).ConfigureAwait(false); return entity; } @@ -78,14 +78,14 @@ namespace Volo.Abp.Domain.Repositories.MongoDB if (entity is ISoftDelete softDeleteEntity && softDeleteEntity.IsDeleted) { SetDeletionAuditProperties(entity); - await TriggerEntityDeleteEventsAsync(entity); + await TriggerEntityDeleteEventsAsync(entity).ConfigureAwait(false); } else { - await TriggerEntityUpdateEventsAsync(entity); + await TriggerEntityUpdateEventsAsync(entity).ConfigureAwait(false); } - await TriggerDomainEventsAsync(entity); + await TriggerDomainEventsAsync(entity).ConfigureAwait(false); var oldConcurrencyStamp = SetNewConcurrencyStamp(entity); @@ -93,7 +93,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB CreateEntityFilter(entity, true, oldConcurrencyStamp), entity, cancellationToken: GetCancellationToken(cancellationToken) - ); + ).ConfigureAwait(false); if (result.MatchedCount <= 0) { @@ -108,7 +108,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB bool autoSave = false, CancellationToken cancellationToken = default) { - await ApplyAbpConceptsForDeletedEntityAsync(entity); + await ApplyAbpConceptsForDeletedEntityAsync(entity).ConfigureAwait(false); var oldConcurrencyStamp = SetNewConcurrencyStamp(entity); if (entity is ISoftDelete softDeleteEntity) @@ -118,7 +118,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB CreateEntityFilter(entity, true, oldConcurrencyStamp), entity, cancellationToken: GetCancellationToken(cancellationToken) - ); + ).ConfigureAwait(false); if (result.MatchedCount <= 0) { @@ -130,7 +130,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB var result = await Collection.DeleteOneAsync( CreateEntityFilter(entity, true, oldConcurrencyStamp), GetCancellationToken(cancellationToken) - ); + ).ConfigureAwait(false); if (result.DeletedCount <= 0) { @@ -141,12 +141,12 @@ namespace Volo.Abp.Domain.Repositories.MongoDB public override async Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = default) { - return await GetMongoQueryable().ToListAsync(GetCancellationToken(cancellationToken)); + return await GetMongoQueryable().ToListAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public override async Task GetCountAsync(CancellationToken cancellationToken = default) { - return await GetMongoQueryable().LongCountAsync(GetCancellationToken(cancellationToken)); + return await GetMongoQueryable().LongCountAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public override async Task DeleteAsync( @@ -156,11 +156,11 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { var entities = await GetMongoQueryable() .Where(predicate) - .ToListAsync(GetCancellationToken(cancellationToken)); + .ToListAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); foreach (var entity in entities) { - await DeleteAsync(entity, autoSave, cancellationToken); + await DeleteAsync(entity, autoSave, cancellationToken).ConfigureAwait(false); } } @@ -187,33 +187,33 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { CheckAndSetId(entity); SetCreationAuditProperties(entity); - await TriggerEntityCreateEvents(entity); - await TriggerDomainEventsAsync(entity); + await TriggerEntityCreateEvents(entity).ConfigureAwait(false); + await TriggerDomainEventsAsync(entity).ConfigureAwait(false); } private async Task TriggerEntityCreateEvents(TEntity entity) { - await EntityChangeEventHelper.TriggerEntityCreatedEventOnUowCompletedAsync(entity); - await EntityChangeEventHelper.TriggerEntityCreatingEventAsync(entity); + await EntityChangeEventHelper.TriggerEntityCreatedEventOnUowCompletedAsync(entity).ConfigureAwait(false); + await EntityChangeEventHelper.TriggerEntityCreatingEventAsync(entity).ConfigureAwait(false); } protected virtual async Task TriggerEntityUpdateEventsAsync(TEntity entity) { - await EntityChangeEventHelper.TriggerEntityUpdatedEventOnUowCompletedAsync(entity); - await EntityChangeEventHelper.TriggerEntityUpdatingEventAsync(entity); + await EntityChangeEventHelper.TriggerEntityUpdatedEventOnUowCompletedAsync(entity).ConfigureAwait(false); + await EntityChangeEventHelper.TriggerEntityUpdatingEventAsync(entity).ConfigureAwait(false); } protected virtual async Task ApplyAbpConceptsForDeletedEntityAsync(TEntity entity) { SetDeletionAuditProperties(entity); - await TriggerEntityDeleteEventsAsync(entity); - await TriggerDomainEventsAsync(entity); + await TriggerEntityDeleteEventsAsync(entity).ConfigureAwait(false); + await TriggerDomainEventsAsync(entity).ConfigureAwait(false); } protected virtual async Task TriggerEntityDeleteEventsAsync(TEntity entity) { - await EntityChangeEventHelper.TriggerEntityDeletedEventOnUowCompletedAsync(entity); - await EntityChangeEventHelper.TriggerEntityDeletingEventAsync(entity); + await EntityChangeEventHelper.TriggerEntityDeletedEventOnUowCompletedAsync(entity).ConfigureAwait(false); + await EntityChangeEventHelper.TriggerEntityDeletingEventAsync(entity).ConfigureAwait(false); } protected virtual void CheckAndSetId(TEntity entity) @@ -266,7 +266,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { foreach (var localEvent in localEvents) { - await LocalEventBus.PublishAsync(localEvent.GetType(), localEvent); + await LocalEventBus.PublishAsync(localEvent.GetType(), localEvent).ConfigureAwait(false); } generatesDomainEventsEntity.ClearLocalEvents(); @@ -277,7 +277,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { foreach (var distributedEvent in distributedEvents) { - await DistributedEventBus.PublishAsync(distributedEvent.GetType(), distributedEvent); + await DistributedEventBus.PublishAsync(distributedEvent.GetType(), distributedEvent).ConfigureAwait(false); } generatesDomainEventsEntity.ClearDistributedEvents(); @@ -324,7 +324,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB bool includeDetails = true, CancellationToken cancellationToken = default) { - var entity = await FindAsync(id, includeDetails, cancellationToken); + var entity = await FindAsync(id, includeDetails, cancellationToken).ConfigureAwait(false); if (entity == null) { @@ -341,7 +341,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { return await Collection .Find(CreateEntityFilter(id, true)) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public virtual Task DeleteAsync( diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs index 1214a82a99..8e136fc2ac 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs @@ -63,13 +63,13 @@ namespace Volo.Abp.RabbitMQ public virtual async Task BindAsync(string routingKey) { QueueBindCommands.Enqueue(new QueueBindCommand(QueueBindType.Bind, routingKey)); - await TrySendQueueBindCommandsAsync(); + await TrySendQueueBindCommandsAsync().ConfigureAwait(false); } public virtual async Task UnbindAsync(string routingKey) { QueueBindCommands.Enqueue(new QueueBindCommand(QueueBindType.Unbind, routingKey)); - await TrySendQueueBindCommandsAsync(); + await TrySendQueueBindCommandsAsync().ConfigureAwait(false); } protected virtual void TrySendQueueBindCommands() @@ -166,7 +166,7 @@ namespace Volo.Abp.RabbitMQ var consumer = new EventingBasicConsumer(channel); consumer.Received += async (model, basicDeliverEventArgs) => { - await HandleIncomingMessage(channel, basicDeliverEventArgs); + await HandleIncomingMessage(channel, basicDeliverEventArgs).ConfigureAwait(false); }; channel.BasicConsume( @@ -189,7 +189,7 @@ namespace Volo.Abp.RabbitMQ { foreach (var callback in Callbacks) { - await callback(channel, basicDeliverEventArgs); + await callback(channel, basicDeliverEventArgs).ConfigureAwait(false); } channel.BasicAck(basicDeliverEventArgs.DeliveryTag, multiple: false); diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs index 6f5372a4cf..7694ca219f 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs @@ -34,7 +34,7 @@ namespace Volo.Abp.Settings //TODO: How to implement setting.IsInherited? - var value = await GetOrNullValueFromProvidersAsync(providers, setting); + var value = await GetOrNullValueFromProvidersAsync(providers, setting).ConfigureAwait(false); if (setting.IsEncrypted) { value = SettingEncryptionService.Decrypt(setting, value); @@ -52,7 +52,7 @@ namespace Volo.Abp.Settings { foreach (var setting in settingDefinitions) { - var value = await provider.GetOrNullAsync(setting); + var value = await provider.GetOrNullAsync(setting).ConfigureAwait(false); if (value != null) { if (setting.IsEncrypted) @@ -74,7 +74,7 @@ namespace Volo.Abp.Settings { foreach (var provider in providers) { - var value = await provider.GetOrNullAsync(setting); + var value = await provider.GetOrNullAsync(setting).ConfigureAwait(false); if (value != null) { return value; diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProviderExtensions.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProviderExtensions.cs index fb67c4ae77..eb7e3c341c 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProviderExtensions.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProviderExtensions.cs @@ -12,7 +12,7 @@ namespace Volo.Abp.Settings Check.NotNull(name, nameof(name)); return string.Equals( - await settingProvider.GetOrNullAsync(name), + await settingProvider.GetOrNullAsync(name).ConfigureAwait(false), "true", StringComparison.OrdinalIgnoreCase ); @@ -24,7 +24,7 @@ namespace Volo.Abp.Settings Check.NotNull(settingProvider, nameof(settingProvider)); Check.NotNull(name, nameof(name)); - var value = await settingProvider.GetOrNullAsync(name); + var value = await settingProvider.GetOrNullAsync(name).ConfigureAwait(false); return value?.To() ?? defaultValue; } } diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/TenantSettingValueProvider.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/TenantSettingValueProvider.cs index eab23b7258..408f70aac9 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/TenantSettingValueProvider.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/TenantSettingValueProvider.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.Settings public override async Task GetOrNullAsync(SettingDefinition setting) { - return await SettingStore.GetOrNullAsync(setting.Name, Name, CurrentTenant.Id?.ToString()); + return await SettingStore.GetOrNullAsync(setting.Name, Name, CurrentTenant.Id?.ToString()).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/UserSettingValueProvider.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/UserSettingValueProvider.cs index 01125f3201..a3df714c00 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/UserSettingValueProvider.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/UserSettingValueProvider.cs @@ -24,7 +24,7 @@ namespace Volo.Abp.Settings return null; } - return await SettingStore.GetOrNullAsync(setting.Name, Name, CurrentUser.Id.ToString()); + return await SettingStore.GetOrNullAsync(setting.Name, Name, CurrentUser.Id.ToString()).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs index 5c33866aa2..7ca2baa6b0 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs @@ -30,7 +30,7 @@ namespace Volo.Abp.UI.Navigation foreach (var contributor in Options.MenuContributors) { - await contributor.ConfigureMenuAsync(context); + await contributor.ConfigureMenuAsync(context).ConfigureAwait(false); } } diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs index ffa31e66a2..fed4235087 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs @@ -33,7 +33,7 @@ namespace Volo.Abp.UI.Navigation.Urls appName, urlName ) - ); +.ConfigureAwait(false)).ConfigureAwait(false); } protected virtual Task GetConfiguredUrl(string appName, string urlName) @@ -89,7 +89,7 @@ namespace Volo.Abp.UI.Navigation.Urls if (CurrentTenant.Id.HasValue) { - url = url.Replace(tenantNamePlaceHolder, await GetCurrentTenantNameAsync()); + url = url.Replace(tenantNamePlaceHolder, await GetCurrentTenantNameAsync().ConfigureAwait(false)); } else { @@ -103,7 +103,7 @@ namespace Volo.Abp.UI.Navigation.Urls { if (CurrentTenant.Id.HasValue && CurrentTenant.Name.IsNullOrEmpty()) { - var tenantConfiguration = await TenantStore.FindAsync(CurrentTenant.Id.Value); + var tenantConfiguration = await TenantStore.FindAsync(CurrentTenant.Id.Value).ConfigureAwait(false); return tenantConfiguration.Name; } diff --git a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs index e7e86774b5..18010136b2 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWork.cs @@ -80,7 +80,7 @@ namespace Volo.Abp.Uow { if (databaseApi is ISupportsSavingChanges) { - await (databaseApi as ISupportsSavingChanges).SaveChangesAsync(cancellationToken); + await (databaseApi as ISupportsSavingChanges).SaveChangesAsync(cancellationToken).ConfigureAwait(false); } } } @@ -107,10 +107,10 @@ namespace Volo.Abp.Uow try { _isCompleting = true; - await SaveChangesAsync(cancellationToken); - await CommitTransactionsAsync(); + await SaveChangesAsync(cancellationToken).ConfigureAwait(false); + await CommitTransactionsAsync().ConfigureAwait(false); IsCompleted = true; - await OnCompletedAsync(); + await OnCompletedAsync().ConfigureAwait(false); } catch (Exception ex) { @@ -128,7 +128,7 @@ namespace Volo.Abp.Uow _isRolledback = true; - await RollbackAllAsync(cancellationToken); + await RollbackAllAsync(cancellationToken).ConfigureAwait(false); } public IDatabaseApi FindDatabaseApi(string key) @@ -194,7 +194,7 @@ namespace Volo.Abp.Uow { foreach (var handler in CompletedHandlers) { - await handler.Invoke(); + await handler.Invoke().ConfigureAwait(false); } } @@ -278,7 +278,7 @@ namespace Volo.Abp.Uow { try { - await (databaseApi as ISupportsRollback).RollbackAsync(cancellationToken); + await (databaseApi as ISupportsRollback).RollbackAsync(cancellationToken).ConfigureAwait(false); } catch { } } @@ -290,7 +290,7 @@ namespace Volo.Abp.Uow { try { - await (transactionApi as ISupportsRollback).RollbackAsync(cancellationToken); + await (transactionApi as ISupportsRollback).RollbackAsync(cancellationToken).ConfigureAwait(false); } catch { } } @@ -309,7 +309,7 @@ namespace Volo.Abp.Uow { foreach (var transaction in GetAllActiveTransactionApis()) { - await transaction.CommitAsync(); + await transaction.CommitAsync().ConfigureAwait(false); } } diff --git a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkInterceptor.cs b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkInterceptor.cs index 81bd132a5e..d08c9b943e 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkInterceptor.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkInterceptor.cs @@ -22,14 +22,14 @@ namespace Volo.Abp.Uow { if (!UnitOfWorkHelper.IsUnitOfWorkMethod(invocation.Method, out var unitOfWorkAttribute)) { - await invocation.ProceedAsync(); + await invocation.ProceedAsync().ConfigureAwait(false); return; } using (var uow = _unitOfWorkManager.Begin(CreateOptions(invocation, unitOfWorkAttribute))) { - await invocation.ProceedAsync(); - await uow.CompleteAsync(); + await invocation.ProceedAsync().ConfigureAwait(false); + await uow.CompleteAsync().ConfigureAwait(false); } } diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationInterceptor.cs b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationInterceptor.cs index b4ce642471..24581c54d9 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationInterceptor.cs +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationInterceptor.cs @@ -16,7 +16,7 @@ namespace Volo.Abp.Validation public override async Task InterceptAsync(IAbpMethodInvocation invocation) { Validate(invocation); - await invocation.ProceedAsync(); + await invocation.ProceedAsync().ConfigureAwait(false); } protected virtual void Validate(IAbpMethodInvocation invocation) diff --git a/framework/src/Volo.Abp.VirtualFileSystem/Microsoft/Extensions/FileProviders/AbpFileInfoExtensions.cs b/framework/src/Volo.Abp.VirtualFileSystem/Microsoft/Extensions/FileProviders/AbpFileInfoExtensions.cs index 7d3505d616..9186e4d9e2 100644 --- a/framework/src/Volo.Abp.VirtualFileSystem/Microsoft/Extensions/FileProviders/AbpFileInfoExtensions.cs +++ b/framework/src/Volo.Abp.VirtualFileSystem/Microsoft/Extensions/FileProviders/AbpFileInfoExtensions.cs @@ -56,7 +56,7 @@ namespace Microsoft.Extensions.FileProviders using (var stream = fileInfo.CreateReadStream()) { - return await stream.GetAllBytesAsync(); + return await stream.GetAllBytesAsync().ConfigureAwait(false); } } diff --git a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/App/AppModule.cs b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/App/AppModule.cs index 44e2e38380..8ec04b23a6 100644 --- a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/App/AppModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/App/AppModule.cs @@ -41,7 +41,7 @@ namespace Volo.Abp.AspNetCore.App }; var result = jsonSerializer.Serialize(dictionary, camelCase: false); - await ctx.Response.WriteAsync(result); + await ctx.Response.WriteAsync(result).ConfigureAwait(false); }); } } diff --git a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs index e2ac111f5d..437240971d 100644 --- a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs @@ -46,14 +46,14 @@ namespace Volo.Abp.AspNetCore.MultiTenancy [Fact] public async Task Should_Use_Host_If_Tenant_Is_Not_Specified() { - var result = await GetResponseAsObjectAsync>("http://abp.io"); + var result = await GetResponseAsObjectAsync>("http://abp.io").ConfigureAwait(false); result["TenantId"].ShouldBe(""); } [Fact] public async Task Should_Use_Domain_If_Specified() { - var result = await GetResponseAsObjectAsync>("http://acme.abp.io"); + var result = await GetResponseAsObjectAsync>("http://acme.abp.io").ConfigureAwait(false); result["TenantId"].ShouldBe(_testTenantId.ToString()); } @@ -62,7 +62,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy { Client.DefaultRequestHeaders.Add(_options.TenantKey, Guid.NewGuid().ToString()); - var result = await GetResponseAsObjectAsync>("http://acme.abp.io"); + var result = await GetResponseAsObjectAsync>("http://acme.abp.io").ConfigureAwait(false); result["TenantId"].ShouldBe(_testTenantId.ToString()); } } diff --git a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_Without_DomainResolver_Tests.cs b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_Without_DomainResolver_Tests.cs index 37365089af..64f7ed2892 100644 --- a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_Without_DomainResolver_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_Without_DomainResolver_Tests.cs @@ -42,7 +42,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy [Fact] public async Task Should_Use_Host_If_Tenant_Is_Not_Specified() { - var result = await GetResponseAsObjectAsync>("http://abp.io"); + var result = await GetResponseAsObjectAsync>("http://abp.io").ConfigureAwait(false); result["TenantId"].ShouldBe(""); } @@ -50,7 +50,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy public async Task Should_Use_QueryString_Tenant_Id_If_Specified() { - var result = await GetResponseAsObjectAsync>($"http://abp.io?{_options.TenantKey}={_testTenantName}"); + var result = await GetResponseAsObjectAsync>($"http://abp.io?{_options.TenantKey}={_testTenantName}").ConfigureAwait(false); result["TenantId"].ShouldBe(_testTenantId.ToString()); } @@ -59,7 +59,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy { Client.DefaultRequestHeaders.Add(_options.TenantKey, _testTenantId.ToString()); - var result = await GetResponseAsObjectAsync>("http://abp.io"); + var result = await GetResponseAsObjectAsync>("http://abp.io").ConfigureAwait(false); result["TenantId"].ShouldBe(_testTenantId.ToString()); } @@ -68,7 +68,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy { Client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue(_options.TenantKey, _testTenantId.ToString()).ToString()); - var result = await GetResponseAsObjectAsync>("http://abp.io"); + var result = await GetResponseAsObjectAsync>("http://abp.io").ConfigureAwait(false); result["TenantId"].ShouldBe(_testTenantId.ToString()); } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApiExploring/AbpApiDefinitionController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApiExploring/AbpApiDefinitionController_Tests.cs index 44b206e462..f141cf89c1 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApiExploring/AbpApiDefinitionController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApiExploring/AbpApiDefinitionController_Tests.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApiExploring [Fact] public async Task GetAsync() { - var model = await GetResponseAsObjectAsync("/api/abp/api-definition"); + var model = await GetResponseAsObjectAsync("/api/abp/api-definition").ConfigureAwait(false); model.ShouldNotBeNull(); } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationBuilder_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationBuilder_Tests.cs index c5f53e4721..590aa1a142 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationBuilder_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationBuilder_Tests.cs @@ -11,7 +11,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations { var applicationConfigurationBuilder = GetRequiredService(); - var config = await applicationConfigurationBuilder.GetAsync(); + var config = await applicationConfigurationBuilder.GetAsync().ConfigureAwait(false); config.Auth.ShouldNotBeNull(); config.Localization.ShouldNotBeNull(); diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Authorization/AuthTestController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Authorization/AuthTestController_Tests.cs index 8caf59d0c0..2937fd6759 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Authorization/AuthTestController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Authorization/AuthTestController_Tests.cs @@ -29,7 +29,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authorization [Fact] public async Task Should_Call_Anonymous_Method_Without_Authentication() { - var result = await GetResponseAsStringAsync("/AuthTest/AnonymousTest"); + var result = await GetResponseAsStringAsync("/AuthTest/AnonymousTest").ConfigureAwait(false); result.ShouldBe("OK"); } @@ -41,7 +41,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authorization new Claim(AbpClaimTypes.UserId, AuthTestController.FakeUserId.ToString()) }); - var result = await GetResponseAsStringAsync("/AuthTest/SimpleAuthorizationTest"); + var result = await GetResponseAsStringAsync("/AuthTest/SimpleAuthorizationTest").ConfigureAwait(false); result.ShouldBe("OK"); } @@ -54,7 +54,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authorization new Claim("MyCustomClaimType", "42") }); - var result = await GetResponseAsStringAsync("/AuthTest/CustomPolicyTest"); + var result = await GetResponseAsStringAsync("/AuthTest/CustomPolicyTest").ConfigureAwait(false); result.ShouldBe("OK"); } @@ -70,7 +70,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authorization //TODO: We can get a real exception if we properly configure authentication schemas for this project await Assert.ThrowsAsync(async () => await GetResponseAsStringAsync("/AuthTest/CustomPolicyTest") - ); +.ConfigureAwait(false)).ConfigureAwait(false); } [Fact] @@ -81,7 +81,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authorization new Claim(AbpClaimTypes.UserId, AuthTestController.FakeUserId.ToString()) }); - var result = await GetResponseAsStringAsync("/AuthTest/PermissionTest"); + var result = await GetResponseAsStringAsync("/AuthTest/PermissionTest").ConfigureAwait(false); result.ShouldBe("OK"); } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Authorization/FakeAuthenticationMiddleware.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Authorization/FakeAuthenticationMiddleware.cs index b9caa1d7cb..1952ef22b9 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Authorization/FakeAuthenticationMiddleware.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Authorization/FakeAuthenticationMiddleware.cs @@ -26,7 +26,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authorization }); } - await next(context); + await next(context).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/ExceptionTestController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/ExceptionTestController_Tests.cs index 5243307116..1d11103c6f 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/ExceptionTestController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/ExceptionTestController_Tests.cs @@ -11,7 +11,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ExceptionHandling [Fact] public async Task Should_Return_RemoteServiceErrorResponse_For_UserFriendlyException_For_Void_Return_Value() { - var result = await GetResponseAsObjectAsync("/api/exception-test/UserFriendlyException1", HttpStatusCode.Forbidden); + var result = await GetResponseAsObjectAsync("/api/exception-test/UserFriendlyException1", HttpStatusCode.Forbidden).ConfigureAwait(false); result.Error.ShouldNotBeNull(); result.Error.Message.ShouldBe("This is a sample exception!"); } @@ -23,7 +23,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ExceptionHandling async () => await GetResponseAsObjectAsync( "/api/exception-test/UserFriendlyException2" ) - ); +.ConfigureAwait(false)).ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Features/FeatureTestController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Features/FeatureTestController_Tests.cs index 637dbe3d2b..8b8ad14da4 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Features/FeatureTestController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Features/FeatureTestController_Tests.cs @@ -11,7 +11,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Features { await GetResponseAsStringAsync( "/api/feature-test/allowed-feature" - ); + ).ConfigureAwait(false); } [Fact] @@ -20,7 +20,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Features await GetResponseAsStringAsync( "/api/feature-test/not-allowed-feature", HttpStatusCode.Unauthorized - ); + ).ConfigureAwait(false); } [Fact] @@ -28,7 +28,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Features { await GetResponseAsStringAsync( "/api/feature-test/no-feature" - ); + ).ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Json/JsonResultController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Json/JsonResultController_Tests.cs index 3e365cde3e..eeb47ea0a3 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Json/JsonResultController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Json/JsonResultController_Tests.cs @@ -25,7 +25,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Json { var time = await GetResponseAsStringAsync( "/api/json-result-test/json-result-action" - ); + ).ConfigureAwait(false); time.ShouldContain("2019*01*01"); } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/MvcLocalization_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/MvcLocalization_Tests.cs index 16057c3f07..e2dde3a61d 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/MvcLocalization_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/MvcLocalization_Tests.cs @@ -27,7 +27,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Localization [Fact] public async Task Should_Get_Same_Text_If_Not_Defined_In_Razor_View() { - var result = await GetResponseAsStringAsync("/LocalizationTest/HelloJohn"); + var result = await GetResponseAsStringAsync("/LocalizationTest/HelloJohn").ConfigureAwait(false); result.ShouldBe("Hello John."); } @@ -36,13 +36,13 @@ namespace Volo.Abp.AspNetCore.Mvc.Localization { using (AbpCultureHelper.Use("en")) { - var result = await GetResponseAsStringAsync("/LocalizationTest/PersonForm"); + var result = await GetResponseAsStringAsync("/LocalizationTest/PersonForm").ConfigureAwait(false); result.ShouldContain(""); } using (AbpCultureHelper.Use("tr")) { - var result = await GetResponseAsStringAsync("/LocalizationTest/PersonForm"); + var result = await GetResponseAsStringAsync("/LocalizationTest/PersonForm").ConfigureAwait(false); result.ShouldContain(""); } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ModelBinding/ModelBindingController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ModelBinding/ModelBindingController_Tests.cs index 632a02194f..45f8410eee 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ModelBinding/ModelBindingController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ModelBinding/ModelBindingController_Tests.cs @@ -21,10 +21,10 @@ namespace Volo.Abp.AspNetCore.Mvc.ModelBinding [Fact] public async Task DateTimeKind_Test() { - var response = await Client.GetAsync("/api/model-Binding-test/DateTimeKind?input=2010-01-01T00:00:00Z"); + var response = await Client.GetAsync("/api/model-Binding-test/DateTimeKind?input=2010-01-01T00:00:00Z").ConfigureAwait(false); response.StatusCode.ShouldBe(HttpStatusCode.OK); - var resultAsString = await response.Content.ReadAsStringAsync(); + var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); resultAsString.ShouldBe(DateTimeKind.ToString().ToLower()); } @@ -32,10 +32,10 @@ namespace Volo.Abp.AspNetCore.Mvc.ModelBinding public async Task NullableDateTimeKind_Test() { var response = - await Client.GetAsync("/api/model-Binding-test/NullableDateTimeKind?input=2010-01-01T00:00:00Z"); + await Client.GetAsync("/api/model-Binding-test/NullableDateTimeKind?input=2010-01-01T00:00:00Z").ConfigureAwait(false); response.StatusCode.ShouldBe(HttpStatusCode.OK); - var resultAsString = await response.Content.ReadAsStringAsync(); + var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); resultAsString.ShouldBe(DateTimeKind.ToString().ToLower()); } @@ -44,10 +44,10 @@ namespace Volo.Abp.AspNetCore.Mvc.ModelBinding { var response = await Client.GetAsync( - "/api/model-Binding-test/DisableDateTimeNormalizationDateTimeKind?input=2010-01-01T00:00:00Z"); + "/api/model-Binding-test/DisableDateTimeNormalizationDateTimeKind?input=2010-01-01T00:00:00Z").ConfigureAwait(false); response.StatusCode.ShouldBe(HttpStatusCode.OK); - var resultAsString = await response.Content.ReadAsStringAsync(); + var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); //Time parameter(2010-01-01T00:00:00Z) with time zone information, so the default Kind is Local. resultAsString.ShouldBe(DateTimeKind.Local.ToString().ToLower()); } @@ -57,10 +57,10 @@ namespace Volo.Abp.AspNetCore.Mvc.ModelBinding { var response = await Client.GetAsync( - "/api/model-Binding-test/DisableDateTimeNormalizationNullableDateTimeKind?input=2010-01-01T00:00:00Z"); + "/api/model-Binding-test/DisableDateTimeNormalizationNullableDateTimeKind?input=2010-01-01T00:00:00Z").ConfigureAwait(false); response.StatusCode.ShouldBe(HttpStatusCode.OK); - var resultAsString = await response.Content.ReadAsStringAsync(); + var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); //Time parameter(2010-01-01T00:00:00Z) with time zone information, so the default Kind is Local. resultAsString.ShouldBe(DateTimeKind.Local.ToString().ToLower()); } @@ -72,10 +72,10 @@ namespace Volo.Abp.AspNetCore.Mvc.ModelBinding "Time1=2010-01-01T00:00:00Z&" + "Time2=2010-01-01T00:00:00Z&" + "Time3=2010-01-01T00:00:00Z&" + - "InnerModel.Time4=2010-01-01T00:00:00Z"); + "InnerModel.Time4=2010-01-01T00:00:00Z").ConfigureAwait(false); response.StatusCode.ShouldBe(HttpStatusCode.OK); - var resultAsString = await response.Content.ReadAsStringAsync(); + var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); //Time parameter(2010-01-01T00:00:00Z) with time zone information, so the default Kind is Local. resultAsString.ShouldBe( $"local_{DateTimeKind.ToString().ToLower()}_{DateTimeKind.ToString().ToLower()}_local"); diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PeopleAppService_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PeopleAppService_Tests.cs index 96a79d8971..c3c90d02f7 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PeopleAppService_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PeopleAppService_Tests.cs @@ -35,7 +35,7 @@ namespace Volo.Abp.AspNetCore.Mvc [Fact] public async Task GetAll_Test() { - var result = await GetResponseAsObjectAsync>("/api/app/people"); + var result = await GetResponseAsObjectAsync>("/api/app/people").ConfigureAwait(false); result.Items.Count.ShouldBeGreaterThan(0); } @@ -44,7 +44,7 @@ namespace Volo.Abp.AspNetCore.Mvc { var firstPerson = (await _personRepository.GetListAsync()).First(); - var result = await GetResponseAsObjectAsync($"/api/app/people/{firstPerson.Id}"); + var result = await GetResponseAsObjectAsync($"/api/app/people/{firstPerson.Id}").ConfigureAwait(false); result.Name.ShouldBe(firstPerson.Name); } @@ -53,9 +53,9 @@ namespace Volo.Abp.AspNetCore.Mvc { var firstPerson = (await _personRepository.GetListAsync()).First(); - await Client.DeleteAsync($"/api/app/people/{firstPerson.Id}"); + await Client.DeleteAsync($"/api/app/people/{firstPerson.Id}").ConfigureAwait(false); - (await _personRepository.FindAsync(firstPerson.Id)).ShouldBeNull(); + (await _personRepository.FindAsync(firstPerson.Id).ConfigureAwait(false)).ShouldBeNull(); } [Fact] @@ -68,10 +68,10 @@ namespace Volo.Abp.AspNetCore.Mvc var response = await Client.PostAsync( "/api/app/people", new StringContent(postData, Encoding.UTF8, MimeTypes.Application.Json) - ); + ).ConfigureAwait(false); response.StatusCode.ShouldBe(HttpStatusCode.OK); - var resultAsString = await response.Content.ReadAsStringAsync(); + var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); PersonDto resultDto = _jsonSerializer.Deserialize(resultAsString); //Assert @@ -80,7 +80,7 @@ namespace Volo.Abp.AspNetCore.Mvc resultDto.Name.ShouldBe("John"); resultDto.Age.ShouldBe(33); - (await _personRepository.FindAsync(resultDto.Id)).ShouldNotBeNull(); + (await _personRepository.FindAsync(resultDto.Id).ConfigureAwait(false)).ShouldNotBeNull(); } @@ -100,10 +100,10 @@ namespace Volo.Abp.AspNetCore.Mvc var response = await Client.PutAsync( $"/api/app/people/{updateDto.Id}", new StringContent(putData, Encoding.UTF8, MimeTypes.Application.Json) - ); + ).ConfigureAwait(false); response.StatusCode.ShouldBe(HttpStatusCode.OK); - var resultAsString = await response.Content.ReadAsStringAsync(); + var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); PersonDto resultDto = _jsonSerializer.Deserialize(resultAsString); //Assert @@ -112,7 +112,7 @@ namespace Volo.Abp.AspNetCore.Mvc resultDto.Name.ShouldBe(firstPerson.Name); resultDto.Age.ShouldBe(firstPersonAge + 1); - var personInDb = (await _personRepository.FindAsync(resultDto.Id)); + var personInDb = (await _personRepository.FindAsync(resultDto.Id).ConfigureAwait(false)); personInDb.ShouldNotBeNull(); personInDb.Name.ShouldBe(firstPerson.Name); personInDb.Age.ShouldBe(firstPersonAge + 1); @@ -133,10 +133,10 @@ namespace Volo.Abp.AspNetCore.Mvc var response = await Client.PostAsync( $"/api/app/people/{personToAddNewPhone.Id}/phones", new StringContent(postData, Encoding.UTF8, MimeTypes.Application.Json) - ); + ).ConfigureAwait(false); response.StatusCode.ShouldBe(HttpStatusCode.OK); - var resultAsString = await response.Content.ReadAsStringAsync(); + var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var resultDto = _jsonSerializer.Deserialize(resultAsString); //Assert @@ -144,7 +144,7 @@ namespace Volo.Abp.AspNetCore.Mvc resultDto.Type.ShouldBe(PhoneType.Mobile); resultDto.Number.ShouldBe(phoneNumberToAdd); - var personInDb = await _personRepository.FindAsync(personToAddNewPhone.Id); + var personInDb = await _personRepository.FindAsync(personToAddNewPhone.Id).ConfigureAwait(false); personInDb.ShouldNotBeNull(); personInDb.Phones.Any(p => p.Number == phoneNumberToAdd).ShouldBeTrue(); } @@ -154,7 +154,7 @@ namespace Volo.Abp.AspNetCore.Mvc { var douglas = (await _personRepository.GetListAsync()).First(p => p.Name == "Douglas"); - var result = await GetResponseAsObjectAsync>($"/api/app/people/{douglas.Id}/phones"); + var result = await GetResponseAsObjectAsync>($"/api/app/people/{douglas.Id}/phones").ConfigureAwait(false); result.Items.Count.ShouldBe(douglas.Phones.Count); } @@ -164,7 +164,7 @@ namespace Volo.Abp.AspNetCore.Mvc var douglas = (await _personRepository.GetListAsync()).First(p => p.Name == "Douglas"); var firstPhone = douglas.Phones.First(); - await Client.DeleteAsync($"/api/app/people/{douglas.Id}/phones?number={firstPhone.Number}"); + await Client.DeleteAsync($"/api/app/people/{douglas.Id}/phones?number={firstPhone.Number}").ConfigureAwait(false); douglas = (await _personRepository.GetListAsync()).First(p => p.Name == "Douglas"); douglas.Phones.Any(p => p.Number == firstPhone.Number).ShouldBeFalse(); diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxiesController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxiesController_Tests.cs index c7dce93b3a..2af719ae4d 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxiesController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxiesController_Tests.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting [Fact] public async Task GetAll() { - var script = await GetResponseAsStringAsync("/Abp/ServiceProxyScript?minify=true"); + var script = await GetResponseAsStringAsync("/Abp/ServiceProxyScript?minify=true").ConfigureAwait(false); script.Length.ShouldBeGreaterThan(0); } @@ -18,10 +18,10 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting public async Task GetAllWithMinify() { GetRequiredService>().Value.MinifyGeneratedScript = false; - var script = await GetResponseAsStringAsync("/Abp/ServiceProxyScript"); + var script = await GetResponseAsStringAsync("/Abp/ServiceProxyScript").ConfigureAwait(false); GetRequiredService>().Value.MinifyGeneratedScript = true; - var minifyScript = await GetResponseAsStringAsync("/Abp/ServiceProxyScript?minify=true"); + var minifyScript = await GetResponseAsStringAsync("/Abp/ServiceProxyScript?minify=true").ConfigureAwait(false); script.Length.ShouldBeGreaterThan(0); minifyScript.Length.ShouldBeGreaterThan(0); diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/SimpleController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/SimpleController_Tests.cs index cda64b2323..aa111be2f8 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/SimpleController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/SimpleController_Tests.cs @@ -13,7 +13,7 @@ namespace Volo.Abp.AspNetCore.Mvc { var result = await GetResponseAsStringAsync( GetUrl(nameof(SimpleController.Index)) - ); + ).ConfigureAwait(false); result.ShouldBe("Index-Result"); } @@ -23,7 +23,7 @@ namespace Volo.Abp.AspNetCore.Mvc { var result = await GetResponseAsStringAsync( GetUrl(nameof(SimpleController.About)) - ); + ).ConfigureAwait(false); result.Trim().ShouldBe("

    About

    "); } @@ -35,8 +35,8 @@ namespace Volo.Abp.AspNetCore.Mvc { await GetResponseAsStringAsync( GetUrl(nameof(SimpleController.ExceptionOnRazor)) - ); - }); + ).ConfigureAwait(false); + }).ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkMiddleware_Exception_Rollback_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkMiddleware_Exception_Rollback_Tests.cs index 6400ecb88e..81d1c88bee 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkMiddleware_Exception_Rollback_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkMiddleware_Exception_Rollback_Tests.cs @@ -14,7 +14,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Uow [Fact] public async Task Should_Rollback_Transaction_For_Handled_Exceptions() { - var result = await GetResponseAsObjectAsync("/api/unitofwork-test/HandledException", HttpStatusCode.Forbidden); + var result = await GetResponseAsObjectAsync("/api/unitofwork-test/HandledException", HttpStatusCode.Forbidden).ConfigureAwait(false); result.Error.ShouldNotBeNull(); result.Error.Message.ShouldBe("This is a sample exception!"); } @@ -22,11 +22,11 @@ namespace Volo.Abp.AspNetCore.Mvc.Uow [Fact] public async Task Should_Gracefully_Handle_Exceptions_On_Complete() { - var response = await GetResponseAsync("/api/unitofwork-test/ExceptionOnComplete", HttpStatusCode.Forbidden); + var response = await GetResponseAsync("/api/unitofwork-test/ExceptionOnComplete", HttpStatusCode.Forbidden).ConfigureAwait(false); response.Headers.GetValues(AbpHttpConsts.AbpErrorFormat).FirstOrDefault().ShouldBe("true"); - var resultAsString = await response.Content.ReadAsStringAsync(); + var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var result = ServiceProvider.GetRequiredService().Deserialize(resultAsString); diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkMiddleware_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkMiddleware_Tests.cs index abd666e3f5..192d1f0e06 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkMiddleware_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Uow/UnitOfWorkMiddleware_Tests.cs @@ -9,13 +9,13 @@ namespace Volo.Abp.AspNetCore.Mvc.Uow [Fact] public async Task Get_Actions_Should_Not_Be_Transactional() { - await GetResponseAsStringAsync("/api/unitofwork-test/ActionRequiresUow"); + await GetResponseAsStringAsync("/api/unitofwork-test/ActionRequiresUow").ConfigureAwait(false); } [Fact] public async Task Non_Get_Actions_Should_Be_Transactional() { - var result = await Client.PostAsync("/api/unitofwork-test/ActionRequiresUowPost", null); + var result = await Client.PostAsync("/api/unitofwork-test/ActionRequiresUowPost", null).ConfigureAwait(false); result.IsSuccessStatusCode.ShouldBeTrue(); } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Validation/ValidationTestController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Validation/ValidationTestController_Tests.cs index 5177868843..f4c38d1e4f 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Validation/ValidationTestController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Validation/ValidationTestController_Tests.cs @@ -12,14 +12,14 @@ namespace Volo.Abp.AspNetCore.Mvc.Validation [Fact] public async Task Should_Validate_Object_Result_Success() { - var result = await GetResponseAsStringAsync("/api/validation-test/object-result-action?value1=hello"); + var result = await GetResponseAsStringAsync("/api/validation-test/object-result-action?value1=hello").ConfigureAwait(false); result.ShouldBe("hello"); } [Fact] public async Task Should_Validate_Object_Result_Failing() { - var result = await GetResponseAsObjectAsync("/api/validation-test/object-result-action?value1=a", HttpStatusCode.BadRequest); //value1 has min length of 2 chars. + var result = await GetResponseAsObjectAsync("/api/validation-test/object-result-action?value1=a", HttpStatusCode.BadRequest).ConfigureAwait(false); //value1 has min length of 2 chars. result.Error.ValidationErrors.Length.ShouldBeGreaterThan(0); } @@ -28,7 +28,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Validation { using (AbpCultureHelper.Use("tr")) { - var result = await GetResponseAsObjectAsync("/api/validation-test/object-result-action?value1=a", HttpStatusCode.BadRequest); //value1 has min length of 2 chars. + var result = await GetResponseAsObjectAsync("/api/validation-test/object-result-action?value1=a", HttpStatusCode.BadRequest).ConfigureAwait(false); //value1 has min length of 2 chars. result.Error.ValidationErrors.Length.ShouldBeGreaterThan(0); result.Error.ValidationErrors[0].Message.ShouldBe("DeÄŸer Bir alanı en az '2' uzunluÄŸunda bir metin ya da dizi olmalıdır."); } @@ -37,14 +37,14 @@ namespace Volo.Abp.AspNetCore.Mvc.Validation [Fact] public async Task Should_Not_Validate_Action_Result_Success() { - var result = await GetResponseAsStringAsync("/api/validation-test/action-result-action?value1=hello"); + var result = await GetResponseAsStringAsync("/api/validation-test/action-result-action?value1=hello").ConfigureAwait(false); result.ShouldBe("ModelState.IsValid: true"); } [Fact] public async Task Should_Not_Validate_Action_Result_Failing() { - var result = await GetResponseAsStringAsync("/api/validation-test/action-result-action"); //Missed the value1 + var result = await GetResponseAsStringAsync("/api/validation-test/action-result-action").ConfigureAwait(false); //Missed the value1 result.ShouldBe("ModelState.IsValid: false"); } @@ -52,7 +52,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Validation public async Task Should_Return_Custom_Validate_Errors() { var result = await GetResponseAsObjectAsync( - "/api/validation-test/object-result-action-with-custom_validate?value1=abc", HttpStatusCode.BadRequest); //value1 should be hello. + "/api/validation-test/object-result-action-with-custom_validate?value1=abc", HttpStatusCode.BadRequest).ConfigureAwait(false); //value1 should be hello. result.Error.ValidationErrors.Length.ShouldBeGreaterThan(0); result.Error.ValidationErrors.ShouldContain(x => x.Message == "Value1 should be hello"); diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/Components/Card_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/Components/Card_Tests.cs index 9fcac03459..89d9028fc4 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/Components/Card_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/Components/Card_Tests.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Components [Fact(Skip = "This test project is not completed yet")] public async Task Index() { - var result = await GetResponseAsStringAsync("/Components/Cards"); + var result = await GetResponseAsStringAsync("/Components/Cards").ConfigureAwait(false); result.ShouldNotBeNullOrEmpty(); } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/HelloController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/HelloController_Tests.cs index 0dc4057bde..a5db492a39 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/HelloController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/HelloController_Tests.cs @@ -18,19 +18,19 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning.Test [Fact] public async Task GetAsync() { - (await _helloController.GetAsync()).ShouldBe("Get-2.0"); + (await _helloController.GetAsync().ConfigureAwait(false)).ShouldBe("Get-2.0"); } [Fact] public async Task PostAsyncV1() { - (await _helloController.PostAsyncV1()).ShouldBe("Post-1.0"); + (await _helloController.PostAsyncV1().ConfigureAwait(false)).ShouldBe("Post-1.0"); } [Fact] public async Task PostAsyncV2() { - (await _helloController.PostAsyncV2()).ShouldBe("Post-2.0"); + (await _helloController.PostAsyncV2().ConfigureAwait(false)).ShouldBe("Post-2.0"); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v1/TodoAppService_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v1/TodoAppService_Tests.cs index f5b86cf7d7..4db9f235be 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v1/TodoAppService_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v1/TodoAppService_Tests.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning.Test.v1 [Fact] public async Task GetAsync() { - (await _todoAppService.GetAsync(42)).ShouldBe("Compat-42-1.0"); + (await _todoAppService.GetAsync(42).ConfigureAwait(false)).ShouldBe("Compat-42-1.0"); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v2/TodoAppService_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v2/TodoAppService_Tests.cs index d6b681aa2e..2bfecc2664 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v2/TodoAppService_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Test/v2/TodoAppService_Tests.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning.Test.v2 [Fact] public async Task GetAsync() { - (await _todoAppService.GetAsync(42)).ShouldBe("42-2.0"); + (await _todoAppService.GetAsync(42).ConfigureAwait(false)).ShouldBe("42-2.0"); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Tests/Volo/Abp/AspNetCore/AbpAspNetCoreTestBase.cs b/framework/test/Volo.Abp.AspNetCore.Tests/Volo/Abp/AspNetCore/AbpAspNetCoreTestBase.cs index dd5edff807..2c647d0556 100644 --- a/framework/test/Volo.Abp.AspNetCore.Tests/Volo/Abp/AspNetCore/AbpAspNetCoreTestBase.cs +++ b/framework/test/Volo.Abp.AspNetCore.Tests/Volo/Abp/AspNetCore/AbpAspNetCoreTestBase.cs @@ -26,15 +26,15 @@ namespace Volo.Abp.AspNetCore protected virtual async Task GetResponseAsObjectAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) { - var strResponse = await GetResponseAsStringAsync(url, expectedStatusCode); + var strResponse = await GetResponseAsStringAsync(url, expectedStatusCode).ConfigureAwait(false); return JsonConvert.DeserializeObject(strResponse, SharedJsonSerializerSettings); } protected virtual async Task GetResponseAsStringAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) { - using (var response = await GetResponseAsync(url, expectedStatusCode)) + using (var response = await GetResponseAsync(url, expectedStatusCode).ConfigureAwait(false)) { - return await response.Content.ReadAsStringAsync(); + return await response.Content.ReadAsStringAsync().ConfigureAwait(false); } } @@ -43,7 +43,7 @@ namespace Volo.Abp.AspNetCore using (var requestMessage = new HttpRequestMessage(HttpMethod.Get, url)) { requestMessage.Headers.Add("Accept-Language", CultureInfo.CurrentUICulture.Name); - var response = await Client.SendAsync(requestMessage); + var response = await Client.SendAsync(requestMessage).ConfigureAwait(false); response.StatusCode.ShouldBe(expectedStatusCode); return response; } diff --git a/framework/test/Volo.Abp.AspNetCore.Tests/Volo/Abp/AspNetCore/VirtualFileSystem/VirtualFileSystem_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Tests/Volo/Abp/AspNetCore/VirtualFileSystem/VirtualFileSystem_Tests.cs index 142d44baec..88399bd9a7 100644 --- a/framework/test/Volo.Abp.AspNetCore.Tests/Volo/Abp/AspNetCore/VirtualFileSystem/VirtualFileSystem_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Tests/Volo/Abp/AspNetCore/VirtualFileSystem/VirtualFileSystem_Tests.cs @@ -11,7 +11,7 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem { var result = await GetResponseAsStringAsync( "/SampleFiles/test1.js" - ); + ).ConfigureAwait(false); result.ShouldBe("test1.js-content"); } diff --git a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AuditingInterceptor_Tests.cs b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AuditingInterceptor_Tests.cs index 23eba6c53b..e16e48c7bc 100644 --- a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AuditingInterceptor_Tests.cs +++ b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AuditingInterceptor_Tests.cs @@ -37,8 +37,8 @@ namespace Volo.Abp.Auditing using (var scope = _auditingManager.BeginScope()) { - await myAuditedObject1.DoItAsync(new InputObject { Value1 = "forty-two", Value2 = 42 }); - await scope.SaveAsync(); + await myAuditedObject1.DoItAsync(new InputObject { Value1 = "forty-two", Value2 = 42 }).ConfigureAwait(false); + await scope.SaveAsync().ConfigureAwait(false); } #pragma warning disable 4014 diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs index 104d75c11b..2950c7c92a 100644 --- a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs @@ -22,8 +22,8 @@ namespace Volo.Abp.Authorization { await Assert.ThrowsAsync(async () => { - await _myAuthorizedService1.ProtectedByClass(); - }); + await _myAuthorizedService1.ProtectedByClass().ConfigureAwait(false); + }).ConfigureAwait(false); } [Fact] @@ -31,20 +31,20 @@ namespace Volo.Abp.Authorization { await Assert.ThrowsAsync(async () => { - await _myAuthorizedService1.ProtectedByClassAsync(); - }); + await _myAuthorizedService1.ProtectedByClassAsync().ConfigureAwait(false); + }).ConfigureAwait(false); } [Fact] public async Task Should_Allow_To_Call_Anonymous_Method() { - (await _myAuthorizedService1.Anonymous()).ShouldBe(42); + (await _myAuthorizedService1.Anonymous().ConfigureAwait(false)).ShouldBe(42); } [Fact] public async Task Should_Allow_To_Call_Anonymous_Method_Async() { - (await _myAuthorizedService1.AnonymousAsync()).ShouldBe(42); + (await _myAuthorizedService1.AnonymousAsync().ConfigureAwait(false)).ShouldBe(42); } [Fact] diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/MyAuthorizedService1.cs b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/MyAuthorizedService1.cs index b1b2a4c43f..6d64ed80dd 100644 --- a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/MyAuthorizedService1.cs +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/TestServices/MyAuthorizedService1.cs @@ -16,7 +16,7 @@ namespace Volo.Abp.Authorization.TestServices [AllowAnonymous] public virtual async Task AnonymousAsync() { - await Task.Delay(10); + await Task.Delay(10).ConfigureAwait(false); return 42; } @@ -27,7 +27,7 @@ namespace Volo.Abp.Authorization.TestServices public virtual async Task ProtectedByClassAsync() { - await Task.Delay(10); + await Task.Delay(10).ConfigureAwait(false); return 42; } } diff --git a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobManager_Tests.cs b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobManager_Tests.cs index 3a84e38df1..2cd76620ff 100644 --- a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobManager_Tests.cs +++ b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobManager_Tests.cs @@ -19,17 +19,17 @@ namespace Volo.Abp.BackgroundJobs [Fact] public async Task Should_Store_Jobs() { - var jobIdAsString = await _backgroundJobManager.EnqueueAsync(new MyJobArgs("42")); + var jobIdAsString = await _backgroundJobManager.EnqueueAsync(new MyJobArgs("42")).ConfigureAwait(false); jobIdAsString.ShouldNotBe(default); - (await _backgroundJobStore.FindAsync(Guid.Parse(jobIdAsString))).ShouldNotBeNull(); + (await _backgroundJobStore.FindAsync(Guid.Parse(jobIdAsString)).ConfigureAwait(false)).ShouldNotBeNull(); } [Fact] public async Task Should_Store_Async_Jobs() { - var jobIdAsString = await _backgroundJobManager.EnqueueAsync(new MyAsyncJobArgs("42")); + var jobIdAsString = await _backgroundJobManager.EnqueueAsync(new MyAsyncJobArgs("42")).ConfigureAwait(false); jobIdAsString.ShouldNotBe(default); - (await _backgroundJobStore.FindAsync(Guid.Parse(jobIdAsString))).ShouldNotBeNull(); + (await _backgroundJobStore.FindAsync(Guid.Parse(jobIdAsString)).ConfigureAwait(false)).ShouldNotBeNull(); } } } diff --git a/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_ConfigureOptions_Test.cs b/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_ConfigureOptions_Test.cs index adb0b01bfc..2c2e48c92e 100644 --- a/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_ConfigureOptions_Test.cs +++ b/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_ConfigureOptions_Test.cs @@ -25,7 +25,7 @@ namespace Volo.Abp.Caching var cacheKey = Guid.NewGuid().ToString(); //Get (not exists yet) - var cacheItem = await personCache.GetAsync(cacheKey); + var cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); GetDefaultCachingOptions(personCache).SlidingExpiration.ShouldBe(TimeSpan.FromMinutes(20)); diff --git a/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_Tests.cs b/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_Tests.cs index 927448463a..bddab82a91 100644 --- a/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_Tests.cs +++ b/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_Tests.cs @@ -16,23 +16,23 @@ namespace Volo.Abp.Caching const string personName = "john nash"; //Get (not exists yet) - var cacheItem = await personCache.GetAsync(cacheKey); + var cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); //Set cacheItem = new PersonCacheItem(personName); - await personCache.SetAsync(cacheKey, cacheItem); + await personCache.SetAsync(cacheKey, cacheItem).ConfigureAwait(false); //Get (it should be available now - cacheItem = await personCache.GetAsync(cacheKey); + cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldNotBeNull(); cacheItem.Name.ShouldBe(personName); //Remove - await personCache.RemoveAsync(cacheKey); + await personCache.RemoveAsync(cacheKey).ConfigureAwait(false); //Get (not exists since removed) - cacheItem = await personCache.GetAsync(cacheKey); + cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); } @@ -53,7 +53,7 @@ namespace Volo.Abp.Caching { factoryExecuted = true; return new PersonCacheItem(personName); - }); + }).ConfigureAwait(false); factoryExecuted.ShouldBeTrue(); cacheItem.Name.ShouldBe(personName); @@ -67,7 +67,7 @@ namespace Volo.Abp.Caching { factoryExecuted = true; return new PersonCacheItem(personName); - }); + }).ConfigureAwait(false); factoryExecuted.ShouldBeFalse(); cacheItem.Name.ShouldBe(personName); @@ -84,41 +84,41 @@ namespace Volo.Abp.Caching const string personName = "john nash"; //Get (not exists yet) - var cacheItem = await personCache.GetAsync(cacheKey); + var cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); - var cacheItem1 = await otherPersonCache.GetAsync(cacheKey); + var cacheItem1 = await otherPersonCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem1.ShouldBeNull(); //Set cacheItem = new PersonCacheItem(personName); - await personCache.SetAsync(cacheKey, cacheItem); + await personCache.SetAsync(cacheKey, cacheItem).ConfigureAwait(false); //Get (it should be available now, but otherPersonCache not exists now. - cacheItem = await personCache.GetAsync(cacheKey); + cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldNotBeNull(); cacheItem.Name.ShouldBe(personName); - cacheItem1 = await otherPersonCache.GetAsync(cacheKey); + cacheItem1 = await otherPersonCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem1.ShouldBeNull(); //set other person cache cacheItem1 = new Sail.Testing.Caching.PersonCacheItem(personName); - await otherPersonCache.SetAsync(cacheKey, cacheItem1); + await otherPersonCache.SetAsync(cacheKey, cacheItem1).ConfigureAwait(false); - cacheItem1 = await otherPersonCache.GetAsync(cacheKey); + cacheItem1 = await otherPersonCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem1.ShouldNotBeNull(); cacheItem1.Name.ShouldBe(personName); //Remove - await personCache.RemoveAsync(cacheKey); + await personCache.RemoveAsync(cacheKey).ConfigureAwait(false); //Get (not exists since removed) - cacheItem = await personCache.GetAsync(cacheKey); + cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); - cacheItem1 = await otherPersonCache.GetAsync(cacheKey); + cacheItem1 = await otherPersonCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem1.ShouldNotBeNull(); } @@ -132,23 +132,23 @@ namespace Volo.Abp.Caching const string personName = "john nash"; //Get (not exists yet) - var cacheItem = await personCache.GetAsync(cacheKey); + var cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); //Set cacheItem = new PersonCacheItem(personName); - await personCache.SetAsync(cacheKey, cacheItem); + await personCache.SetAsync(cacheKey, cacheItem).ConfigureAwait(false); //Get (it should be available now - cacheItem = await personCache.GetAsync(cacheKey); + cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldNotBeNull(); cacheItem.Name.ShouldBe(personName); //Remove - await personCache.RemoveAsync(cacheKey); + await personCache.RemoveAsync(cacheKey).ConfigureAwait(false); //Get (not exists since removed) - cacheItem = await personCache.GetAsync(cacheKey); + cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); } @@ -169,7 +169,7 @@ namespace Volo.Abp.Caching { factoryExecuted = true; return new PersonCacheItem(personName); - }); + }).ConfigureAwait(false); factoryExecuted.ShouldBeTrue(); cacheItem.Name.ShouldBe(personName); @@ -183,7 +183,7 @@ namespace Volo.Abp.Caching { factoryExecuted = true; return new PersonCacheItem(personName); - }); + }).ConfigureAwait(false); factoryExecuted.ShouldBeFalse(); cacheItem.Name.ShouldBe(personName); @@ -200,41 +200,41 @@ namespace Volo.Abp.Caching const string personName = "john nash"; //Get (not exists yet) - var cacheItem = await personCache.GetAsync(cacheKey); + var cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); - var cacheItem1 = await otherPersonCache.GetAsync(cacheKey); + var cacheItem1 = await otherPersonCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem1.ShouldBeNull(); //Set cacheItem = new PersonCacheItem(personName); - await personCache.SetAsync(cacheKey, cacheItem); + await personCache.SetAsync(cacheKey, cacheItem).ConfigureAwait(false); //Get (it should be available now, but otherPersonCache not exists now. - cacheItem = await personCache.GetAsync(cacheKey); + cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldNotBeNull(); cacheItem.Name.ShouldBe(personName); - cacheItem1 = await otherPersonCache.GetAsync(cacheKey); + cacheItem1 = await otherPersonCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem1.ShouldBeNull(); //set other person cache cacheItem1 = new Sail.Testing.Caching.PersonCacheItem(personName); - await otherPersonCache.SetAsync(cacheKey, cacheItem1); + await otherPersonCache.SetAsync(cacheKey, cacheItem1).ConfigureAwait(false); - cacheItem1 = await otherPersonCache.GetAsync(cacheKey); + cacheItem1 = await otherPersonCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem1.ShouldNotBeNull(); cacheItem1.Name.ShouldBe(personName); //Remove - await personCache.RemoveAsync(cacheKey); + await personCache.RemoveAsync(cacheKey).ConfigureAwait(false); //Get (not exists since removed) - cacheItem = await personCache.GetAsync(cacheKey); + cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); - cacheItem1 = await otherPersonCache.GetAsync(cacheKey); + cacheItem1 = await otherPersonCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem1.ShouldNotBeNull(); } @@ -248,23 +248,23 @@ namespace Volo.Abp.Caching const string personName = "john nash"; //Get (not exists yet) - var cacheItem = await personCache.GetAsync(cacheKey); + var cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); //Set cacheItem = new PersonCacheItem(personName); - await personCache.SetAsync(cacheKey, cacheItem); + await personCache.SetAsync(cacheKey, cacheItem).ConfigureAwait(false); //Get (it should be available now - cacheItem = await personCache.GetAsync(cacheKey); + cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldNotBeNull(); cacheItem.Name.ShouldBe(personName); //Remove - await personCache.RemoveAsync(cacheKey); + await personCache.RemoveAsync(cacheKey).ConfigureAwait(false); //Get (not exists since removed) - cacheItem = await personCache.GetAsync(cacheKey); + cacheItem = await personCache.GetAsync(cacheKey).ConfigureAwait(false); cacheItem.ShouldBeNull(); } @@ -278,34 +278,34 @@ namespace Volo.Abp.Caching const string personName = "john nash"; //Get (not exists yet) - var cacheItem1 = await personCache.GetAsync(cache1Key); - var cacheItem2 = await personCache.GetAsync(cache2Key); + var cacheItem1 = await personCache.GetAsync(cache1Key).ConfigureAwait(false); + var cacheItem2 = await personCache.GetAsync(cache2Key).ConfigureAwait(false); cacheItem1.ShouldBeNull(); cacheItem2.ShouldBeNull(); //Set cacheItem1 = new PersonCacheItem(personName); cacheItem2 = new PersonCacheItem(personName); - await personCache.SetAsync(cache1Key, cacheItem1); - await personCache.SetAsync(cache2Key, cacheItem2); + await personCache.SetAsync(cache1Key, cacheItem1).ConfigureAwait(false); + await personCache.SetAsync(cache2Key, cacheItem2).ConfigureAwait(false); //Get (it should be available now - cacheItem1 = await personCache.GetAsync(cache1Key); + cacheItem1 = await personCache.GetAsync(cache1Key).ConfigureAwait(false); cacheItem1.ShouldNotBeNull(); cacheItem1.Name.ShouldBe(personName); - cacheItem2 = await personCache.GetAsync(cache2Key); + cacheItem2 = await personCache.GetAsync(cache2Key).ConfigureAwait(false); cacheItem2.ShouldNotBeNull(); cacheItem2.Name.ShouldBe(personName); //Remove - await personCache.RemoveAsync(cache1Key); - await personCache.RemoveAsync(cache2Key); + await personCache.RemoveAsync(cache1Key).ConfigureAwait(false); + await personCache.RemoveAsync(cache2Key).ConfigureAwait(false); //Get (not exists since removed) - cacheItem1 = await personCache.GetAsync(cache1Key); + cacheItem1 = await personCache.GetAsync(cache1Key).ConfigureAwait(false); cacheItem1.ShouldBeNull(); - cacheItem2 = await personCache.GetAsync(cache2Key); + cacheItem2 = await personCache.GetAsync(cache2Key).ConfigureAwait(false); cacheItem2.ShouldBeNull(); } diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/AbpInterceptionTestBase.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/AbpInterceptionTestBase.cs index c6e9f03927..23a8010115 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/AbpInterceptionTestBase.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/AbpInterceptionTestBase.cs @@ -38,11 +38,11 @@ namespace Volo.Abp.DynamicProxy { //Arrange - var target = ServiceProvider.GetService(); - - //Act - - await target.DoItAsync(); + var target = ServiceProvider.GetService(); + + //Act + + await target.DoItAsync().ConfigureAwait(false); //Assert @@ -65,7 +65,7 @@ namespace Volo.Abp.DynamicProxy //Act - var result = await target.GetValueAsync(); + var result = await target.GetValueAsync().ConfigureAwait(false); //Assert @@ -89,9 +89,9 @@ namespace Volo.Abp.DynamicProxy //Act & Assert - (await target.GetValueAsync(42)).ShouldBe(42); //First run, not cached yet - (await target.GetValueAsync(43)).ShouldBe(42); //First run, cached previous value - (await target.GetValueAsync(44)).ShouldBe(42); //First run, cached previous value + (await target.GetValueAsync(42).ConfigureAwait(false)).ShouldBe(42); //First run, not cached yet + (await target.GetValueAsync(43).ConfigureAwait(false)).ShouldBe(42); //First run, cached previous value + (await target.GetValueAsync(44).ConfigureAwait(false)).ShouldBe(42); //First run, cached previous value } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/CachedTestObject.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/CachedTestObject.cs index db06b78b6a..8c7a797c7b 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/CachedTestObject.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/CachedTestObject.cs @@ -12,8 +12,8 @@ namespace Volo.Abp.DynamicProxy } public virtual async Task GetValueAsync(int v) - { - await Task.Delay(5); + { + await Task.Delay(5).ConfigureAwait(false); return v; } } diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleAsyncInterceptor.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleAsyncInterceptor.cs index 9427298e62..41438d1543 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleAsyncInterceptor.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleAsyncInterceptor.cs @@ -6,12 +6,12 @@ namespace Volo.Abp.DynamicProxy public class SimpleAsyncInterceptor : AbpInterceptor { public override async Task InterceptAsync(IAbpMethodInvocation invocation) - { - await Task.Delay(5); + { + await Task.Delay(5).ConfigureAwait(false); (invocation.TargetObject as ICanLogOnObject)?.Logs?.Add($"{GetType().Name}_InterceptAsync_BeforeInvocation"); - await invocation.ProceedAsync(); + await invocation.ProceedAsync().ConfigureAwait(false); (invocation.TargetObject as ICanLogOnObject)?.Logs?.Add($"{GetType().Name}_InterceptAsync_AfterInvocation"); - await Task.Delay(5); + await Task.Delay(5).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleInterceptionTargetClass.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleInterceptionTargetClass.cs index d1f23ea34c..e683e074d8 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleInterceptionTargetClass.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleInterceptionTargetClass.cs @@ -22,9 +22,9 @@ namespace Volo.Abp.DynamicProxy public virtual async Task GetValueAsync() { Logs.Add("EnterGetValueAsync"); - await Task.Delay(5); + await Task.Delay(5).ConfigureAwait(false); Logs.Add("MiddleGetValueAsync"); - await Task.Delay(5); + await Task.Delay(5).ConfigureAwait(false); Logs.Add("ExitGetValueAsync"); return 42; } @@ -32,9 +32,9 @@ namespace Volo.Abp.DynamicProxy public virtual async Task DoItAsync() { Logs.Add("EnterDoItAsync"); - await Task.Delay(5); + await Task.Delay(5).ConfigureAwait(false); Logs.Add("MiddleDoItAsync"); - await Task.Delay(5); + await Task.Delay(5).ConfigureAwait(false); Logs.Add("ExitDoItAsync"); } } diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleResultCacheTestInterceptor.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleResultCacheTestInterceptor.cs index e5e4d39790..06c3d096fe 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleResultCacheTestInterceptor.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DynamicProxy/SimpleResultCacheTestInterceptor.cs @@ -19,9 +19,9 @@ namespace Volo.Abp.DynamicProxy { invocation.ReturnValue = _cache[invocation.Method]; return; - } - - await invocation.ProceedAsync(); + } + + await invocation.ProceedAsync().ConfigureAwait(false); _cache[invocation.Method] = invocation.ReturnValue; } } diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Threading/AsyncHelper_Tests.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Threading/AsyncHelper_Tests.cs index 1b7b7eacd2..53a4516560 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Threading/AsyncHelper_Tests.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Threading/AsyncHelper_Tests.cs @@ -41,12 +41,12 @@ namespace Volo.Abp.Threading private static async Task MyTaskWithoutReturnValueAsync() { - await Task.Delay(1); + await Task.Delay(1).ConfigureAwait(false); } private static async Task MyTaskWithReturnValueAsync(int aNumber) { - await Task.Delay(1); + await Task.Delay(1).ConfigureAwait(false); return aNumber; } diff --git a/framework/test/Volo.Abp.Dapper.Tests/Volo/Abp/Dapper/Repositories/PersonDapperRepository.cs b/framework/test/Volo.Abp.Dapper.Tests/Volo/Abp/Dapper/Repositories/PersonDapperRepository.cs index 3621f9301e..f7a01649de 100644 --- a/framework/test/Volo.Abp.Dapper.Tests/Volo/Abp/Dapper/Repositories/PersonDapperRepository.cs +++ b/framework/test/Volo.Abp.Dapper.Tests/Volo/Abp/Dapper/Repositories/PersonDapperRepository.cs @@ -17,14 +17,14 @@ namespace Volo.Abp.Dapper.Repositories public virtual async Task> GetAllPersonNames() { - return (await DbConnection.QueryAsync("select Name from People", transaction: DbTransaction)) + return (await DbConnection.QueryAsync("select Name from People", transaction: DbTransaction).ConfigureAwait(false)) .ToList(); } public virtual async Task UpdatePersonNames(string name) { - return await DbConnection.ExecuteAsync("update People set Name = @NewName", new {NewName = name}, - DbTransaction); + return await DbConnection.ExecuteAsync("update People set Name = @NewName", new { NewName = name }, + DbTransaction).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Dapper.Tests/Volo/Abp/Dapper/Repositories/PersonDapperRepository_Tests.cs b/framework/test/Volo.Abp.Dapper.Tests/Volo/Abp/Dapper/Repositories/PersonDapperRepository_Tests.cs index 28734c1fd0..cf085b2298 100644 --- a/framework/test/Volo.Abp.Dapper.Tests/Volo/Abp/Dapper/Repositories/PersonDapperRepository_Tests.cs +++ b/framework/test/Volo.Abp.Dapper.Tests/Volo/Abp/Dapper/Repositories/PersonDapperRepository_Tests.cs @@ -11,7 +11,7 @@ namespace Volo.Abp.Dapper.Repositories [Fact] public async Task GetAllPersonNames_Test() { - var allNames = await GetRequiredService().GetAllPersonNames(); + var allNames = await GetRequiredService().GetAllPersonNames().ConfigureAwait(false); allNames.ShouldNotBeEmpty(); allNames.ShouldContain(x => x == "Douglas"); allNames.ShouldContain(x => x == "John-Deleted"); @@ -23,9 +23,9 @@ namespace Volo.Abp.Dapper.Repositories public async Task UpdatePersonNames_Test() { var personDapperRepository = GetRequiredService(); - await personDapperRepository.UpdatePersonNames("test"); + await personDapperRepository.UpdatePersonNames("test").ConfigureAwait(false); - var allNames = await personDapperRepository.GetAllPersonNames(); + var allNames = await personDapperRepository.GetAllPersonNames().ConfigureAwait(false); allNames.ShouldNotBeEmpty(); allNames.ShouldAllBe(x => x == "test"); } @@ -41,11 +41,11 @@ namespace Volo.Abp.Dapper.Repositories IsTransactional = true })) { - await personDapperRepository.UpdatePersonNames("test"); - await uow.RollbackAsync(); + await personDapperRepository.UpdatePersonNames("test").ConfigureAwait(false); + await uow.RollbackAsync().ConfigureAwait(false); } - var allNames = await personDapperRepository.GetAllPersonNames(); + var allNames = await personDapperRepository.GetAllPersonNames().ConfigureAwait(false); allNames.ShouldAllBe(x => x != "test"); } } diff --git a/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/EmailTemplateRender_Tests.cs b/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/EmailTemplateRender_Tests.cs index 403aaad0bd..fb94c54339 100644 --- a/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/EmailTemplateRender_Tests.cs +++ b/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/EmailTemplateRender_Tests.cs @@ -43,7 +43,7 @@ namespace Volo.Abp.Emailing } }; - var result = await _templateRender.RenderAsync(template, model); + var result = await _templateRender.RenderAsync(template, model).ConfigureAwait(false); result.ShouldBe("Hello john@abp.io 1:iphone,2:ipad,"); } diff --git a/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/EmailTemplateStore_Tests.cs b/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/EmailTemplateStore_Tests.cs index 1011232e57..2ee253b92b 100644 --- a/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/EmailTemplateStore_Tests.cs +++ b/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/EmailTemplateStore_Tests.cs @@ -23,21 +23,21 @@ namespace Volo.Abp.Emailing [Fact] public async Task Should_Get_Registered_Template() { - var template = await _emailTemplateProvider.GetAsync("template1", "tr"); + var template = await _emailTemplateProvider.GetAsync("template1", "tr").ConfigureAwait(false); template.Content.ShouldContain("Lütfen aÅŸağıdaki baÄŸlantıya tıklayarak e-posta adresinizi onaylayın."); } [Fact] public async Task Should_Get_Default_Culture_Template() { - var template = await _emailTemplateProvider.GetAsync("template1", "zh-Hans"); + var template = await _emailTemplateProvider.GetAsync("template1", "zh-Hans").ConfigureAwait(false); template.Content.ShouldContain("Please confirm your email address by clicking the link below."); } [Fact] public async Task Should_Get_Registered_Template_With_Layout() { - var template = await _emailTemplateProvider.GetAsync("template2", "en"); + var template = await _emailTemplateProvider.GetAsync("template2", "en").ConfigureAwait(false); template.Content.ShouldContain($"{Environment.NewLine} " + "Please confirm your email address by clicking the link below."); } @@ -46,7 +46,7 @@ namespace Volo.Abp.Emailing [Fact] public async Task Should_Get_Registered_Template_With_Localize() { - var template = await _emailTemplateProvider.GetAsync("template3", "tr"); + var template = await _emailTemplateProvider.GetAsync("template3", "tr").ConfigureAwait(false); template.Content.ShouldContain("Merhaba Abp"); } } diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondContextTestDataBuilder.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondContextTestDataBuilder.cs index c65cd8d7f4..1f69263f5c 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondContextTestDataBuilder.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondContextTestDataBuilder.cs @@ -19,12 +19,12 @@ namespace Volo.Abp.EntityFrameworkCore.TestApp.SecondContext public async Task BuildAsync() { - await _bookRepository.InsertAsync( + await _bookRepository.InsertAsync( new BookInSecondDbContext( _guidGenerator.Create(), "TestBook1" ) - ); + ).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DbContext_Replace_Tests.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DbContext_Replace_Tests.cs index 7bc4af2e31..5ee320742c 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DbContext_Replace_Tests.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DbContext_Replace_Tests.cs @@ -31,7 +31,7 @@ namespace Volo.Abp.EntityFrameworkCore (_dummyRepository.GetDbContext() is IThirdDbContext).ShouldBeTrue(); (_dummyRepository.GetDbContext() is TestAppDbContext).ShouldBeTrue(); - await _unitOfWorkManager.Current.CompleteAsync(); + await _unitOfWorkManager.Current.CompleteAsync().ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Repositories/Repository_Queryable_Tests.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Repositories/Repository_Queryable_Tests.cs index a5b8aa0577..d178ff7965 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Repositories/Repository_Queryable_Tests.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Repositories/Repository_Queryable_Tests.cs @@ -30,7 +30,7 @@ namespace Volo.Abp.EntityFrameworkCore.Repositories { _bookRepository.Any().ShouldBeTrue(); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } [Fact] @@ -40,7 +40,7 @@ namespace Volo.Abp.EntityFrameworkCore.Repositories { _phoneInSecondDbContextRepository.Any().ShouldBeTrue(); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } [Fact] @@ -52,7 +52,7 @@ namespace Volo.Abp.EntityFrameworkCore.Repositories person.Name.ShouldBe("Douglas"); person.Phones.Count.ShouldBe(2); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Transactions/Transaction_Tests.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Transactions/Transaction_Tests.cs index 7d89da1a08..db4a376ae4 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Transactions/Transaction_Tests.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Transactions/Transaction_Tests.cs @@ -34,16 +34,16 @@ namespace Volo.Abp.EntityFrameworkCore.Transactions { await WithUnitOfWorkAsync(new AbpUnitOfWorkOptions { IsTransactional = true }, async () => { - await _personRepository.InsertAsync(new Person(personId, "Adam", 42)); + await _personRepository.InsertAsync(new Person(personId, "Adam", 42)).ConfigureAwait(false); throw new Exception(exceptionMessage); - }); + }).ConfigureAwait(false); } catch (Exception e) when (e.Message == exceptionMessage) { } - var person = await _personRepository.FindAsync(personId); + var person = await _personRepository.FindAsync(personId).ConfigureAwait(false); person.ShouldBeNull(); } @@ -56,12 +56,12 @@ namespace Volo.Abp.EntityFrameworkCore.Transactions { _unitOfWorkManager.Current.ShouldNotBeNull(); - await _personRepository.InsertAsync(new Person(personId, "Adam", 42)); + await _personRepository.InsertAsync(new Person(personId, "Adam", 42)).ConfigureAwait(false); - await _unitOfWorkManager.Current.RollbackAsync(); - }); + await _unitOfWorkManager.Current.RollbackAsync().ConfigureAwait(false); + }).ConfigureAwait(false); - var person = await _personRepository.FindAsync(personId); + var person = await _personRepository.FindAsync(personId).ConfigureAwait(false); person.ShouldBeNull(); } @@ -79,17 +79,17 @@ namespace Volo.Abp.EntityFrameworkCore.Transactions { _unitOfWorkManager.Current.ShouldNotBeNull(); - await _personRepository.InsertAsync(new Person(personId, "Adam", 42)); - await _bookRepository.InsertAsync(new BookInSecondDbContext(bookId, bookId.ToString())); + await _personRepository.InsertAsync(new Person(personId, "Adam", 42)).ConfigureAwait(false); + await _bookRepository.InsertAsync(new BookInSecondDbContext(bookId, bookId.ToString())).ConfigureAwait(false); - await _unitOfWorkManager.Current.SaveChangesAsync(); + await _unitOfWorkManager.Current.SaveChangesAsync().ConfigureAwait(false); //Will automatically rollback since not called the Complete! } } - (await _personRepository.FindAsync(personId)).ShouldBeNull(); - (await _bookRepository.FindAsync(bookId)).ShouldBeNull(); + (await _personRepository.FindAsync(personId).ConfigureAwait(false)).ShouldBeNull(); + (await _bookRepository.FindAsync(bookId).ConfigureAwait(false)).ShouldBeNull(); } } } diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/CityRepository.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/CityRepository.cs index 027f54a03a..05becda1d3 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/CityRepository.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/CityRepository.cs @@ -18,13 +18,13 @@ namespace Volo.Abp.TestApp.EntityFrameworkCore public async Task FindByNameAsync(string name) { - return await this.FirstOrDefaultAsync(c => c.Name == name); + return await this.FirstOrDefaultAsync(c => c.Name == name).ConfigureAwait(false); } public async Task> GetPeopleInTheCityAsync(string cityName) { - var city = await FindByNameAsync(cityName); - return await DbContext.People.Where(p => p.CityId == city.Id).ToListAsync(); + var city = await FindByNameAsync(cityName).ConfigureAwait(false); + return await DbContext.People.Where(p => p.CityId == city.Id).ToListAsync().ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/PersonRepository.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/PersonRepository.cs index ab8c1920a7..01b949015a 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/PersonRepository.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/PersonRepository.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.TestApp.EntityFrameworkCore public async Task GetViewAsync(string name) { - return await DbContext.PersonView.Where(x => x.Name == name).FirstOrDefaultAsync(); + return await DbContext.PersonView.Where(x => x.Name == name).FirstOrDefaultAsync().ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus_Test.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus_Test.cs index 47649ad3c3..19e61e5afb 100644 --- a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus_Test.cs +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus_Test.cs @@ -10,9 +10,9 @@ namespace Volo.Abp.EventBus.Distributed { DistributedEventBus.Subscribe(); - await DistributedEventBus.PublishAsync(new MySimpleEventData(1)); - await DistributedEventBus.PublishAsync(new MySimpleEventData(2)); - await DistributedEventBus.PublishAsync(new MySimpleEventData(3)); + await DistributedEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); + await DistributedEventBus.PublishAsync(new MySimpleEventData(2)).ConfigureAwait(false); + await DistributedEventBus.PublishAsync(new MySimpleEventData(3)).ConfigureAwait(false); Assert.Equal(3, MySimpleDistributedTransientEventHandler.HandleCount); Assert.Equal(3, MySimpleDistributedTransientEventHandler.DisposeCount); diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/ActionBasedEventHandlerTest.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/ActionBasedEventHandlerTest.cs index 6e6bae2fae..8e41a26eae 100644 --- a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/ActionBasedEventHandlerTest.cs +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/ActionBasedEventHandlerTest.cs @@ -19,10 +19,10 @@ namespace Volo.Abp.EventBus.Local return Task.CompletedTask; }); - await LocalEventBus.PublishAsync(new MySimpleEventData(1)); - await LocalEventBus.PublishAsync(new MySimpleEventData(2)); - await LocalEventBus.PublishAsync(new MySimpleEventData(3)); - await LocalEventBus.PublishAsync(new MySimpleEventData(4)); + await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(2)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(3)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(4)).ConfigureAwait(false); Assert.Equal(10, totalData); } @@ -39,10 +39,10 @@ namespace Volo.Abp.EventBus.Local return Task.CompletedTask; }); - await LocalEventBus.PublishAsync(typeof(MySimpleEventData), new MySimpleEventData(1)); - await LocalEventBus.PublishAsync(typeof(MySimpleEventData), new MySimpleEventData(2)); - await LocalEventBus.PublishAsync(typeof(MySimpleEventData), new MySimpleEventData(3)); - await LocalEventBus.PublishAsync(typeof(MySimpleEventData), new MySimpleEventData(4)); + await LocalEventBus.PublishAsync(typeof(MySimpleEventData), new MySimpleEventData(1)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(typeof(MySimpleEventData), new MySimpleEventData(2)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(typeof(MySimpleEventData), new MySimpleEventData(3)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(typeof(MySimpleEventData), new MySimpleEventData(4)).ConfigureAwait(false); Assert.Equal(10, totalData); } @@ -59,13 +59,13 @@ namespace Volo.Abp.EventBus.Local return Task.CompletedTask; }); - await LocalEventBus.PublishAsync(new MySimpleEventData(1)); - await LocalEventBus.PublishAsync(new MySimpleEventData(2)); - await LocalEventBus.PublishAsync(new MySimpleEventData(3)); + await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(2)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(3)).ConfigureAwait(false); registerDisposer.Dispose(); - await LocalEventBus.PublishAsync(new MySimpleEventData(4)); + await LocalEventBus.PublishAsync(new MySimpleEventData(4)).ConfigureAwait(false); Assert.Equal(6, totalData); } @@ -84,13 +84,13 @@ namespace Volo.Abp.EventBus.Local LocalEventBus.Subscribe(action); - await LocalEventBus.PublishAsync(new MySimpleEventData(1)); - await LocalEventBus.PublishAsync(new MySimpleEventData(2)); - await LocalEventBus.PublishAsync(new MySimpleEventData(3)); + await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(2)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(3)).ConfigureAwait(false); LocalEventBus.Unsubscribe(action); - await LocalEventBus.PublishAsync(new MySimpleEventData(4)); + await LocalEventBus.PublishAsync(new MySimpleEventData(4)).ConfigureAwait(false); Assert.Equal(6, totalData); } @@ -103,15 +103,15 @@ namespace Volo.Abp.EventBus.Local LocalEventBus.Subscribe( async eventData => { - await Task.Delay(20); + await Task.Delay(20).ConfigureAwait(false); Interlocked.Add(ref totalData, eventData.Value); - await Task.Delay(20); + await Task.Delay(20).ConfigureAwait(false); }); - await LocalEventBus.PublishAsync(new MySimpleEventData(1)); - await LocalEventBus.PublishAsync(new MySimpleEventData(2)); - await LocalEventBus.PublishAsync(new MySimpleEventData(3)); - await LocalEventBus.PublishAsync(new MySimpleEventData(4)); + await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(2)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(3)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(4)).ConfigureAwait(false); Assert.Equal(10, totalData); } diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_DI_Services_Test.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_DI_Services_Test.cs index e66deb0e1c..4ae07d8dc6 100644 --- a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_DI_Services_Test.cs +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_DI_Services_Test.cs @@ -9,10 +9,10 @@ namespace Volo.Abp.EventBus.Local [Fact] public async Task Should_Automatically_Register_EventHandlers_From_Services() { - await LocalEventBus.PublishAsync(new MySimpleEventData(1)); - await LocalEventBus.PublishAsync(new MySimpleEventData(2)); - await LocalEventBus.PublishAsync(new MySimpleEventData(3)); - await LocalEventBus.PublishAsync(new MySimpleEventData(4)); + await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(2)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(3)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(4)).ConfigureAwait(false); GetRequiredService().TotalData.ShouldBe(10); } diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_Exception_Test.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_Exception_Test.cs index 446825c697..951a9f841d 100644 --- a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_Exception_Test.cs +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_Exception_Test.cs @@ -14,8 +14,8 @@ namespace Volo.Abp.EventBus.Local var appException = await Assert.ThrowsAsync(async () => { - await LocalEventBus.PublishAsync(new MySimpleEventData(1)); - }); + await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); + }).ConfigureAwait(false); appException.Message.ShouldBe("This exception is intentionally thrown!"); } @@ -31,8 +31,8 @@ namespace Volo.Abp.EventBus.Local var aggrException = await Assert.ThrowsAsync(async () => { - await LocalEventBus.PublishAsync(new MySimpleEventData(1)); - }); + await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); + }).ConfigureAwait(false); aggrException.InnerExceptions.Count.ShouldBe(2); aggrException.InnerExceptions[0].Message.ShouldBe("This exception is intentionally thrown #1!"); diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_MultipleHandle_Test.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_MultipleHandle_Test.cs index d20692fa01..5880dd3662 100644 --- a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_MultipleHandle_Test.cs +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_MultipleHandle_Test.cs @@ -16,7 +16,7 @@ namespace Volo.Abp.EventBus.Local LocalEventBus.Subscribe>(handler); LocalEventBus.Subscribe>(handler); - await LocalEventBus.PublishAsync(new EntityCreatedEventData(new MyEntity())); + await LocalEventBus.PublishAsync(new EntityCreatedEventData(new MyEntity())).ConfigureAwait(false); handler.EntityCreatedEventCount.ShouldBe(1); handler.EntityChangedEventCount.ShouldBe(1); diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/GenericInheritanceTest.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/GenericInheritanceTest.cs index eeec26b166..316de4a396 100644 --- a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/GenericInheritanceTest.cs +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/GenericInheritanceTest.cs @@ -21,7 +21,7 @@ namespace Volo.Abp.EventBus.Local return Task.CompletedTask; }); - await LocalEventBus.PublishAsync(new EntityUpdatedEventData(new Person(42))); + await LocalEventBus.PublishAsync(new EntityUpdatedEventData(new Person(42))).ConfigureAwait(false); triggeredEvent.ShouldBe(true); } @@ -39,7 +39,7 @@ namespace Volo.Abp.EventBus.Local return Task.CompletedTask; }); - await LocalEventBus.PublishAsync(new EntityChangedEventData(new Student(42))); + await LocalEventBus.PublishAsync(new EntityChangedEventData(new Student(42))).ConfigureAwait(false); triggeredEvent.ShouldBe(true); } diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/InheritanceTest.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/InheritanceTest.cs index c3b1dd4283..17474be1d9 100644 --- a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/InheritanceTest.cs +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/InheritanceTest.cs @@ -17,10 +17,10 @@ namespace Volo.Abp.EventBus.Local return Task.CompletedTask; }); - await LocalEventBus.PublishAsync(new MySimpleEventData(1)); //Should handle directly registered class - await LocalEventBus.PublishAsync(new MySimpleEventData(2)); //Should handle directly registered class - await LocalEventBus.PublishAsync(new MyDerivedEventData(3)); //Should handle derived class too - await LocalEventBus.PublishAsync(new MyDerivedEventData(4)); //Should handle derived class too + await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); //Should handle directly registered class + await LocalEventBus.PublishAsync(new MySimpleEventData(2)).ConfigureAwait(false); //Should handle directly registered class + await LocalEventBus.PublishAsync(new MyDerivedEventData(3)).ConfigureAwait(false); //Should handle derived class too + await LocalEventBus.PublishAsync(new MyDerivedEventData(4)).ConfigureAwait(false); //Should handle derived class too Assert.Equal(10, totalData); } @@ -37,10 +37,10 @@ namespace Volo.Abp.EventBus.Local return Task.CompletedTask; }); - await LocalEventBus.PublishAsync(new MySimpleEventData(1)); //Should not handle - await LocalEventBus.PublishAsync(new MySimpleEventData(2)); //Should not handle - await LocalEventBus.PublishAsync(new MyDerivedEventData(3)); //Should handle - await LocalEventBus.PublishAsync(new MyDerivedEventData(4)); //Should handle + await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); //Should not handle + await LocalEventBus.PublishAsync(new MySimpleEventData(2)).ConfigureAwait(false); //Should not handle + await LocalEventBus.PublishAsync(new MyDerivedEventData(3)).ConfigureAwait(false); //Should handle + await LocalEventBus.PublishAsync(new MyDerivedEventData(4)).ConfigureAwait(false); //Should handle Assert.Equal(7, totalData); } diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/TransientDisposableEventHandlerTest.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/TransientDisposableEventHandlerTest.cs index 5ab7ed51af..bfc731f5bf 100644 --- a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/TransientDisposableEventHandlerTest.cs +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/TransientDisposableEventHandlerTest.cs @@ -10,9 +10,9 @@ namespace Volo.Abp.EventBus.Local { LocalEventBus.Subscribe(); - await LocalEventBus.PublishAsync(new MySimpleEventData(1)); - await LocalEventBus.PublishAsync(new MySimpleEventData(2)); - await LocalEventBus.PublishAsync(new MySimpleEventData(3)); + await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(2)).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new MySimpleEventData(3)).ConfigureAwait(false); Assert.Equal(3, MySimpleTransientEventHandler.HandleCount); Assert.Equal(3, MySimpleTransientEventHandler.DisposeCount); diff --git a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureChecker_Tests.cs b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureChecker_Tests.cs index 7ea01268a0..dc849d9b50 100644 --- a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureChecker_Tests.cs +++ b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureChecker_Tests.cs @@ -20,16 +20,16 @@ namespace Volo.Abp.Features public async Task IsEnabledAsync() { //Tenant is unknown - (await _featureChecker.IsEnabledAsync("BooleanTestFeature1")).ShouldBeFalse(); + (await _featureChecker.IsEnabledAsync("BooleanTestFeature1").ConfigureAwait(false)).ShouldBeFalse(); using (_currentTenant.Change(TestFeatureStore.Tenant1Id)) { - (await _featureChecker.IsEnabledAsync("BooleanTestFeature1")).ShouldBeTrue(); + (await _featureChecker.IsEnabledAsync("BooleanTestFeature1").ConfigureAwait(false)).ShouldBeTrue(); } using (_currentTenant.Change(TestFeatureStore.Tenant2Id)) { - (await _featureChecker.IsEnabledAsync("BooleanTestFeature1")).ShouldBeFalse(); + (await _featureChecker.IsEnabledAsync("BooleanTestFeature1").ConfigureAwait(false)).ShouldBeFalse(); } } @@ -37,16 +37,16 @@ namespace Volo.Abp.Features public async Task GetOrNullAsync() { //Tenant is unknown - (await _featureChecker.GetOrNullAsync("IntegerTestFeature1")).ShouldBe("1"); + (await _featureChecker.GetOrNullAsync("IntegerTestFeature1").ConfigureAwait(false)).ShouldBe("1"); using (_currentTenant.Change(TestFeatureStore.Tenant1Id)) { - (await _featureChecker.GetOrNullAsync("IntegerTestFeature1")).ShouldBe("1"); + (await _featureChecker.GetOrNullAsync("IntegerTestFeature1").ConfigureAwait(false)).ShouldBe("1"); } using (_currentTenant.Change(TestFeatureStore.Tenant2Id)) { - (await _featureChecker.GetOrNullAsync("IntegerTestFeature1")).ShouldBe("34"); + (await _featureChecker.GetOrNullAsync("IntegerTestFeature1").ConfigureAwait(false)).ShouldBe("34"); } } } diff --git a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureInterceptor_Tests.cs b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureInterceptor_Tests.cs index bdc17a1d5f..eb10664239 100644 --- a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureInterceptor_Tests.cs +++ b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureInterceptor_Tests.cs @@ -29,18 +29,18 @@ namespace Volo.Abp.Features { await Assert.ThrowsAsync(async () => { - await _classFeatureTestService.NoAdditionalFeatureAsync(); - }); + await _classFeatureTestService.NoAdditionalFeatureAsync().ConfigureAwait(false); + }).ConfigureAwait(false); await Assert.ThrowsAsync(async () => { - await _classFeatureTestService.Feature2Async(); - }); + await _classFeatureTestService.Feature2Async().ConfigureAwait(false); + }).ConfigureAwait(false); await Assert.ThrowsAsync(async () => { - await _methodFeatureTestService.Feature1Async(); - }); + await _methodFeatureTestService.Feature1Async().ConfigureAwait(false); + }).ConfigureAwait(false); } } @@ -50,9 +50,9 @@ namespace Volo.Abp.Features //Features were enabled for Tenant 1 using (_currentTenant.Change(TestFeatureStore.Tenant1Id)) { - await _classFeatureTestService.NoAdditionalFeatureAsync(); - (await _classFeatureTestService.Feature2Async()).ShouldBe(42); - (await _methodFeatureTestService.Feature1Async()).ShouldBe(42); + await _classFeatureTestService.NoAdditionalFeatureAsync().ConfigureAwait(false); + (await _classFeatureTestService.Feature2Async().ConfigureAwait(false)).ShouldBe(42); + (await _methodFeatureTestService.Feature1Async().ConfigureAwait(false)).ShouldBe(42); } } @@ -64,7 +64,7 @@ namespace Volo.Abp.Features { using (_currentTenant.Change(ParseNullableGuid(tenantIdValue))) { - await _methodFeatureTestService.NonFeatureAsync(); + await _methodFeatureTestService.NonFeatureAsync().ConfigureAwait(false); } } diff --git a/framework/test/Volo.Abp.FluentValidation.Tests/Volo/Abp/FluentValidation/ApplicationService_FluentValidation_Tests.cs b/framework/test/Volo.Abp.FluentValidation.Tests/Volo/Abp/FluentValidation/ApplicationService_FluentValidation_Tests.cs index 82541a5aa4..fdf329caec 100644 --- a/framework/test/Volo.Abp.FluentValidation.Tests/Volo/Abp/FluentValidation/ApplicationService_FluentValidation_Tests.cs +++ b/framework/test/Volo.Abp.FluentValidation.Tests/Volo/Abp/FluentValidation/ApplicationService_FluentValidation_Tests.cs @@ -39,7 +39,7 @@ namespace Volo.Abp.FluentValidation { MyStringValue3 = "ccc" } - }); + }).ConfigureAwait(false); asyncOutput.ShouldBe("aaabbbccc"); } @@ -64,7 +64,7 @@ namespace Volo.Abp.FluentValidation } } ) - ); +.ConfigureAwait(false)).ConfigureAwait(false); exception.ValidationErrors.ShouldContain(x => x.MemberNames.Contains("MyStringValue")); exception.ValidationErrors.ShouldContain(x => x.MemberNames.Contains("MyMethodInput2.MyStringValue2")); @@ -82,7 +82,7 @@ namespace Volo.Abp.FluentValidation { MyStringValue3 = "c" } - })); + }).ConfigureAwait(false)).ConfigureAwait(false); exception.ValidationErrors.ShouldContain(x => x.MemberNames.Contains("MyStringValue")); exception.ValidationErrors.ShouldContain(x => x.MemberNames.Contains("MyMethodInput2.MyStringValue2")); exception.ValidationErrors.ShouldContain(x => x.MemberNames.Contains("MyMethodInput3.MyStringValue3")); @@ -94,7 +94,7 @@ namespace Volo.Abp.FluentValidation var output = await _myAppService.NotValidateMyMethod(new MyMethodInput4 { MyStringValue4 = "444" - }); + }).ConfigureAwait(false); output.ShouldBe("444"); } diff --git a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs index 0c75fc68ff..80a68e5a18 100644 --- a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs +++ b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs @@ -29,7 +29,7 @@ namespace Volo.Abp.Http.DynamicProxying { var firstPerson = (await _personRepository.GetListAsync()).First(); - var person = await _peopleAppService.GetAsync(firstPerson.Id); + var person = await _peopleAppService.GetAsync(firstPerson.Id).ConfigureAwait(false); person.ShouldNotBeNull(); person.Id.ShouldBe(firstPerson.Id); person.Name.ShouldBe(firstPerson.Name); @@ -38,7 +38,7 @@ namespace Volo.Abp.Http.DynamicProxying [Fact] public async Task GetList() { - var people = await _peopleAppService.GetListAsync(new PagedAndSortedResultRequestDto()); + var people = await _peopleAppService.GetListAsync(new PagedAndSortedResultRequestDto()).ConfigureAwait(false); people.TotalCount.ShouldBeGreaterThan(0); people.Items.Count.ShouldBe((int) people.TotalCount); } @@ -48,7 +48,7 @@ namespace Volo.Abp.Http.DynamicProxying { var firstPerson = (await _personRepository.GetListAsync()).First(); - await _peopleAppService.DeleteAsync(firstPerson.Id); + await _peopleAppService.DeleteAsync(firstPerson.Id).ConfigureAwait(false); firstPerson = (await _personRepository.GetListAsync()).FirstOrDefault(p => p.Id == firstPerson.Id); firstPerson.ShouldBeNull(); @@ -59,12 +59,12 @@ namespace Volo.Abp.Http.DynamicProxying { var uniquePersonName = Guid.NewGuid().ToString(); - var person = await _peopleAppService.CreateAsync(new PersonDto - { - Name = uniquePersonName, - Age = 42 - } - ); + var person = await _peopleAppService.CreateAsync(new PersonDto + { + Name = uniquePersonName, + Age = 42 + } + ).ConfigureAwait(false); person.ShouldNotBeNull(); person.Id.ShouldNotBe(Guid.Empty); @@ -89,7 +89,7 @@ namespace Volo.Abp.Http.DynamicProxying Name = uniquePersonName, Age = firstPerson.Age } - ); + ).ConfigureAwait(false); person.ShouldNotBeNull(); person.Id.ShouldBe(firstPerson.Id); @@ -108,8 +108,8 @@ namespace Volo.Abp.Http.DynamicProxying { await Assert.ThrowsAnyAsync(async () => { - await _peopleAppService.GetWithAuthorized(); - }); + await _peopleAppService.GetWithAuthorized().ConfigureAwait(false); + }).ConfigureAwait(false); } [Fact] @@ -128,7 +128,7 @@ namespace Volo.Abp.Http.DynamicProxying } } } - ); + ).ConfigureAwait(false); result.Value1.ShouldBe("value one"); result.Inner1.Value2.ShouldBe("value two"); diff --git a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs index cabbac6775..fdf422d585 100644 --- a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs +++ b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs @@ -20,41 +20,41 @@ namespace Volo.Abp.Http.DynamicProxying [Fact] public async Task IncrementValueAsync() { - (await _controller.IncrementValueAsync(42)).ShouldBe(43); + (await _controller.IncrementValueAsync(42).ConfigureAwait(false)).ShouldBe(43); } [Fact] public async Task GetException1Async() { - var exception = await Assert.ThrowsAsync(async () => await _controller.GetException1Async()); + var exception = await Assert.ThrowsAsync(async () => await _controller.GetException1Async().ConfigureAwait(false)).ConfigureAwait(false); exception.Error.Message.ShouldBe("This is an error message!"); } [Fact] public async Task PostValueWithHeaderAndQueryStringAsync() { - var result = await _controller.PostValueWithHeaderAndQueryStringAsync("myheader", "myqs"); + var result = await _controller.PostValueWithHeaderAndQueryStringAsync("myheader", "myqs").ConfigureAwait(false); result.ShouldBe("myheader#myqs"); } [Fact] public async Task PostValueWithBodyAsync() { - var result = await _controller.PostValueWithBodyAsync("mybody"); + var result = await _controller.PostValueWithBodyAsync("mybody").ConfigureAwait(false); result.ShouldBe("mybody"); } [Fact] public async Task PutValueWithBodyAsync() { - var result = await _controller.PutValueWithBodyAsync("mybody"); + var result = await _controller.PutValueWithBodyAsync("mybody").ConfigureAwait(false); result.ShouldBe("mybody"); } [Fact] public async Task PostObjectWithBodyAsync() { - var result = await _controller.PostObjectWithBodyAsync(new Car{Year = 1976, Model = "Ford"}); + var result = await _controller.PostObjectWithBodyAsync(new Car { Year = 1976, Model = "Ford" }).ConfigureAwait(false); result.Year.ShouldBe(1976); result.Model.ShouldBe("Ford"); } @@ -62,7 +62,7 @@ namespace Volo.Abp.Http.DynamicProxying [Fact] public async Task PostObjectWithQueryAsync() { - var result = await _controller.PostObjectWithQueryAsync(new Car{Year = 1976, Model = "Ford"}); + var result = await _controller.PostObjectWithQueryAsync(new Car { Year = 1976, Model = "Ford" }).ConfigureAwait(false); result.Year.ShouldBe(1976); result.Model.ShouldBe("Ford"); } @@ -70,7 +70,7 @@ namespace Volo.Abp.Http.DynamicProxying [Fact] public async Task GetObjectWithUrlAsync() { - var result = await _controller.GetObjectWithUrlAsync(new Car{Year = 1976, Model = "Ford"}); + var result = await _controller.GetObjectWithUrlAsync(new Car { Year = 1976, Model = "Ford" }).ConfigureAwait(false); result.Year.ShouldBe(1976); result.Model.ShouldBe("Ford"); } @@ -78,7 +78,7 @@ namespace Volo.Abp.Http.DynamicProxying [Fact] public async Task GetObjectandIdAsync() { - var result = await _controller.GetObjectandIdAsync(42, new Car{Year = 1976, Model = "Ford"}); + var result = await _controller.GetObjectandIdAsync(42, new Car { Year = 1976, Model = "Ford" }).ConfigureAwait(false); result.Year.ShouldBe(42); result.Model.ShouldBe("Ford"); } @@ -86,7 +86,7 @@ namespace Volo.Abp.Http.DynamicProxying [Fact] public async Task GetObjectAndIdWithQueryAsync() { - var result = await _controller.GetObjectAndIdWithQueryAsync(42, new Car{Year = 1976, Model = "Ford"}); + var result = await _controller.GetObjectAndIdWithQueryAsync(42, new Car { Year = 1976, Model = "Ford" }).ConfigureAwait(false); result.Year.ShouldBe(42); result.Model.ShouldBe("Ford"); } @@ -94,28 +94,28 @@ namespace Volo.Abp.Http.DynamicProxying [Fact] public async Task PatchValueWithBodyAsync() { - var result = await _controller.PatchValueWithBodyAsync("mybody"); + var result = await _controller.PatchValueWithBodyAsync("mybody").ConfigureAwait(false); result.ShouldBe("mybody"); } [Fact] public async Task PutValueWithHeaderAndQueryStringAsync() { - var result = await _controller.PutValueWithHeaderAndQueryStringAsync("myheader", "myqs"); + var result = await _controller.PutValueWithHeaderAndQueryStringAsync("myheader", "myqs").ConfigureAwait(false); result.ShouldBe("myheader#myqs"); } [Fact] public async Task PatchValueWithHeaderAndQueryStringAsync() { - var result = await _controller.PatchValueWithHeaderAndQueryStringAsync("myheader", "myqs"); + var result = await _controller.PatchValueWithHeaderAndQueryStringAsync("myheader", "myqs").ConfigureAwait(false); result.ShouldBe("myheader#myqs"); } [Fact] public async Task DeleteByIdAsync() { - (await _controller.DeleteByIdAsync(42)).ShouldBe(43); + (await _controller.DeleteByIdAsync(42).ConfigureAwait(false)).ShouldBe(43); } } diff --git a/framework/test/Volo.Abp.MailKit.Tests/Volo/Abp/MailKit/MailKitSmtpEmailSender_Tests.cs b/framework/test/Volo.Abp.MailKit.Tests/Volo/Abp/MailKit/MailKitSmtpEmailSender_Tests.cs index de9acb3a0e..466fa4c73c 100644 --- a/framework/test/Volo.Abp.MailKit.Tests/Volo/Abp/MailKit/MailKitSmtpEmailSender_Tests.cs +++ b/framework/test/Volo.Abp.MailKit.Tests/Volo/Abp/MailKit/MailKitSmtpEmailSender_Tests.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.MailKit var mailMessage = new MailMessage("from_mail_address@asd.com", "to_mail_address@asd.com", "subject", "body") { IsBodyHtml = true }; - await mailSender.SendAsync(mailMessage); + await mailSender.SendAsync(mailMessage).ConfigureAwait(false); } //[Fact] @@ -29,7 +29,7 @@ namespace Volo.Abp.MailKit IsBodyHtml = true }; - await mailSender.SendAsync(mailMessage); + await mailSender.SendAsync(mailMessage).ConfigureAwait(false); } private static MailKitSmtpEmailSender CreateMailKitEmailSender() diff --git a/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/TestApp/MemoryDb/CityRepository.cs b/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/TestApp/MemoryDb/CityRepository.cs index b6d43dc875..c83a28871f 100644 --- a/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/TestApp/MemoryDb/CityRepository.cs +++ b/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/TestApp/MemoryDb/CityRepository.cs @@ -22,7 +22,7 @@ namespace Volo.Abp.TestApp.MemoryDb public async Task> GetPeopleInTheCityAsync(string cityName) { - var city = await FindByNameAsync(cityName); + var city = await FindByNameAsync(cityName).ConfigureAwait(false); return Database.Collection().Where(p => p.CityId == city.Id).ToList(); } diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests.cs index efa64b3617..7458f85417 100644 --- a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests.cs +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests.cs @@ -19,20 +19,20 @@ namespace Volo.Abp.MongoDB.Repositories PersonRepository.FirstOrDefault(p => p.Name == "Douglas").ShouldNotBeNull(); PersonRepository.Count().ShouldBeGreaterThan(0); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } [Fact] public async Task UpdateAsync() { - var person = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId); + var person = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); person.ChangeName("Douglas-Updated"); person.Phones.Add(new Phone(person.Id, "6667778899", PhoneType.Office)); - await PersonRepository.UpdateAsync(person); + await PersonRepository.UpdateAsync(person).ConfigureAwait(false); - person = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); + person = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); person.ShouldNotBeNull(); person.Name.ShouldBe("Douglas-Updated"); person.Phones.Count.ShouldBe(3); @@ -45,9 +45,9 @@ namespace Volo.Abp.MongoDB.Repositories var person = new Person(Guid.NewGuid(), "New Person", 35); person.Phones.Add(new Phone(person.Id, "1234567890")); - await PersonRepository.InsertAsync(person); + await PersonRepository.InsertAsync(person).ConfigureAwait(false); - person = await PersonRepository.FindAsync(person.Id); + person = await PersonRepository.FindAsync(person.Id).ConfigureAwait(false); person.ShouldNotBeNull(); person.Name.ShouldBe("New Person"); person.Phones.Count.ShouldBe(1); diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/TestApp/MongoDb/CityRepository.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/TestApp/MongoDb/CityRepository.cs index bb31883010..27381a14da 100644 --- a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/TestApp/MongoDb/CityRepository.cs +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/TestApp/MongoDb/CityRepository.cs @@ -19,13 +19,13 @@ namespace Volo.Abp.TestApp.MongoDB public async Task FindByNameAsync(string name) { - return await (await Collection.FindAsync(c => c.Name == name)).FirstOrDefaultAsync(); + return await (await Collection.FindAsync(c => c.Name == name).ConfigureAwait(false)).FirstOrDefaultAsync().ConfigureAwait(false); } public async Task> GetPeopleInTheCityAsync(string cityName) { - var city = await FindByNameAsync(cityName); - return await DbContext.People.AsQueryable().Where(p => p.CityId == city.Id).ToListAsync(); + var city = await FindByNameAsync(cityName).ConfigureAwait(false); + return await DbContext.People.AsQueryable().Where(p => p.CityId == city.Id).ToListAsync().ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingProvider_Tests.cs b/framework/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingProvider_Tests.cs index c3c22f76f9..3feeaa129b 100644 --- a/framework/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingProvider_Tests.cs +++ b/framework/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingProvider_Tests.cs @@ -21,14 +21,14 @@ namespace Volo.Abp.Settings [Fact] public async Task Should_Get_Null_If_No_Value_Provided_And_No_Default_Value() { - (await _settingProvider.GetOrNullAsync(TestSettingNames.TestSettingWithoutDefaultValue)) + (await _settingProvider.GetOrNullAsync(TestSettingNames.TestSettingWithoutDefaultValue).ConfigureAwait(false)) .ShouldBeNull(); } [Fact] public async Task Should_Get_Default_Value_If_No_Value_Provided_And_There_Is_A_Default_Value() { - (await _settingProvider.GetOrNullAsync(TestSettingNames.TestSettingWithDefaultValue)) + (await _settingProvider.GetOrNullAsync(TestSettingNames.TestSettingWithDefaultValue).ConfigureAwait(false)) .ShouldBe("default-value"); } } diff --git a/framework/test/Volo.Abp.TestApp.Tests/Volo/Abp/TestApp/Application/PersonAppService_Tests.cs b/framework/test/Volo.Abp.TestApp.Tests/Volo/Abp/TestApp/Application/PersonAppService_Tests.cs index 0da6d4c8dc..fc38b437b8 100644 --- a/framework/test/Volo.Abp.TestApp.Tests/Volo/Abp/TestApp/Application/PersonAppService_Tests.cs +++ b/framework/test/Volo.Abp.TestApp.Tests/Volo/Abp/TestApp/Application/PersonAppService_Tests.cs @@ -31,17 +31,17 @@ namespace Volo.Abp.TestApp.Application [Fact] public async Task GetList() { - var people = await _peopleAppService.GetListAsync(new PagedAndSortedResultRequestDto()); + var people = await _peopleAppService.GetListAsync(new PagedAndSortedResultRequestDto()).ConfigureAwait(false); people.Items.Count.ShouldBeGreaterThan(0); } [Fact] public async Task Create() { - var personDto = await _peopleAppService.CreateAsync(new PersonDto()); + var personDto = await _peopleAppService.CreateAsync(new PersonDto()).ConfigureAwait(false); var repository = ServiceProvider.GetService>(); - var person = await repository.FindAsync(personDto.Id); + var person = await repository.FindAsync(personDto.Id).ConfigureAwait(false); person.ShouldNotBeNull(); person.TenantId.ShouldBeNull(); @@ -52,10 +52,10 @@ namespace Volo.Abp.TestApp.Application { _fakeCurrentTenant.Id.Returns(TestDataBuilder.TenantId1); - var personDto = await _peopleAppService.CreateAsync(new PersonDto()); + var personDto = await _peopleAppService.CreateAsync(new PersonDto()).ConfigureAwait(false); var repository = ServiceProvider.GetService>(); - var person = await repository.FindAsync(personDto.Id); + var person = await repository.FindAsync(personDto.Id).ConfigureAwait(false); person.ShouldNotBeNull(); person.TenantId.ShouldNotBeNull(); diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs index 522f8d9794..6d5c2136f3 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs @@ -21,7 +21,7 @@ namespace Volo.Abp.TestApp.Application public async Task> GetPhones(Guid id, GetPersonPhonesFilter filter) { - var phones = (await GetEntityByIdAsync(id)).Phones + var phones = (await GetEntityByIdAsync(id).ConfigureAwait(false)).Phones .WhereIf(filter.Type.HasValue, p => p.Type == filter.Type) .ToList(); @@ -32,19 +32,19 @@ namespace Volo.Abp.TestApp.Application public async Task AddPhone(Guid id, PhoneDto phoneDto) { - var person = await GetEntityByIdAsync(id); + var person = await GetEntityByIdAsync(id).ConfigureAwait(false); var phone = new Phone(person.Id, phoneDto.Number, phoneDto.Type); person.Phones.Add(phone); - await Repository.UpdateAsync(person); + await Repository.UpdateAsync(person).ConfigureAwait(false); return ObjectMapper.Map(phone); } public async Task RemovePhone(Guid id, string number) { - var person = await GetEntityByIdAsync(id); + var person = await GetEntityByIdAsync(id).ConfigureAwait(false); person.Phones.RemoveAll(p => p.Number == number); - await Repository.UpdateAsync(person); + await Repository.UpdateAsync(person).ConfigureAwait(false); } [Authorize] diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestDataBuilder.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestDataBuilder.cs index a11ba60639..7e2be35de0 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestDataBuilder.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestDataBuilder.cs @@ -32,9 +32,9 @@ namespace Volo.Abp.TestApp public async Task BuildAsync() { - await AddCities(); - await AddPeople(); - await AddEntitiesWithPks(); + await AddCities().ConfigureAwait(false); + await AddPeople().ConfigureAwait(false); + await AddEntitiesWithPks().ConfigureAwait(false); } private async Task AddCities() @@ -44,17 +44,17 @@ namespace Volo.Abp.TestApp istanbul.Districts.Add(new District(istanbul.Id, "Mecidiyeköy", 2222321)); istanbul.Districts.Add(new District(istanbul.Id, "Uskudar", 726172)); - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Tokyo")); - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Madrid")); - await _cityRepository.InsertAsync(new City(LondonCityId, "London") {ExtraProperties = { { "Population", 10_470_000 } } }); - await _cityRepository.InsertAsync(istanbul); - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Paris")); - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Washington")); - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Sao Paulo")); - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Berlin")); - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Amsterdam")); - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Beijing")); - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Rome")); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Tokyo")).ConfigureAwait(false); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Madrid")).ConfigureAwait(false); + await _cityRepository.InsertAsync(new City(LondonCityId, "London") { ExtraProperties = { { "Population", 10_470_000 } } }).ConfigureAwait(false); + await _cityRepository.InsertAsync(istanbul).ConfigureAwait(false); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Paris")).ConfigureAwait(false); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Washington")).ConfigureAwait(false); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Sao Paulo")).ConfigureAwait(false); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Berlin")).ConfigureAwait(false); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Amsterdam")).ConfigureAwait(false); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Beijing")).ConfigureAwait(false); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), "Rome")).ConfigureAwait(false); } private async Task AddPeople() @@ -63,20 +63,20 @@ namespace Volo.Abp.TestApp douglas.Phones.Add(new Phone(douglas.Id, "123456789")); douglas.Phones.Add(new Phone(douglas.Id, "123456780", PhoneType.Home)); - await _personRepository.InsertAsync(douglas); + await _personRepository.InsertAsync(douglas).ConfigureAwait(false); - await _personRepository.InsertAsync(new Person(UserJohnDeletedId, "John-Deleted", 33) { IsDeleted = true }); + await _personRepository.InsertAsync(new Person(UserJohnDeletedId, "John-Deleted", 33) { IsDeleted = true }).ConfigureAwait(false); var tenant1Person1 = new Person(Guid.NewGuid(), TenantId1 + "-Person1", 42, TenantId1); var tenant1Person2 = new Person(Guid.NewGuid(), TenantId1 + "-Person2", 43, TenantId1); - await _personRepository.InsertAsync(tenant1Person1); - await _personRepository.InsertAsync(tenant1Person2); + await _personRepository.InsertAsync(tenant1Person1).ConfigureAwait(false); + await _personRepository.InsertAsync(tenant1Person2).ConfigureAwait(false); } private async Task AddEntitiesWithPks() { - await _entityWithIntPksRepository.InsertAsync(new EntityWithIntPk("Entity1")); + await _entityWithIntPksRepository.InsertAsync(new EntityWithIntPk("Entity1")).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/AbpDateTimeValueConverter_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/AbpDateTimeValueConverter_Tests.cs index e36225e53c..782f61830a 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/AbpDateTimeValueConverter_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/AbpDateTimeValueConverter_Tests.cs @@ -28,9 +28,9 @@ namespace Volo.Abp.TestApp.Testing { Birthday = DateTime.Parse("2020-01-01 00:00:00"), LastActive = DateTime.Parse("2020-01-01 00:00:00"), - }, true); + }, true).ConfigureAwait(false); - var person = await _personRepository.GetAsync(personId); + var person = await _personRepository.GetAsync(personId).ConfigureAwait(false); person.ShouldNotBeNull(); person.CreationTime.Kind.ShouldBe(DateTimeKind.Utc); @@ -53,9 +53,9 @@ namespace Volo.Abp.TestApp.Testing { Birthday = DateTime.Parse("2020-01-01 00:00:00"), LastActive = DateTime.Parse("2020-01-01 00:00:00"), - }, true); + }, true).ConfigureAwait(false); - var person = await _personRepository.GetViewAsync(personName); + var person = await _personRepository.GetViewAsync(personName).ConfigureAwait(false); person.ShouldNotBeNull(); person.CreationTime.Kind.ShouldBe(DateTimeKind.Utc); diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Auditing_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Auditing_Tests.cs index 41ef7ce076..dcbfdaf045 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Auditing_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Auditing_Tests.cs @@ -49,9 +49,9 @@ namespace Volo.Abp.TestApp.Testing var personId = Guid.NewGuid(); - await PersonRepository.InsertAsync(new Person(personId, "Adam", 42)); + await PersonRepository.InsertAsync(new Person(personId, "Adam", 42)).ConfigureAwait(false); - var person = await PersonRepository.FindAsync(personId); + var person = await PersonRepository.FindAsync(personId).ConfigureAwait(false); person.ShouldNotBeNull(); person.CreationTime.ShouldBeLessThanOrEqualTo(Clock.Now); @@ -68,14 +68,14 @@ namespace Volo.Abp.TestApp.Testing CurrentUserId = Guid.Parse(currentUserId); } - var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId); + var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); douglas.LastModificationTime.ShouldBeNull(); douglas.Age++; - await PersonRepository.UpdateAsync(douglas); + await PersonRepository.UpdateAsync(douglas).ConfigureAwait(false); - douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); + douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); douglas.ShouldNotBeNull(); douglas.LastModificationTime.ShouldNotBeNull(); @@ -93,17 +93,17 @@ namespace Volo.Abp.TestApp.Testing CurrentUserId = Guid.Parse(currentUserId); } - var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId); + var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); - await PersonRepository.DeleteAsync(douglas); + await PersonRepository.DeleteAsync(douglas).ConfigureAwait(false); - douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); + douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); douglas.ShouldBeNull(); using (DataFilter.Disable()) { - douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); + douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); douglas.ShouldNotBeNull(); douglas.DeletionTime.ShouldNotBeNull(); diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/ConcurrencyStamp_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/ConcurrencyStamp_Tests.cs index 2c5a5d89ab..1f7c927251 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/ConcurrencyStamp_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/ConcurrencyStamp_Tests.cs @@ -20,37 +20,37 @@ namespace Volo.Abp.TestApp.Testing public async Task Should_Not_Allow_To_Update_If_The_Entity_Has_Changed() { //Got an entity from database, changed its value, but not updated in the database yet - var london1 = await CityRepository.FindByNameAsync("London"); + var london1 = await CityRepository.FindByNameAsync("London").ConfigureAwait(false); london1.Name = "London-1"; //Another user has changed it just before I update - var london2 = await CityRepository.FindByNameAsync("London"); + var london2 = await CityRepository.FindByNameAsync("London").ConfigureAwait(false); london2.Name = "London-2"; - await CityRepository.UpdateAsync(london2); + await CityRepository.UpdateAsync(london2).ConfigureAwait(false); //And updating my old entity throws exception! await Assert.ThrowsAsync(async () => { - await CityRepository.UpdateAsync(london1); - }); + await CityRepository.UpdateAsync(london1).ConfigureAwait(false); + }).ConfigureAwait(false); } [Fact] public async Task Should_Not_Allow_To_Delete_If_The_Entity_Has_Changed() { //Got an entity from database, but not deleted in the database yet - var london1 = await CityRepository.FindByNameAsync("London"); + var london1 = await CityRepository.FindByNameAsync("London").ConfigureAwait(false); //Another user has changed it just before I delete - var london2 = await CityRepository.FindByNameAsync("London"); + var london2 = await CityRepository.FindByNameAsync("London").ConfigureAwait(false); london2.Name = "London-updated"; - await CityRepository.UpdateAsync(london2); + await CityRepository.UpdateAsync(london2).ConfigureAwait(false); //And deleting my old entity throws exception! await Assert.ThrowsAsync(async () => { - await CityRepository.DeleteAsync(london1); - }); + await CityRepository.DeleteAsync(london1).ConfigureAwait(false); + }).ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/DomainEvents_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/DomainEvents_Tests.cs index 3ca7eaf8e4..2c6982de6a 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/DomainEvents_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/DomainEvents_Tests.cs @@ -55,8 +55,8 @@ namespace Volo.Abp.TestApp.Testing { var dougles = PersonRepository.Single(b => b.Name == "Douglas"); dougles.ChangeName("Douglas-Changed"); - await PersonRepository.UpdateAsync(dougles); - }); + await PersonRepository.UpdateAsync(dougles).ConfigureAwait(false); + }).ConfigureAwait(false); //Assert diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs index fe4e0862f3..bc38257683 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs @@ -75,9 +75,9 @@ namespace Volo.Abp.TestApp.Testing return Task.CompletedTask; }); - await PersonRepository.InsertAsync(new Person(Guid.NewGuid(), personName, 15)); + await PersonRepository.InsertAsync(new Person(Guid.NewGuid(), personName, 15)).ConfigureAwait(false); - await uow.CompleteAsync(); + await uow.CompleteAsync().ConfigureAwait(false); } creatingEventTriggered.ShouldBeTrue(); diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/ExtraProperties_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/ExtraProperties_Tests.cs index 67eff13572..a52ddbee3a 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/ExtraProperties_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/ExtraProperties_Tests.cs @@ -20,7 +20,7 @@ namespace Volo.Abp.TestApp.Testing [Fact] public async Task Should_Get_An_Extra_Property() { - var london = await CityRepository.FindByNameAsync("London"); + var london = await CityRepository.FindByNameAsync("London").ConfigureAwait(false); london.HasProperty("Population").ShouldBeTrue(); london.GetProperty("Population").ShouldBe(10_470_000); } @@ -28,11 +28,11 @@ namespace Volo.Abp.TestApp.Testing [Fact] public async Task Should_Add_An_Extra_Property() { - var london = await CityRepository.FindByNameAsync("London"); + var london = await CityRepository.FindByNameAsync("London").ConfigureAwait(false); london.SetProperty("AreaAsKm", 1572); - await CityRepository.UpdateAsync(london); + await CityRepository.UpdateAsync(london).ConfigureAwait(false); - var london2 = await CityRepository.FindByNameAsync("London"); + var london2 = await CityRepository.FindByNameAsync("London").ConfigureAwait(false); london2.HasProperty("AreaAsKm").ShouldBeTrue(); london2.GetProperty("AreaAsKm").ShouldBe(1572); } @@ -40,12 +40,12 @@ namespace Volo.Abp.TestApp.Testing [Fact] public async Task Should_Update_An_Existing_Extra_Property() { - var london = await CityRepository.FindByNameAsync("London"); + var london = await CityRepository.FindByNameAsync("London").ConfigureAwait(false); london.ExtraProperties["Population"] = 11_000_042; - await CityRepository.UpdateAsync(london); + await CityRepository.UpdateAsync(london).ConfigureAwait(false); - var london2 = await CityRepository.FindByNameAsync("London"); + var london2 = await CityRepository.FindByNameAsync("London").ConfigureAwait(false); london2.HasProperty("Population").ShouldBeTrue(); london2.GetProperty("Population").ShouldBe(11_000_042); } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Creation_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Creation_Tests.cs index c648fc66d4..15ba184f4d 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Creation_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Creation_Tests.cs @@ -45,9 +45,9 @@ namespace Volo.Abp.TestApp.Testing Id = personId, Name = "Person1", Age = 21 - }); + }).ConfigureAwait(false); - var person = await _personRepository.FindAsync(personId); + var person = await _personRepository.FindAsync(personId).ConfigureAwait(false); person.ShouldNotBeNull(); person.TenantId.ShouldNotBeNull(); @@ -66,9 +66,9 @@ namespace Volo.Abp.TestApp.Testing Id = personId, Name = "Person1", Age = 21 - }); + }).ConfigureAwait(false); - var person = await _personRepository.FindAsync(personId); + var person = await _personRepository.FindAsync(personId).ConfigureAwait(false); person.ShouldNotBeNull(); person.TenantId.ShouldBeNull(); diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Filter_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Filter_Tests.cs index da3e33ffea..10ce8e1605 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Filter_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/MultiTenant_Filter_Tests.cs @@ -63,7 +63,7 @@ namespace Volo.Abp.TestApp.Testing people.Count.ShouldBe(0); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } [Fact] @@ -85,7 +85,7 @@ namespace Volo.Abp.TestApp.Testing people.Count.ShouldBe(1); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests.cs index 07e6211c09..7571c4fecd 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests.cs @@ -23,7 +23,7 @@ namespace Volo.Abp.TestApp.Testing [Fact] public async Task GetAsync() { - var person = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId); + var person = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); person.Name.ShouldBe("Douglas"); person.Phones.Count.ShouldBe(2); } @@ -31,29 +31,29 @@ namespace Volo.Abp.TestApp.Testing [Fact] public async Task FindAsync_Should_Return_Null_For_Not_Found_Entity() { - var person = await PersonRepository.FindAsync(Guid.NewGuid()); + var person = await PersonRepository.FindAsync(Guid.NewGuid()).ConfigureAwait(false); person.ShouldBeNull(); } [Fact] public async Task DeleteAsync() { - await PersonRepository.DeleteAsync(TestDataBuilder.UserDouglasId); + await PersonRepository.DeleteAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); - (await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId)).ShouldBeNull(); + (await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false)).ShouldBeNull(); } [Fact] public async Task Should_Access_To_Other_Collections_In_Same_Context_In_A_Custom_Method() { - var people = await CityRepository.GetPeopleInTheCityAsync("London"); + var people = await CityRepository.GetPeopleInTheCityAsync("London").ConfigureAwait(false); people.Count.ShouldBeGreaterThan(0); } [Fact] public async Task Custom_Repository_Method() { - var city = await CityRepository.FindByNameAsync("Istanbul"); + var city = await CityRepository.FindByNameAsync("Istanbul").ConfigureAwait(false); city.ShouldNotBeNull(); city.Name.ShouldBe("Istanbul"); } @@ -63,9 +63,9 @@ namespace Volo.Abp.TestApp.Testing { var personId = Guid.NewGuid(); - await PersonRepository.InsertAsync(new Person(personId, "Adam", 42)); + await PersonRepository.InsertAsync(new Person(personId, "Adam", 42)).ConfigureAwait(false); - var person = await PersonRepository.FindAsync(personId); + var person = await PersonRepository.FindAsync(personId).ConfigureAwait(false); person.ShouldNotBeNull(); } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs index f873fe4265..0c3bc5e290 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests_With_Int_Pk.cs @@ -27,7 +27,7 @@ namespace Volo.Abp.TestApp.Testing entity.ShouldNotBeNull(); entity.Name.ShouldBe("Entity1"); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } [Fact] @@ -35,10 +35,10 @@ namespace Volo.Abp.TestApp.Testing { await WithUnitOfWorkAsync(async () => { - var entity = await EntityWithIntPkRepository.GetAsync(1); + var entity = await EntityWithIntPkRepository.GetAsync(1).ConfigureAwait(false); entity.ShouldNotBeNull(); entity.Name.ShouldBe("Entity1"); - }); + }).ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Queryable_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Queryable_Tests.cs index 6078236380..0e7bf2f7df 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Queryable_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Queryable_Tests.cs @@ -27,7 +27,7 @@ namespace Volo.Abp.TestApp.Testing { PersonRepository.Any().ShouldBeTrue(); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } [Fact] @@ -38,7 +38,7 @@ namespace Volo.Abp.TestApp.Testing var person = PersonRepository.Single(p => p.Id == TestDataBuilder.UserDouglasId); person.Name.ShouldBe("Douglas"); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } [Fact] @@ -50,7 +50,7 @@ namespace Volo.Abp.TestApp.Testing person.Name.ShouldBe("Douglas"); person.Phones.Count.ShouldBe(2); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } [Fact] @@ -62,7 +62,7 @@ namespace Volo.Abp.TestApp.Testing person.Name.ShouldBe("Douglas"); person.Phones.Count.ShouldBe(2); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Specifications_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Specifications_Tests.cs index c26134b27c..49880535f2 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Specifications_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Specifications_Tests.cs @@ -28,7 +28,7 @@ namespace Volo.Abp.TestApp.Testing { CityRepository.Count(new CitySpecification().ToExpression()).ShouldBe(1); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Filter_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Filter_Tests.cs index f3ac8c301f..6daba040a4 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Filter_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Filter_Tests.cs @@ -30,7 +30,7 @@ namespace Volo.Abp.TestApp.Testing var person = PersonRepository.FirstOrDefault(p => p.Name == "John-Deleted"); person.ShouldBeNull(); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } [Fact] @@ -38,9 +38,9 @@ namespace Volo.Abp.TestApp.Testing { await WithUnitOfWorkAsync(async () => { - var person = await PersonRepository.FindAsync(TestDataBuilder.UserJohnDeletedId); + var person = await PersonRepository.FindAsync(TestDataBuilder.UserJohnDeletedId).ConfigureAwait(false); person.ShouldBeNull(); - }); + }).ConfigureAwait(false); } [Fact] @@ -52,7 +52,7 @@ namespace Volo.Abp.TestApp.Testing people.Count.ShouldBe(1); people.Any(p => p.Name == "Douglas").ShouldBeTrue(); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } [Fact] @@ -92,7 +92,7 @@ namespace Volo.Abp.TestApp.Testing people.Any(p => p.IsDeleted).ShouldBeFalse(); return Task.CompletedTask; - }); + }).ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Tests.cs index 0059a39a11..e1f4bc56a7 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/SoftDelete_Tests.cs @@ -24,15 +24,15 @@ namespace Volo.Abp.TestApp.Testing [Fact] public async Task Should_Cancel_Deletion_For_Soft_Delete_Entities() { - var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId); - await PersonRepository.DeleteAsync(douglas); + var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); + await PersonRepository.DeleteAsync(douglas).ConfigureAwait(false); - douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); + douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); douglas.ShouldBeNull(); using (DataFilter.Disable()) { - douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); + douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); douglas.ShouldNotBeNull(); douglas.IsDeleted.ShouldBeTrue(); douglas.DeletionTime.ShouldNotBeNull(); @@ -42,18 +42,18 @@ namespace Volo.Abp.TestApp.Testing [Fact] public async Task Should_Handle_Deletion_On_Update_For_Soft_Delete_Entities() { - var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId); + var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); douglas.Age = 42; douglas.IsDeleted = true; - await PersonRepository.UpdateAsync(douglas); + await PersonRepository.UpdateAsync(douglas).ConfigureAwait(false); - douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); + douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); douglas.ShouldBeNull(); using (DataFilter.Disable()) { - douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); + douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId).ConfigureAwait(false); douglas.ShouldNotBeNull(); douglas.IsDeleted.ShouldBeTrue(); douglas.DeletionTime.ShouldNotBeNull(); diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/TestAppTestBase.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/TestAppTestBase.cs index 9f7ef1b34b..7ba21aefb8 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/TestAppTestBase.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/TestAppTestBase.cs @@ -29,9 +29,9 @@ namespace Volo.Abp.TestApp.Testing using (var uow = uowManager.Begin(options)) { - await action(); + await action().ConfigureAwait(false); - await uow.CompleteAsync(); + await uow.CompleteAsync().ConfigureAwait(false); } } } @@ -49,8 +49,8 @@ namespace Volo.Abp.TestApp.Testing using (var uow = uowManager.Begin(options)) { - var result = await func(); - await uow.CompleteAsync(); + var result = await func().ConfigureAwait(false); + await uow.CompleteAsync().ConfigureAwait(false); return result; } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Uow_Completed_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Uow_Completed_Tests.cs index 1b169bbe97..a101e64ea6 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Uow_Completed_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Uow_Completed_Tests.cs @@ -25,15 +25,15 @@ namespace Volo.Abp.TestApp.Testing using (var uow = _unitOfWorkManager.Begin()) { //Perform an arbitrary database operation - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), Guid.NewGuid().ToString())); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), Guid.NewGuid().ToString())).ConfigureAwait(false); uow.OnCompleted(async () => { //Perform another database operation inside the OnCompleted handler - await _cityRepository.InsertAsync(new City(Guid.NewGuid(), Guid.NewGuid().ToString())); + await _cityRepository.InsertAsync(new City(Guid.NewGuid(), Guid.NewGuid().ToString())).ConfigureAwait(false); }); - await uow.CompleteAsync(); + await uow.CompleteAsync().ConfigureAwait(false); } } } diff --git a/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs b/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs index 5fed48c828..45abb1a71e 100644 --- a/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs +++ b/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.UI.Navigation [Fact] public async Task Should_Get_Menu() { - var mainMenu = await _menuManager.GetAsync(StandardMenus.Main); + var mainMenu = await _menuManager.GetAsync(StandardMenus.Main).ConfigureAwait(false); mainMenu.Name.ShouldBe(StandardMenus.Main); mainMenu.DisplayName.ShouldBe("Main Menu"); diff --git a/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Ambient_Scope_Tests.cs b/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Ambient_Scope_Tests.cs index c4b43bebe1..588b4ca947 100644 --- a/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Ambient_Scope_Tests.cs +++ b/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Ambient_Scope_Tests.cs @@ -29,13 +29,13 @@ namespace Volo.Abp.Uow _unitOfWorkManager.Current.ShouldNotBeNull(); _unitOfWorkManager.Current.Id.ShouldBe(uow1.Id); - await uow2.CompleteAsync(); + await uow2.CompleteAsync().ConfigureAwait(false); } _unitOfWorkManager.Current.ShouldNotBeNull(); _unitOfWorkManager.Current.ShouldBe(uow1); - await uow1.CompleteAsync(); + await uow1.CompleteAsync().ConfigureAwait(false); } _unitOfWorkManager.Current.ShouldBeNull(); @@ -55,7 +55,7 @@ namespace Volo.Abp.Uow _unitOfWorkManager.Current.ShouldNotBeNull(); _unitOfWorkManager.Current.Id.ShouldNotBe(uow1.Id); - await uow2.CompleteAsync(); + await uow2.CompleteAsync().ConfigureAwait(false); } _unitOfWorkManager.Current.ShouldBeNull(); @@ -65,7 +65,7 @@ namespace Volo.Abp.Uow _unitOfWorkManager.Current.ShouldNotBeNull(); _unitOfWorkManager.Current.Id.ShouldBe(uow1.Id); - await uow1.CompleteAsync(); + await uow1.CompleteAsync().ConfigureAwait(false); } _unitOfWorkManager.Current.ShouldBeNull(); diff --git a/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs b/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs index 0da84a04a9..3feea1715f 100644 --- a/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs +++ b/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs @@ -26,7 +26,7 @@ namespace Volo.Abp.Uow uow.OnCompleted(async () => completed = true); uow.Disposed += (sender, args) => disposed = true; - await uow.CompleteAsync(); + await uow.CompleteAsync().ConfigureAwait(false); completed.ShouldBeTrue(); } @@ -47,7 +47,7 @@ namespace Volo.Abp.Uow childUow.OnCompleted(async () => completed = true); uow.Disposed += (sender, args) => disposed = true; - await childUow.CompleteAsync(); + await childUow.CompleteAsync().ConfigureAwait(false); completed.ShouldBeFalse(); //Parent has not been completed yet! disposed.ShouldBeFalse(); @@ -56,7 +56,7 @@ namespace Volo.Abp.Uow completed.ShouldBeFalse(); //Parent has not been completed yet! disposed.ShouldBeFalse(); - await uow.CompleteAsync(); + await uow.CompleteAsync().ConfigureAwait(false); completed.ShouldBeTrue(); //It's completed now! disposed.ShouldBeFalse(); //But not disposed yet! @@ -123,11 +123,11 @@ namespace Volo.Abp.Uow uow.Failed += (sender, args) => { failed = true; args.IsRolledback.ShouldBeTrue(); }; uow.Disposed += (sender, args) => disposed = true; - await uow.RollbackAsync(); + await uow.RollbackAsync().ConfigureAwait(false); if (callComplete) { - await uow.CompleteAsync(); + await uow.CompleteAsync().ConfigureAwait(false); } } diff --git a/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Nested_Tests.cs b/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Nested_Tests.cs index e322a25682..e5ef162cea 100644 --- a/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Nested_Tests.cs +++ b/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Nested_Tests.cs @@ -29,13 +29,13 @@ namespace Volo.Abp.Uow _unitOfWorkManager.Current.ShouldNotBeNull(); _unitOfWorkManager.Current.Id.ShouldNotBe(uow1.Id); - await uow2.CompleteAsync(); + await uow2.CompleteAsync().ConfigureAwait(false); } _unitOfWorkManager.Current.ShouldNotBeNull(); _unitOfWorkManager.Current.ShouldBe(uow1); - await uow1.CompleteAsync(); + await uow1.CompleteAsync().ConfigureAwait(false); } _unitOfWorkManager.Current.ShouldBeNull(); diff --git a/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs b/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs index 2028ea60ca..e57913392a 100644 --- a/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs +++ b/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs @@ -30,15 +30,15 @@ namespace Volo.Abp.Validation [Fact] public async Task Should_Work_Proper_With_Right_Inputs() { - var output = await _myAppService.MyMethod(new MyMethodInput { MyStringValue = "test" }); + var output = await _myAppService.MyMethod(new MyMethodInput { MyStringValue = "test" }).ConfigureAwait(false); output.Result.ShouldBe(42); } [Fact] public async Task Should_Not_Work_With_Wrong_Inputs() { - await Assert.ThrowsAsync(async () => await _myAppService.MyMethod(new MyMethodInput())); //MyStringValue is not supplied! - await Assert.ThrowsAsync(async () => await _myAppService.MyMethod(new MyMethodInput { MyStringValue = "a" })); //MyStringValue's min length should be 3! + await Assert.ThrowsAsync(async () => await _myAppService.MyMethod(new MyMethodInput()).ConfigureAwait(false)).ConfigureAwait(false); //MyStringValue is not supplied! + await Assert.ThrowsAsync(async () => await _myAppService.MyMethod(new MyMethodInput { MyStringValue = "a" }).ConfigureAwait(false)).ConfigureAwait(false); //MyStringValue's min length should be 3! } [Fact] @@ -49,7 +49,7 @@ namespace Volo.Abp.Validation MyStringValue2 = "test 1", Input1 = new MyMethodInput { MyStringValue = "test 2" }, DateTimeValue = DateTime.Now - }); + }).ConfigureAwait(false); output.Result.ShouldBe(42); } @@ -62,7 +62,7 @@ namespace Volo.Abp.Validation { MyStringValue2 = "test 1", Input1 = new MyMethodInput() //MyStringValue is not set - })); + }).ConfigureAwait(false)).ConfigureAwait(false); } [Fact] @@ -72,7 +72,7 @@ namespace Volo.Abp.Validation await _myAppService.MyMethod2(new MyMethod2Input //Input1 is not set { MyStringValue2 = "test 1" - })); + }).ConfigureAwait(false)).ConfigureAwait(false); } [Fact] @@ -87,7 +87,7 @@ namespace Volo.Abp.Validation { new MyClassInList {ValueInList = null} } - })); + }).ConfigureAwait(false)).ConfigureAwait(false); } [Fact] @@ -102,27 +102,27 @@ namespace Volo.Abp.Validation { new MyClassInList {ValueInList = null} } - })); + }).ConfigureAwait(false)).ConfigureAwait(false); } [Fact] public async Task Should_Not_Work_If_Array_Is_Null() { await Assert.ThrowsAsync(async () => - await _myAppService.MyMethod4(new MyMethod4Input()) //ArrayItems is null! - ); + await _myAppService.MyMethod4(new MyMethod4Input()) //ArrayItems is null! +.ConfigureAwait(false)).ConfigureAwait(false); } [Fact] public async Task Should_Work_If_Array_Is_Null_But_DisabledValidation_For_Method() { - await _myAppService.MyMethod4_2(new MyMethod4Input()); + await _myAppService.MyMethod4_2(new MyMethod4Input()).ConfigureAwait(false); } [Fact] public async Task Should_Work_If_Array_Is_Null_But_DisabledValidation_For_Property() { - await _myAppService.MyMethod5(new MyMethod5Input()); + await _myAppService.MyMethod5(new MyMethod5Input()).ConfigureAwait(false); } [Fact] @@ -133,8 +133,8 @@ namespace Volo.Abp.Validation await _myAppService.MyMethod6(new MyMethod6Input { MyStringValue = "test value" //MyIntValue has not set! - }); - }); + }).ConfigureAwait(false); + }).ConfigureAwait(false); } //TODO: Create a Volo.Abp.Ddd.Application.Contracts.Tests project and move this to there and remove Volo.Abp.Ddd.Application.Contracts dependency from this project. @@ -146,8 +146,8 @@ namespace Volo.Abp.Validation await _myAppService.MyMethodWithLimitedResult(new LimitedResultRequestDto { MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount + 1 - }); - }); + }).ConfigureAwait(false); + }).ConfigureAwait(false); exception.ValidationErrors.ShouldContain(e => e.MemberNames.Contains(nameof(LimitedResultRequestDto.MaxResultCount))); } @@ -157,20 +157,20 @@ namespace Volo.Abp.Validation { await _myAppService.MyMethodWithLimitedResult(new LimitedResultRequestDto { - MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount -1 - }); + MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount - 1 + }).ConfigureAwait(false); } [Fact] public async Task Should_Stop_Recursive_Validation_In_A_Constant_Depth() { - (await _myAppService.MyMethod8(new MyClassWithRecursiveReference { Value = "42" })).Result.ShouldBe(42); + (await _myAppService.MyMethod8(new MyClassWithRecursiveReference { Value = "42" }).ConfigureAwait(false)).Result.ShouldBe(42); } [Fact] public async Task Should_Allow_Null_For_Nullable_Enums() { - await _myAppService.MyMethodWithNullableEnum(null); + await _myAppService.MyMethodWithNullableEnum(null).ConfigureAwait(false); } [Fact]