Add placeholder `DefineSection` method.

- This enables 2.0.0 code generation to not error.

aspnet/Razor#1254
This commit is contained in:
N. Taylor Mullen 2017-04-26 12:51:52 -07:00
parent d2c9df7d2e
commit 490f94d425
1 changed files with 11 additions and 0 deletions

View File

@ -292,6 +292,17 @@ namespace Microsoft.AspNetCore.Mvc.Razor
return _urlHelper.Content(contentPath);
}
/// <summary>
/// Creates a named content section in the page that can be invoked in a Layout page using
/// <c>RenderSection</c> or <c>RenderSectionAsync</c>
/// </summary>
/// <param name="name">The name of the section to create.</param>
/// <param name="section">The delegate to execute when rendering the section.</param>
/// <remarks>This is a temporary placeholder method to support ASP.NET Core 2.0.0 editor code generation.</remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
protected void DefineSection(string name, Func<object, Task> section)
=> DefineSection(name, () => section(null /* writer */));
/// <summary>
/// Creates a named content section in the page that can be invoked in a Layout page using
/// <c>RenderSection</c> or <c>RenderSectionAsync</c>