Skip to content

Commit

Permalink
Include the AddClass extension method in the NET461 build only.
Browse files Browse the repository at this point in the history
  • Loading branch information
jooni91 committed May 2, 2022
1 parent 37496ff commit 11a2412
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/ReCaptcha/Extensions/TagHelperOutputExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ internal static string AddQueryString(string uri, IEnumerable<KeyValuePair<strin
return sb.ToString();
}

#if NET461
internal static void AddClass(this TagHelperOutput tagHelperOutput, string classValue, HtmlEncoder htmlEncoder)
{
if (tagHelperOutput == null)
Expand Down Expand Up @@ -135,5 +136,6 @@ private static string ExtractClassValue(TagHelperAttribute classAttribute, HtmlE
var currentClassValue = extractedClassValue ?? string.Empty;
return currentClassValue;
}
#endif
}
}
7 changes: 6 additions & 1 deletion src/ReCaptcha/TagHelpers/RecaptchaInvisibleTagHelper.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
using System;
using System.Text.Encodings.Web;
using Griesoft.AspNetCore.ReCaptcha.Configuration;
using Griesoft.AspNetCore.ReCaptcha.Extensions;
using Griesoft.AspNetCore.ReCaptcha.Localization;
using Microsoft.AspNetCore.Mvc.Razor.TagHelpers;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.Extensions.Options;

#if !NET461
using Microsoft.AspNetCore.Mvc.TagHelpers;
#else
using Griesoft.AspNetCore.ReCaptcha.Extensions;
#endif

namespace Griesoft.AspNetCore.ReCaptcha.TagHelpers
{
/// <summary>
Expand Down
7 changes: 6 additions & 1 deletion src/ReCaptcha/TagHelpers/RecaptchaTagHelper.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
using System;
using System.Text.Encodings.Web;
using Griesoft.AspNetCore.ReCaptcha.Configuration;
using Griesoft.AspNetCore.ReCaptcha.Extensions;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.Extensions.Options;

#if !NET461
using Microsoft.AspNetCore.Mvc.TagHelpers;
#else
using Griesoft.AspNetCore.ReCaptcha.Extensions;
#endif

namespace Griesoft.AspNetCore.ReCaptcha.TagHelpers
{
/// <summary>
Expand Down
7 changes: 6 additions & 1 deletion src/ReCaptcha/TagHelpers/RecaptchaV3TagHelper.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
using System;
using System.Text.Encodings.Web;
using Griesoft.AspNetCore.ReCaptcha.Configuration;
using Griesoft.AspNetCore.ReCaptcha.Extensions;
using Griesoft.AspNetCore.ReCaptcha.Localization;
using Microsoft.AspNetCore.Mvc.Razor.TagHelpers;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.Extensions.Options;

#if !NET461
using Microsoft.AspNetCore.Mvc.TagHelpers;
#else
using Griesoft.AspNetCore.ReCaptcha.Extensions;
#endif

namespace Griesoft.AspNetCore.ReCaptcha.TagHelpers
{
/// <summary>
Expand Down

0 comments on commit 11a2412

Please sign in to comment.