From 9e3ac88924790100e647b6094bb6d5d7959b54ad Mon Sep 17 00:00:00 2001 From: yekalkan Date: Thu, 3 May 2018 10:50:13 +0300 Subject: [PATCH] Removed redundant type checks in tag helpers --- .../Form/AbpDynamicformTagHelperService.cs | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs index ab210740e4..102f987a35 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs @@ -43,7 +43,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form ProcessFields(context, output); - SetContent(output, list, childContent); + SetContent(context, output, list, childContent); SetFormAttributes(context, output); @@ -86,7 +86,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form output.Attributes.AddIfNotContains("method", "post"); } - protected virtual void SetContent(TagHelperOutput output, List items, string childContent) + protected virtual void SetContent(TagHelperContext context, TagHelperOutput output, List items, string childContent) { var contentBuilder = new StringBuilder(""); @@ -230,24 +230,12 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form return type.IsPrimitive || type.IsValueType || + type == typeof(string) || + type == typeof(Guid) || type == typeof(DateTime) || type == typeof(ValueType) || - type == typeof(String) || - type == typeof(Decimal) || - type == typeof(Double) || - type == typeof(Guid) || - type == typeof(Char) || - type == typeof(Byte) || - type == typeof(Boolean) || type == typeof(TimeSpan) || type == typeof(DateTimeOffset) || - type == typeof(Int16) || - type == typeof(Int32) || - type == typeof(Int64) || - type == typeof(ushort) || - type == typeof(uint) || - type == typeof(ulong) || - type == typeof(float) || type.IsEnum; }