Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Commit

Permalink
Add placeholder DefineSection method.
Browse files Browse the repository at this point in the history
- This enables 2.0.0 code generation to not error.

aspnet/Razor#1254
  • Loading branch information
NTaylorMullen committed Apr 26, 2017
1 parent d2c9df7 commit 490f94d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Microsoft.AspNetCore.Mvc.Razor/RazorPageBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,17 @@ public virtual string Href(string contentPath)
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>
Expand Down

0 comments on commit 490f94d

Please sign in to comment.