diff --git a/docs/docs-langs.json b/docs/docs-langs.json index 23d0b00387..851c67d605 100644 --- a/docs/docs-langs.json +++ b/docs/docs-langs.json @@ -9,11 +9,6 @@ "DisplayName" : "简体中文", "Code" : "zh-Hans", "IsDefault": false - }, - { - "DisplayName" : "Čeština", - "Code" : "cs", - "IsDefault": false } ] } \ No newline at end of file diff --git a/docs/en/Getting-Started-AspNetCore-MVC-Template.md b/docs/en/Getting-Started-AspNetCore-MVC-Template.md index 1e61e96614..cfb401c084 100644 --- a/docs/en/Getting-Started-AspNetCore-MVC-Template.md +++ b/docs/en/Getting-Started-AspNetCore-MVC-Template.md @@ -1,6 +1,6 @@ ## Getting Started With the ASP.NET Core MVC Template -This tutorials explains how to create a new ASP.NET Core MVC web application using the startup template, configure and run it. +These tutorials explain how to create a new ASP.NET Core MVC web application using the startup template, configure and run it. ### Creating a New Project diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Microsoft/AspNetCore/Razor/TagHelpers/AbpTagHelperAttributeListExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Microsoft/AspNetCore/Razor/TagHelpers/AbpTagHelperAttributeListExtensions.cs index 0109ff8f04..168d756c16 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Microsoft/AspNetCore/Razor/TagHelpers/AbpTagHelperAttributeListExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Microsoft/AspNetCore/Razor/TagHelpers/AbpTagHelperAttributeListExtensions.cs @@ -21,7 +21,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Microsoft.AspNetCore.Razor.TagHel } else { - var existingClasses = classAttribute.Value.ToString().Split(new [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + var existingClasses = classAttribute.Value.ToString().Split(new [] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList(); existingClasses.AddIfNotContains(className); attributes.SetAttribute("class", string.Join(" ", existingClasses)); } @@ -40,10 +40,10 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Microsoft.AspNetCore.Razor.TagHel return; } - var existingClassList = classAttribute.Value.ToString().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - var modifiedClassList = existingClassList.RemoveAll(c => c == className); + var classList = classAttribute.Value.ToString().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList(); + classList.RemoveAll(c => c == className); - attributes.SetAttribute("class", modifiedClassList.JoinAsString(" ")); + attributes.SetAttribute("class", classList.JoinAsString(" ")); } public static void AddIfNotContains(this TagHelperAttributeList attributes, string name, object value) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/AbpTagHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/AbpTagHelper.cs index 8dece34943..632bbd3a92 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/AbpTagHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/AbpTagHelper.cs @@ -32,7 +32,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers public override void Process(TagHelperContext context, TagHelperOutput output) { - AsyncHelper.RunSync(() => ProcessAsync(context, output)); + Service.Process(context, output); } public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 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 ee17262d96..673204b302 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 @@ -28,7 +28,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown { var content = await output.GetChildContentAsync(); - var buttonsAsHtml = GetButtonsAsHtml(context, output, content); + var buttonsAsHtml = await GetButtonsAsHtmlAsync(context, output, content); output.PreElement.SetHtmlContent(buttonsAsHtml); @@ -38,17 +38,18 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown output.Attributes.Clear(); } - protected virtual string GetButtonsAsHtml(TagHelperContext context, TagHelperOutput output, TagHelperContent content) + protected virtual async Task GetButtonsAsHtmlAsync(TagHelperContext context, TagHelperOutput output, + TagHelperContent content) { var buttonBuilder = new StringBuilder(""); - var mainButton = GetMainButton(context, output, content); + var mainButton = await GetMainButtonAsync(context, output, content); buttonBuilder.AppendLine(mainButton); if (TagHelper.DropdownStyle == DropdownStyle.Split) { - var splitButton = GetSplitButton(context, output); + var splitButton = await GetSplitButtonAsync(context, output); buttonBuilder.AppendLine(splitButton); } @@ -56,7 +57,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown return buttonBuilder.ToString(); } - protected virtual string GetMainButton(TagHelperContext context, TagHelperOutput output, TagHelperContent content) + protected virtual async Task GetMainButtonAsync(TagHelperContext context, TagHelperOutput output, TagHelperContent content) { var abpButtonTagHelper = _serviceProvider.GetRequiredService(); @@ -67,7 +68,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown abpButtonTagHelper.ButtonType = TagHelper.ButtonType; var attributes = GetAttributesForMainButton(context, output); - var buttonTag = abpButtonTagHelper.ProcessAndGetOutput(attributes, context, "button", TagMode.StartTagAndEndTag); + var buttonTag = await abpButtonTagHelper.ProcessAndGetOutputAsync(attributes, context, "button", TagMode.StartTagAndEndTag); buttonTag.PreContent.SetHtmlContent(content.GetContent()); @@ -80,7 +81,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown return buttonTag.Render(_htmlEncoder); } - protected virtual string GetSplitButton(TagHelperContext context, TagHelperOutput output) + protected virtual async Task GetSplitButtonAsync(TagHelperContext context, TagHelperOutput output) { var abpButtonTagHelper = _serviceProvider.GetRequiredService(); @@ -88,7 +89,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown abpButtonTagHelper.ButtonType = TagHelper.ButtonType; var attributes = GetAttributesForSplitButton(context, output); - return abpButtonTagHelper.Render(attributes, context, _htmlEncoder, "button", TagMode.StartTagAndEndTag); + return await abpButtonTagHelper.RenderAsync(attributes, context, _htmlEncoder, "button", TagMode.StartTagAndEndTag); } 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 ee984474d2..d925fd11e8 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 @@ -8,7 +8,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Extensions { public static class TagHelperExtensions { - public static TagHelperOutput ProcessAndGetOutput(this TagHelper tagHelper, TagHelperAttributeList attributeList, TagHelperContext context, string tagName = "div", TagMode tagMode = TagMode.SelfClosing, bool runAsync = false) + public static async Task ProcessAndGetOutputAsync(this TagHelper tagHelper, TagHelperAttributeList attributeList, TagHelperContext context, string tagName = "div", TagMode tagMode = TagMode.SelfClosing) { var innerOutput = new TagHelperOutput(tagName, attributeList, (useCachedResult, encoder) => Task.Run(() => new DefaultTagHelperContent())) { @@ -19,21 +19,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Extensions tagHelper.Init(context); - if (runAsync) - { - AsyncHelper.RunSync(() => tagHelper.ProcessAsync(innerContext, innerOutput)); - } - else - { - tagHelper.Process(innerContext, innerOutput); - } + await tagHelper.ProcessAsync(innerContext, innerOutput); return innerOutput; } - public static string Render(this TagHelper tagHelper, TagHelperAttributeList attributeList, TagHelperContext context, HtmlEncoder htmlEncoder, string tagName = "div", TagMode tagMode = TagMode.SelfClosing, bool runAsync = false) + public static async Task RenderAsync(this TagHelper tagHelper, TagHelperAttributeList attributeList, TagHelperContext context, HtmlEncoder htmlEncoder, string tagName = "div", TagMode tagMode = TagMode.SelfClosing) { - var innerOutput = tagHelper.ProcessAndGetOutput(attributeList, context, tagName, tagMode, runAsync); + var innerOutput = await tagHelper.ProcessAndGetOutputAsync(attributeList, context, tagName, tagMode); 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 c7b20c6a33..ee2a920980 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 @@ -41,7 +41,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form await ConvertToMvcForm(context, output); - ProcessFields(context, output); + await ProcessFieldsAsync(context, output); SetContent(context, output, list, childContent); @@ -67,7 +67,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form ViewContext = TagHelper.ViewContext }; - var formTagOutput = formTagHelper.ProcessAndGetOutput(output.Attributes, context, "form", TagMode.StartTagAndEndTag); + var formTagOutput = await formTagHelper.ProcessAndGetOutputAsync(output.Attributes, context, "form", TagMode.StartTagAndEndTag); await formTagOutput.GetChildContentAsync(); @@ -114,7 +114,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form return; } - var buttonHtml = ProcessSubmitButtonAndGetContent(context, output); + var buttonHtml = ProcessSubmitButtonAndGetContentAsync(context, output); output.PostContent.SetHtmlContent(output.PostContent.GetContent() + buttonHtml); } @@ -126,7 +126,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form return items; } - protected virtual void ProcessFields(TagHelperContext context, TagHelperOutput output) + protected virtual async Task ProcessFieldsAsync(TagHelperContext context, TagHelperOutput output) { var models = GetModels(context, output); @@ -134,20 +134,20 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form { if (IsSelectGroup(context, model)) { - ProcessSelectGroup(context, output, model); + await ProcessSelectGroupAsync(context, output, model); } else { - ProcessInputGroup(context, output, model); + await ProcessInputGroupAsync(context, output, model); } } } - protected virtual void ProcessSelectGroup(TagHelperContext context, TagHelperOutput output, ModelExpression model) + protected virtual async Task ProcessSelectGroupAsync(TagHelperContext context, TagHelperOutput output, ModelExpression model) { var abpSelectTagHelper = GetSelectGroupTagHelper(context, output, model); - abpSelectTagHelper.Render(new TagHelperAttributeList(), context, _htmlEncoder, "div", TagMode.StartTagAndEndTag); + await abpSelectTagHelper.RenderAsync(new TagHelperAttributeList(), context, _htmlEncoder, "div", TagMode.StartTagAndEndTag); } protected virtual AbpTagHelper GetSelectGroupTagHelper(TagHelperContext context, TagHelperOutput output, ModelExpression model) @@ -178,24 +178,24 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form return abpRadioInputTagHelper; } - protected virtual string ProcessSubmitButtonAndGetContent(TagHelperContext context, TagHelperOutput output) + protected virtual async Task ProcessSubmitButtonAndGetContentAsync(TagHelperContext context, TagHelperOutput output) { var abpButtonTagHelper = _serviceProvider.GetRequiredService(); var attributes = new TagHelperAttributeList { new TagHelperAttribute("type", "submit") }; abpButtonTagHelper.Text = "Submit"; abpButtonTagHelper.ButtonType = AbpButtonType.Primary; - return abpButtonTagHelper.Render(attributes, context, _htmlEncoder, "button", TagMode.StartTagAndEndTag); + return await abpButtonTagHelper.RenderAsync(attributes, context, _htmlEncoder, "button", TagMode.StartTagAndEndTag); } - protected virtual void ProcessInputGroup(TagHelperContext context, TagHelperOutput output, ModelExpression model) + protected virtual async Task ProcessInputGroupAsync(TagHelperContext context, TagHelperOutput output, ModelExpression model) { var abpInputTagHelper = _serviceProvider.GetRequiredService(); abpInputTagHelper.AspFor = model; abpInputTagHelper.ViewContext = TagHelper.ViewContext; abpInputTagHelper.DisplayRequiredSymbol = TagHelper.RequiredSymbols ?? true; - abpInputTagHelper.Render(new TagHelperAttributeList(), context, _htmlEncoder, "div", TagMode.StartTagAndEndTag); + await abpInputTagHelper.RenderAsync(new TagHelperAttributeList(), context, _htmlEncoder, "div", TagMode.StartTagAndEndTag); } 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 dc2f04b623..fb549d3067 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 @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text.Encodings.Web; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.TagHelpers; using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.TagHelpers; @@ -24,16 +25,16 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form _tagHelperLocalizer = tagHelperLocalizer; } - public override void Process(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { - var innerHtml = GetFormInputGroupAsHtml(context, output, out var isCheckbox); + var (innerHtml, isCheckBox) = await GetFormInputGroupAsHtmlAsync(context, output); var order = TagHelper.AspFor.ModelExplorer.GetDisplayOrder(); AddGroupToFormGroupContents( context, TagHelper.AspFor.Name, - SurroundInnerHtmlAndGet(context, output, innerHtml, isCheckbox), + SurroundInnerHtmlAndGet(context, output, innerHtml, isCheckBox), order, out var suppress ); @@ -47,26 +48,26 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form output.TagMode = TagMode.StartTagAndEndTag; output.TagName = "div"; LeaveOnlyGroupAttributes(context, output); - output.Attributes.AddClass(isCheckbox ? "custom-checkbox" : "form-group"); - output.Attributes.AddClass(isCheckbox ? "custom-control" : ""); - output.Attributes.AddClass(isCheckbox ? "mb-2" : ""); + output.Attributes.AddClass(isCheckBox ? "custom-checkbox" : "form-group"); + output.Attributes.AddClass(isCheckBox ? "custom-control" : ""); + output.Attributes.AddClass(isCheckBox ? "mb-2" : ""); output.Content.SetHtmlContent(output.Content.GetContent() + innerHtml); } } - protected virtual string GetFormInputGroupAsHtml(TagHelperContext context, TagHelperOutput output, out bool isCheckbox) + protected virtual async Task<(string, bool)> GetFormInputGroupAsHtmlAsync(TagHelperContext context, TagHelperOutput output) { - var inputTag = GetInputTagHelperOutput(context, output, out isCheckbox); + var (inputTag, isCheckBox) = await GetInputTagHelperOutputAsync(context, output); var inputHtml = inputTag.Render(_encoder); - var label = GetLabelAsHtml(context, output, inputTag, isCheckbox); - var info = GetInfoAsHtml(context, output, inputTag, isCheckbox); - var validation = isCheckbox ? "" : GetValidationAsHtml(context, output, inputTag); + var label = await GetLabelAsHtmlAsync(context, output, inputTag, isCheckBox); + var info = GetInfoAsHtml(context, output, inputTag, isCheckBox); + var validation = isCheckBox ? "" : await GetValidationAsHtmlAsync(context, output, inputTag); - return GetContent(context, output, label, inputHtml, validation, info, isCheckbox); + return (GetContent(context, output, label, inputHtml, validation, info, isCheckBox), isCheckBox); } - protected virtual string GetValidationAsHtml(TagHelperContext context, TagHelperOutput output, TagHelperOutput inputTag) + protected virtual async Task GetValidationAsHtmlAsync(TagHelperContext context, TagHelperOutput output, TagHelperOutput inputTag) { if (IsOutputHidden(inputTag)) { @@ -81,7 +82,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form var attributeList = new TagHelperAttributeList { { "class", "text-danger" } }; - return validationMessageTagHelper.Render(attributeList, context, _encoder, "span", TagMode.StartTagAndEndTag, true); + return await validationMessageTagHelper.RenderAsync(attributeList, context, _encoder, "span", TagMode.StartTagAndEndTag); } protected virtual string GetContent(TagHelperContext context, TagHelperOutput output, string label, string inputHtml, string validation, string infoHtml, bool isCheckbox) @@ -120,22 +121,22 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form }; } - protected virtual TagHelperOutput GetInputTagHelperOutput(TagHelperContext context, TagHelperOutput output, out bool isCheckbox) + protected virtual async Task<(TagHelperOutput, bool)> GetInputTagHelperOutputAsync(TagHelperContext context, TagHelperOutput output) { var tagHelper = GetInputTagHelper(context, output); - var inputTagHelperOutput = tagHelper.ProcessAndGetOutput(GetInputAttributes(context, output), context, "input"); + var inputTagHelperOutput = await tagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "input"); ConvertToTextAreaIfTextArea(inputTagHelperOutput); AddDisabledAttribute(inputTagHelperOutput); AddAutoFocusAttribute(inputTagHelperOutput); - isCheckbox = IsInputCheckbox(context, output, inputTagHelperOutput.Attributes); + var isCheckbox = IsInputCheckbox(context, output, inputTagHelperOutput.Attributes); AddFormControlClass(context, output, isCheckbox, inputTagHelperOutput); AddReadOnlyAttribute(inputTagHelperOutput); AddPlaceholderAttribute(inputTagHelperOutput); AddInfoTextId(inputTagHelperOutput); - return inputTagHelperOutput; + return (inputTagHelperOutput, isCheckbox); } private void AddFormControlClass(TagHelperContext context, TagHelperOutput output, bool isCheckbox, TagHelperOutput inputTagHelperOutput) @@ -217,7 +218,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form return attributes.Any(a => a.Value != null && a.Name == "type" && a.Value.ToString() == "checkbox"); } - protected virtual string GetLabelAsHtml(TagHelperContext context, TagHelperOutput output, TagHelperOutput inputTag, bool isCheckbox) + protected virtual async Task GetLabelAsHtmlAsync(TagHelperContext context, TagHelperOutput output, TagHelperOutput inputTag, bool isCheckbox) { if (IsOutputHidden(inputTag)) { @@ -226,7 +227,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form if (string.IsNullOrEmpty(TagHelper.Label)) { - return GetLabelAsHtmlUsingTagHelper(context, output, isCheckbox) + GetRequiredSymbol(context, output, inputTag); + return await GetLabelAsHtmlUsingTagHelperAsync(context, output, isCheckbox) + GetRequiredSymbol(context, output, inputTag); } var checkboxClass = isCheckbox ? "class=\"custom-control-label\" " : ""; @@ -285,7 +286,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form ""; } - protected virtual string GetLabelAsHtmlUsingTagHelper(TagHelperContext context, TagHelperOutput output, bool isCheckbox) + protected virtual async Task GetLabelAsHtmlUsingTagHelperAsync(TagHelperContext context, TagHelperOutput output, bool isCheckbox) { var labelTagHelper = new LabelTagHelper(_generator) { @@ -300,7 +301,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form attributeList.AddClass("custom-control-label"); } - return labelTagHelper.Render(attributeList, context, _encoder, "label", TagMode.StartTagAndEndTag, true); + return await labelTagHelper.RenderAsync(attributeList, context, _encoder, "label", TagMode.StartTagAndEndTag); } 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 d0b1a494ae..b18bc6ed75 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 @@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Reflection; using System.Text.Encodings.Web; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.TagHelpers; using Microsoft.AspNetCore.Mvc.ViewFeatures; @@ -27,9 +28,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form _tagHelperLocalizer = tagHelperLocalizer; } - public override void Process(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { - var innerHtml = GetFormInputGroupAsHtml(context, output); + var innerHtml = await GetFormInputGroupAsHtmlAsync(context, output); var order = TagHelper.AspFor.ModelExplorer.GetDisplayOrder(); @@ -49,12 +50,12 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form } } - protected virtual string GetFormInputGroupAsHtml(TagHelperContext context, TagHelperOutput output) + protected virtual async Task GetFormInputGroupAsHtmlAsync(TagHelperContext context, TagHelperOutput output) { - var selectTag = GetSelectTag(context, output); + var selectTag = await GetSelectTagAsync(context, output); var selectAsHtml = selectTag.Render(_encoder); - var label = GetLabelAsHtml(context, output, selectTag); - var validation = GetValidationAsHtml(context, output, selectTag); + var label = await GetLabelAsHtmlAsync(context, output, selectTag); + var validation = await GetValidationAsHtmlAsync(context, output, selectTag); var infoText = GetInfoAsHtml(context, output, selectTag); return label + Environment.NewLine + selectAsHtml + Environment.NewLine + infoText + Environment.NewLine + validation; @@ -65,7 +66,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form return "
" + Environment.NewLine + innerHtml + Environment.NewLine + "
"; } - protected virtual TagHelperOutput GetSelectTag(TagHelperContext context, TagHelperOutput output) + protected virtual async Task GetSelectTagAsync(TagHelperContext context, TagHelperOutput output) { var selectTagHelper = new SelectTagHelper(_generator) { @@ -74,7 +75,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form ViewContext = TagHelper.ViewContext }; - var selectTagHelperOutput = selectTagHelper.ProcessAndGetOutput(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag); + var selectTagHelperOutput = await selectTagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag); selectTagHelperOutput.Attributes.AddClass("form-control"); selectTagHelperOutput.Attributes.AddClass(GetSize(context, output)); @@ -115,14 +116,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form throw new Exception("No items provided for select attribute."); } - protected virtual string GetLabelAsHtml(TagHelperContext context, TagHelperOutput output, TagHelperOutput selectTag) + protected virtual async Task GetLabelAsHtmlAsync(TagHelperContext context, TagHelperOutput output, TagHelperOutput selectTag) { if (!string.IsNullOrEmpty(TagHelper.Label)) { return "" + GetRequiredSymbol(context, output); } - return GetLabelAsHtmlUsingTagHelper(context, output) + GetRequiredSymbol(context, output); + return await GetLabelAsHtmlUsingTagHelperAsync(context, output) + GetRequiredSymbol(context, output); } protected virtual string GetRequiredSymbol(TagHelperContext context, TagHelperOutput output) @@ -233,7 +234,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form return selectItems; } - protected virtual string GetLabelAsHtmlUsingTagHelper(TagHelperContext context, TagHelperOutput output) + protected virtual async Task GetLabelAsHtmlUsingTagHelperAsync(TagHelperContext context, TagHelperOutput output) { var labelTagHelper = new LabelTagHelper(_generator) { @@ -241,10 +242,10 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form ViewContext = TagHelper.ViewContext }; - return labelTagHelper.Render(new TagHelperAttributeList(), context, _encoder, "label", TagMode.StartTagAndEndTag, true); + return await labelTagHelper.RenderAsync(new TagHelperAttributeList(), context, _encoder, "label", TagMode.StartTagAndEndTag); } - protected virtual string GetValidationAsHtml(TagHelperContext context, TagHelperOutput output, TagHelperOutput inputTag) + protected virtual async Task GetValidationAsHtmlAsync(TagHelperContext context, TagHelperOutput output, TagHelperOutput inputTag) { var validationMessageTagHelper = new ValidationMessageTagHelper(_generator) { @@ -254,7 +255,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form var attributeList = new TagHelperAttributeList { { "class", "text-danger" } }; - return validationMessageTagHelper.Render(attributeList, context, _encoder, "span", TagMode.StartTagAndEndTag, true); + return await validationMessageTagHelper.RenderAsync(attributeList, context, _encoder, "span", TagMode.StartTagAndEndTag); } protected virtual string GetSize(TagHelperContext context, TagHelperOutput output) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/IAbpTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/IAbpTagHelperService.cs index 6f7e2e7447..654dca9948 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/IAbpTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/IAbpTagHelperService.cs @@ -13,6 +13,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers void Init(TagHelperContext context); + void Process(TagHelperContext context, TagHelperOutput output); + Task ProcessAsync(TagHelperContext context, TagHelperOutput output); } } \ No newline at end of file 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 27ee4ee55b..25307c3fee 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 @@ -1,10 +1,10 @@ using System.Text; using System.Text.Encodings.Web; +using System.Threading.Tasks; using Localization.Resources.AbpUi; using Microsoft.AspNetCore.Mvc.TagHelpers; using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.TagHelpers; -using Microsoft.Extensions.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Microsoft.AspNetCore.Razor.TagHelpers; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Extensions; @@ -23,7 +23,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination _tagHelperLocalizer = tagHelperLocalizer; } - public override void Process(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { if (TagHelper.Model.ShownItemsCount <= 0) { @@ -31,17 +31,17 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination } ProcessMainTag(context, output); - SetContentAsHtml(context, output); + await SetContentAsHtmlAsync(context, output); } - protected virtual void SetContentAsHtml(TagHelperContext context, TagHelperOutput output) + protected virtual async Task SetContentAsHtmlAsync(TagHelperContext context, TagHelperOutput output) { var html = new StringBuilder(""); html.AppendLine(GetOpeningTags(context, output)); - html.AppendLine(GetPreviousButton(context, output)); - html.AppendLine(GetPages(context, output)); - html.AppendLine(GetNextButton(context, output)); + html.AppendLine(await GetPreviousButtonAsync(context, output)); + html.AppendLine(await GetPagesAsync(context, output)); + html.AppendLine(await GetNextButton(context, output)); html.AppendLine(GetClosingTags(context, output)); output.Content.SetHtmlContent(html.ToString()); @@ -55,19 +55,19 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination output.Attributes.AddClass("mt-3"); } - protected virtual string GetPages(TagHelperContext context, TagHelperOutput output) + protected virtual async Task GetPagesAsync(TagHelperContext context, TagHelperOutput output) { var pagesHtml = new StringBuilder(""); foreach (var page in TagHelper.Model.Pages) { - pagesHtml.AppendLine(GetPage(context, output, page)); + pagesHtml.AppendLine(await GetPageAsync(context, output, page)); } return pagesHtml.ToString(); } - protected virtual string GetPage(TagHelperContext context, TagHelperOutput output, PageItem page) + protected virtual async Task GetPageAsync(TagHelperContext context, TagHelperOutput output, PageItem page) { var pageHtml = new StringBuilder(""); @@ -86,7 +86,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination } else { - pageHtml.AppendLine(RenderAnchorTagHelperLinkHtml(context, output, page.Index.ToString(), page.Index.ToString())); + pageHtml.AppendLine(await RenderAnchorTagHelperLinkHtmlAsync(context, output, page.Index.ToString(), page.Index.ToString())); } pageHtml.AppendLine(""); @@ -94,7 +94,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination return pageHtml.ToString(); } - protected virtual string GetPreviousButton(TagHelperContext context, TagHelperOutput output) + protected virtual async Task GetPreviousButtonAsync(TagHelperContext context, TagHelperOutput output) { var localizationKey = "PagerPrevious"; var currentPage = TagHelper.Model.CurrentPage == 1 @@ -102,27 +102,26 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination : (TagHelper.Model.CurrentPage - 1).ToString(); return "
  • \r\n" + - RenderAnchorTagHelperLinkHtml(context, output, currentPage, localizationKey) + - "
  • "; + (await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey)) + " "; } - protected virtual string GetNextButton(TagHelperContext context, TagHelperOutput output) + protected virtual async Task GetNextButton(TagHelperContext context, TagHelperOutput output) { var localizationKey = "PagerNext"; var currentPage = (TagHelper.Model.CurrentPage + 1).ToString(); return "
  • = TagHelper.Model.TotalPageCount ? "disabled" : "") + "\">\r\n" + - RenderAnchorTagHelperLinkHtml(context, output, currentPage, localizationKey) + + (await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey)) + "
  • "; } - protected virtual string RenderAnchorTagHelperLinkHtml(TagHelperContext context, TagHelperOutput output, string currentPage, string localizationKey) + protected virtual async Task RenderAnchorTagHelperLinkHtmlAsync(TagHelperContext context, TagHelperOutput output, string currentPage, string localizationKey) { var localizer = _tagHelperLocalizer.GetLocalizer(typeof(AbpUiResource)); var anchorTagHelper = GetAnchorTagHelper(currentPage, out var attributeList); - var tagHelperOutput = anchorTagHelper.ProcessAndGetOutput(attributeList, context, "a", TagMode.StartTagAndEndTag); + var tagHelperOutput = await anchorTagHelper.ProcessAndGetOutputAsync(attributeList, context, "a", TagMode.StartTagAndEndTag); tagHelperOutput.Content.SetHtmlContent(localizer[localizationKey]); 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 fca0a8dd8e..d314d31799 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs @@ -147,7 +147,6 @@ namespace Volo.Abp.Auditing private readonly AuditingManager _auditingManager; private readonly IDisposable _scope; - private bool _saved; public DisposableSaveHandle( AuditingManager auditingManager, @@ -163,23 +162,16 @@ namespace Volo.Abp.Auditing public async Task SaveAsync() { - _saved = true; await _auditingManager.SaveAsync(this); } public void Save() { - _saved = true; _auditingManager.Save(this); } public void Dispose() { - if (!_saved) - { - Save(); - } - _scope.Dispose(); } } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingStoreExtensions.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingStoreExtensions.cs deleted file mode 100644 index f08dcc14b6..0000000000 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingStoreExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Volo.Abp.Threading; - -namespace Volo.Abp.Auditing -{ - public static class AuditingStoreExtensions - { - public static void Save(this IAuditingStore auditingStore, AuditLogInfo auditInfo) - { - AsyncHelper.RunSync(() => auditingStore.SaveAsync(auditInfo)); - } - } -} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs index 7166af642b..101ec8b03e 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs @@ -4,6 +4,8 @@ namespace Volo.Abp.Auditing { public interface IAuditingStore { + void Save(AuditLogInfo auditInfo); + Task SaveAsync(AuditLogInfo auditInfo); } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/SimpleLogAuditingStore.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/SimpleLogAuditingStore.cs index 4c0450d565..8067ede5c5 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/SimpleLogAuditingStore.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/SimpleLogAuditingStore.cs @@ -15,10 +15,14 @@ namespace Volo.Abp.Auditing Logger = NullLogger.Instance; } - public Task SaveAsync(AuditLogInfo auditInfo) + public void Save(AuditLogInfo auditInfo) { Logger.LogInformation(auditInfo.ToString()); + } + public Task SaveAsync(AuditLogInfo auditInfo) + { + Save(auditInfo); return Task.FromResult(0); } } diff --git a/framework/src/Volo.Abp.Core/System/Collections/Generic/AbpCollectionExtensions.cs b/framework/src/Volo.Abp.Core/System/Collections/Generic/AbpCollectionExtensions.cs index 0d5e4260f6..2a858f7626 100644 --- a/framework/src/Volo.Abp.Core/System/Collections/Generic/AbpCollectionExtensions.cs +++ b/framework/src/Volo.Abp.Core/System/Collections/Generic/AbpCollectionExtensions.cs @@ -88,7 +88,7 @@ namespace System.Collections.Generic } /// - /// Removed all items from the collection those satisfy the given . + /// Removes all items from the collection those satisfy the given . /// /// Type of the items in the collection /// The collection diff --git a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AbpAccountApplicationModule.cs b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AbpAccountApplicationModule.cs index 2322fce4e0..8fecc2d4e0 100644 --- a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AbpAccountApplicationModule.cs +++ b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AbpAccountApplicationModule.cs @@ -1,7 +1,7 @@ using Volo.Abp.Emailing; using Volo.Abp.Identity; using Volo.Abp.Modularity; -using Volo.Abp.Ui.Navigation.Urls; +using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditingStore.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditingStore.cs index ecb07300f0..7bbd51af12 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditingStore.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditingStore.cs @@ -33,15 +33,33 @@ namespace Volo.Abp.AuditLogging Logger = NullLogger.Instance; } - private async Task SaveLogAsync(AuditLogInfo auditInfo) + public void Save(AuditLogInfo auditInfo) { - using (var uow = _unitOfWorkManager.Begin(requiresNew: true)) + if (!Options.HideErrors) { - var auditLog = new AuditLog(_guidGenerator, auditInfo); - await _auditLogRepository.InsertAsync(auditLog); - await uow.SaveChangesAsync(); + SaveLog(auditInfo); + return; + } + + try + { + SaveLog(auditInfo); + } + catch (Exception ex) + { + Logger.LogException(ex, LogLevel.Error); } } + + protected virtual void SaveLog(AuditLogInfo auditInfo) + { + using (var uow = _unitOfWorkManager.Begin(true)) + { + _auditLogRepository.Insert(new AuditLog(_guidGenerator, auditInfo)); + uow.SaveChanges(); + } + } + public async Task SaveAsync(AuditLogInfo auditInfo) { if (!Options.HideErrors) @@ -59,5 +77,14 @@ namespace Volo.Abp.AuditLogging Logger.LogException(ex, LogLevel.Error); } } + + protected virtual async Task SaveLogAsync(AuditLogInfo auditInfo) + { + using (var uow = _unitOfWorkManager.Begin(true)) + { + await _auditLogRepository.InsertAsync(new AuditLog(_guidGenerator, auditInfo)); + await uow.SaveChangesAsync(); + } + } } } diff --git a/templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs index 65fe03d677..bde2d913bd 100644 --- a/templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs +++ b/templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs @@ -30,7 +30,7 @@ using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement.EntityFrameworkCore; using Volo.Abp.Threading; -using Volo.Abp.Ui.Navigation.Urls; +using Volo.Abp.UI.Navigation.Urls; namespace MyCompanyName.MyProjectName { diff --git a/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs b/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs index 544e0e3bf5..30e9c6aa91 100644 --- a/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs +++ b/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs @@ -32,7 +32,7 @@ using Volo.Abp.PermissionManagement.Web; using Volo.Abp.Security.Claims; using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement.Web; -using Volo.Abp.Ui.Navigation.Urls; +using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.UI; using Volo.Abp.VirtualFileSystem; diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index 730b8f097f..aaaa808b72 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -48,10 +48,10 @@ namespace MyCompanyName.MyProjectName { Configure(options => { - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain.Shared", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Application.Contracts", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Application", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Application")); }); } } diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs index 285b10aa54..62a2403773 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs @@ -19,7 +19,7 @@ using Volo.Abp.Autofac; using Volo.Abp.BackgroundJobs; using Volo.Abp.Localization; using Volo.Abp.Modularity; -using Volo.Abp.Ui.Navigation.Urls; +using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.UI; using Volo.Abp.VirtualFileSystem; @@ -63,8 +63,8 @@ namespace MyCompanyName.MyProjectName { Configure(options => { - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain.Shared", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain")); // options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.UI", Path.DirectorySeparatorChar))); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI", Path.DirectorySeparatorChar))); diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs index 540d3ffeeb..bbd3568405 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs @@ -29,7 +29,7 @@ using Volo.Abp.Modularity; using Volo.Abp.MultiTenancy; using Volo.Abp.PermissionManagement.Web; using Volo.Abp.TenantManagement.Web; -using Volo.Abp.Ui.Navigation.Urls; +using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.UI; using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; @@ -154,8 +154,8 @@ namespace MyCompanyName.MyProjectName.Web options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}modules{0}permission-management{0}src{0}Volo.Abp.PermissionManagement.Web", Path.DirectorySeparatorChar))); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}modules{0}identity{0}src{0}Volo.Abp.Identity.Web", Path.DirectorySeparatorChar))); // - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Application.Contracts", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Application.Contracts")); options.FileSets.ReplaceEmbeddedByPhysical(hostingEnvironment.ContentRootPath); }); } diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs index 77da95f24a..267d7d8d83 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs @@ -25,7 +25,7 @@ using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement.Web; using Volo.Abp.TenantManagement.Web; -using Volo.Abp.Ui.Navigation.Urls; +using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.UI; using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; @@ -123,10 +123,10 @@ namespace MyCompanyName.MyProjectName.Web options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}modules{0}identity{0}src{0}Volo.Abp.Identity.Web", Path.DirectorySeparatorChar))); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}modules{0}account{0}src{0}Volo.Abp.Account.Web", Path.DirectorySeparatorChar))); // - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain.Shared", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Application.Contracts", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Application", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Application")); options.FileSets.ReplaceEmbeddedByPhysical(hostingEnvironment.ContentRootPath); }); }