DamianEdwards / RazorSlices

Lightweight Razor-based templates for ASP.NET Core without MVC, Razor Pages, or Blazor.
MIT License
297 stars 12 forks source link

Support rendering slices from other slices #6

Closed DamianEdwards closed 1 year ago

DamianEdwards commented 1 year ago

Like partials in MVC.

Something like:

@inherits RazorSlice<List<Todo>>

<div>Some HTML here in this slice</div>
@Partial("/slices/_welcome.cshtml")

<table>
<tbody>
@foreach (var todo in Model) {
    @Partial("/slices/_todoRow.cshtml", todo)
}
</tbody>
</table>