From 41ea2d625ec354dab4462735242b7a96f204e117 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 18 Feb 2019 15:36:47 +0300 Subject: [PATCH] Create TagHelperAttributeExtensions.cs --- .../TagHelperAttributeExtensions.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperAttributeExtensions.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperAttributeExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperAttributeExtensions.cs new file mode 100644 index 0000000000..ef581529a6 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Extensions/TagHelperAttributeExtensions.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Razor.TagHelpers; +using System.Collections.Generic; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Extensions +{ + public static class TagHelperAttributeExtensions + { + public static string ToHtmlAttributeAsString(this TagHelperAttribute attribute) + { + return attribute.Name + "=\"" + attribute.Value + "\""; + } + + public static string ToHtmlAttributesAsString(this List attributes) + { + var attributesAsString = ""; + + foreach (var attribute in attributes) + { + attributesAsString += attribute.ToHtmlAttributeAsString() + " "; + } + + return attributesAsString; + } + } +}