在下面的代码中,MVC4 如何知道变量“foo”的类型是 IEnumerable
@model IEnumerable<Xrm.Contact>
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Index</h2>
@foreach (var c in Model) {
<div>
<span> @Html.DisplayFor(foo => c.FirstName) </span>
<span> @Html.DisplayFor(foo => c.LastName) </span>
</div>
}