Use Includes (Partial Views)
masterIncludes allow you to reuse template components. This feature requires the use of a RazorLight Project system (FileSystem, EmbeddedResources, or Custom) so the engine can locate the partial files.
Syntax within a template:
@{ await IncludeAsync("SomeView.cshtml", Model); }
The first argument is the template key, and the second is the model to pass to the partial (which can be null).
@model MyProject.TestViewModel
<div
Hello @Model.Title
</div>
@{ await IncludeAsync("SomeView.cshtml", Model); }