@inherits Microsoft.Extensions.CodeGeneration.Templating.RazorTemplateBase
@using Microsoft.Extensions.CodeGeneration.EntityFramework
@@model @Model.ViewDataTypeName
@{
if (Model.IsPartialView)
{
}
else if (Model.IsLayoutPageSelected)
{
@:@@{
@:ViewData["Title"] = @@SR["@Model.ViewName"];
if (!string.IsNullOrEmpty(Model.LayoutPageFile))
{
@:Layout = "@Model.LayoutPageFile";
}
@:}
@:
@:
@@SR["@Model.ViewName"]
@:
}
else
{
@:@@{
@:Layout = null;
@:}
@:
@:
@:
@:
@:
@:
@:@Model.ViewName
@:
@:
@:
// PushIndent(" ");
}
@:
@{
if (Model.ReferenceScriptLibraries && (Model.IsLayoutPageSelected || Model.IsPartialView))
{
@:@@section Scripts {
@:
@:
@:
@:}
}
// The following code closes the tag used in the case of a view using a layout page and the body and html tags in the case of a regular view page
if (!Model.IsPartialView && !Model.IsLayoutPageSelected)
{
if (Model.ReferenceScriptLibraries)
{
@:@@section Scripts {
@:
@:
@:
@:}
//ClearIndent();
}
@:
@:
}
}
@functions
{
// Do we need to use this in conjunction with the PrimaryKey check?
bool IsPropertyGuid(PropertyMetadata property)
{
return string.Equals("System.Guid", property.TypeName, StringComparison.OrdinalIgnoreCase);
}
}