Add placeholder `DefineSection` method.
- This enables 2.0.0 code generation to not error. aspnet/Razor#1254
This commit is contained in:
parent
d2c9df7d2e
commit
490f94d425
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue