@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";
        }
@:}
@:
@:<h2>@@SR["@Model.ViewName"]</h2>
@:
    }
    else
    {
@:@@{
    @:Layout = null;
@:}
@:
@:<!DOCTYPE html>
@:
@:<html>
@:<head>
    @:<meta name="viewport" content="width=device-width" />
    @:<title>@@SR[@Model.ViewName]</title>
@:</head>
@:<body>
@:
        //    PushIndent("    ");
    }
}
<h3>@@SR["AreYourSureYouWantToDeleteThis"]</h3>
<div>
    <h4>@@SR[@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="@@SR["Delete"]" class="btn btn-default" /> |
            @:<a asp-action="Index">@@SR["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;
    }
}