From 76e2cbe499a88970a1318ba6bf54ca808dba3f21 Mon Sep 17 00:00:00 2001 From: Krzysztof Jeske Date: Sun, 20 Oct 2024 23:10:27 +0200 Subject: [PATCH] Add Html.Template --- src/HtmlTemplate.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/HtmlTemplate.cs b/src/HtmlTemplate.cs index 3b61829..2559222 100644 --- a/src/HtmlTemplate.cs +++ b/src/HtmlTemplate.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Html; +using Microsoft.AspNetCore.Mvc.Rendering; namespace Hydro; @@ -19,4 +20,11 @@ public static class HtmlTemplateExtensions /// Html content public static IHtmlContent Render(this HtmlTemplate htmlTemplate) => htmlTemplate(null); + + /// + /// Prepares template to be rendered + /// + /// Html helper + /// Html template followed by @ sign + public static IHtmlContent Template(this IHtmlHelper htmlHelper, Func content) => content(null); }