Skip to content

Commit

Permalink
Add Html.Template
Browse files Browse the repository at this point in the history
  • Loading branch information
kjeske committed Oct 20, 2024
1 parent 4f2f071 commit 76e2cbe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/HtmlTemplate.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;

namespace Hydro;

Expand All @@ -19,4 +20,11 @@ public static class HtmlTemplateExtensions
/// <returns>Html content</returns>
public static IHtmlContent Render(this HtmlTemplate htmlTemplate) =>
htmlTemplate(null);

/// <summary>
/// Prepares template to be rendered
/// </summary>
/// <param name="htmlHelper">Html helper</param>
/// <param name="content">Html template followed by @ sign</param>
public static IHtmlContent Template(this IHtmlHelper htmlHelper, Func<object, IHtmlContent> content) => content(null);
}

0 comments on commit 76e2cbe

Please sign in to comment.