Se um model tem uma chave para um objeto relacionado (FK) o Scaffolding coloca essa coluna em primeiro lugar, no topo dos formulários ou na primeira coluna de tabelas.
Para facilitar coloco aqui o código template que gera uma view de Delete
<#@ template language="C#" HostSpecific="True" #>
<#@ output extension=".cshtml" #>
<#@ include file="Imports.include.t4" #>
@model <#= ViewDataTypeName #>
<#
// The following chained if-statement outputs the file header code and markup for a partial view, a view using a layout page, or a regular view.
if(IsPartialView) {
#>
<#
} else if(IsLayoutPageSelected) {
#>
@{
ViewBag.Title = "<#= ViewDataTypeShortName #>";
<#
if (!String.IsNullOrEmpty(LayoutPageFile)) {
#>
Layout = "<#= LayoutPageFile#>";
<#
}
#>
}
<h2>Detalhe</h2>
<#
} else {
#>
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title><#= ViewName #></title>
</head>
<body>
<#
PushIndent(" ");
}
#>
<div>
<h4><#= ViewDataTypeShortName #></h4>
<hr />
<dl class="dl-horizontal">
<#
foreach (PropertyMetadata property in ModelMetadata.Properties) {
if (property.Scaffold && !property.IsPrimaryKey && !property.IsForeignKey) {
#>
<#
// We do not want to show any association properties for which there is
// no associated foreign key.
if (property.IsAssociation && GetRelatedModelMetadata(property) == null) {
continue;
}
#>
<dt>
@Html.DisplayNameFor(model => model.<#= GetValueExpression(property) #>)
</dt>
<dd>
@Html.DisplayFor(model => model.<#= GetValueExpression(property) #>)
</dd>
<#
}
}
#>
</dl>
</div>
<p>
<#
string pkName = GetPrimaryKeyName();
if (pkName != null) {
#>
@Html.ActionLink("Alterar", "Edit", new { id = Model.<#= pkName #> }) |
@Html.ActionLink("Voltar a lista", "Index")
<#
} else {
#>
@Html.ActionLink("Alterar", "Edit", new { /* id = Model.PrimaryKey */ }) |
@Html.ActionLink("Voltar a lista", "Index")
<#
}
#>
</p>
<#
// 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(!IsPartialView && !IsLayoutPageSelected) {
ClearIndent();
#>
</body>
</html>
<#
}
#>
<#@ include file="ModelMetadataFunctions.cs.include.t4" #>