Вот пример:
В вашем "Классе модели":
public class TennisCourt
{
[Key]
public int ID { get; set; }
[Display(Name = "Extérieur ?")]//=Outside in french
[Column("Outside")]
public bool Outside { get; set; }
}
В вашем "Индексе просмотра"
@model IEnumerable<TennisOnline.Models.TennisCourt>
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Gestion des Courts</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table>
<tr>
<th>
Id
</th>
<th>
Outside ?
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.ID)
</td>
<td>
@Html.DisplayFor(modelItem => item.Outside)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
@Html.ActionLink("Details", "Details", new { id=item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id=item.ID })
</td>
</tr>
}
Вот результат: