From 490f94d42553545f9cb980b8a018d141f897834c Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 26 Apr 2017 12:51:52 -0700 Subject: [PATCH] Add placeholder `DefineSection` method. - This enables 2.0.0 code generation to not error. aspnet/Razor#1254 --- src/Microsoft.AspNetCore.Mvc.Razor/RazorPageBase.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/RazorPageBase.cs b/src/Microsoft.AspNetCore.Mvc.Razor/RazorPageBase.cs index ea56d8302e..a646a962de 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/RazorPageBase.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/RazorPageBase.cs @@ -292,6 +292,17 @@ namespace Microsoft.AspNetCore.Mvc.Razor return _urlHelper.Content(contentPath); } + /// + /// Creates a named content section in the page that can be invoked in a Layout page using + /// RenderSection or RenderSectionAsync + /// + /// The name of the section to create. + /// The delegate to execute when rendering the section. + /// This is a temporary placeholder method to support ASP.NET Core 2.0.0 editor code generation. + [EditorBrowsable(EditorBrowsableState.Never)] + protected void DefineSection(string name, Func section) + => DefineSection(name, () => section(null /* writer */)); + /// /// Creates a named content section in the page that can be invoked in a Layout page using /// RenderSection or RenderSectionAsync