|
|
|
@inherits Microsoft.Extensions.CodeGeneration.Templating.RazorTemplateBase
|
|
|
|
@using Microsoft.Extensions.CodeGeneration.EntityFramework
|
|
|
|
@@model @Model.ViewDataTypeName
|
|
|
|
|
|
|
|
@{
|
|
|
|
if (Model.IsPartialView)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else if (Model.IsLayoutPageSelected)
|
|
|
|
{
|
|
|
|
@:@@{
|
|
|
|
@:ViewData["Title"] = @@Model.ViewName"];
|
|
|
|
if (!string.IsNullOrEmpty(Model.LayoutPageFile))
|
|
|
|
{
|
|
|
|
@:Layout = "@Model.LayoutPageFile";
|
|
|
|
}
|
|
|
|
@:}
|
|
|
|
@:
|
|
|
|
@:<h2>@@Model.ViewName"]</h2>
|
|
|
|
@:
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
@:@@{
|
|
|
|
@:Layout = "null";
|
|
|
|
@:}
|
|
|
|
@:
|
|
|
|
@:<!DOCTYPE html>
|
|
|
|
@:
|
|
|
|
@:<html>
|
|
|
|
@:<head>
|
|
|
|
@:<meta name="viewport" content="width=device-width" />
|
|
|
|
@:<title>@@@Model.ViewName</title>
|
|
|
|
@:</head>
|
|
|
|
@:<body>
|
|
|
|
@:
|
|
|
|
// PushIndent(" ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<h3>@AreYourSureYouWantToDeleteThis</h3>
|
|
|
|
<div>
|
|
|
|
<h4>@@@Model.ViewDataTypeShortName</h4>
|
|
|
|
<hr />
|
|
|
|
<dl class="dl-horizontal">
|
|
|
|
@{
|
|
|
|
foreach (var property in Model.ModelMetadata.Properties)
|
|
|
|
{
|
|
|
|
if (property.Scaffold && !property.IsPrimaryKey && !property.IsForeignKey)
|
|
|
|
{
|
|
|
|
<dt>
|
|
|
|
@@Html.DisplayNameFor(model => model.@GetValueExpression(property))
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
@@Html.DisplayFor(model => model.@GetValueExpression(property))
|
|
|
|
</dd>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@:</dl>
|
|
|
|
@:
|
|
|
|
@:<form asp-action="@Model.ViewName">
|
|
|
|
@:<div class="form-actions no-color">
|
|
|
|
@:<input type="submit" value="@Delete" class="btn btn-default" /> |
|
|
|
|
@:<a asp-action="Index">Back to List</a>
|
|
|
|
@:</div>
|
|
|
|
@:</form>
|
|
|
|
@:</div>
|
|
|
|
if (!Model.IsPartialView && !Model.IsLayoutPageSelected)
|
|
|
|
{
|
|
|
|
//ClearIndent();
|
|
|
|
@:</body>
|
|
|
|
@:</html>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@functions
|
|
|
|
{
|
|
|
|
string GetValueExpression(PropertyMetadata property)
|
|
|
|
{
|
|
|
|
//Todo: Get the association for the property and use that.
|
|
|
|
return property.PropertyName;
|
|
|
|
}
|
|
|
|
}
|