使用这个类:
public class Account{
.....
public Iesi.Collections.Generic.ISet<PaymentSchedule> PaymentSchedules { get; private set; }
.....
}
在这个剃刀视图中(剃刀 1.0,在 MVC3 中):
@model AccountSummaryViewModel
@{
Layout = "~/Views/Shared/SiteLayout.cshtml";
}
<h2>@Model.Child.Name's Account Summary</h2>
//code ommited
@foreach(var schedule in Model.Child.Account.PaymentSchedules) {
<tbody>
<tr>
<td>@schedule.NextRun.ToShortDateString()</td>
<td>@schedule.Interval</td>
<td>@schedule.Description</td>
<td class="money">@schedule.Amount.ToString("c")</td>
@if(Model.IsParentView) {
<td>@Html.ActionLink("Delete", "RemoveSchedule", "Schedule", new { id = Model.Child.Id, scheduleId = schedule.Id }, new { @class = "warning" })</td>
}else{
<td> </td>
}
</tr>
</tbody>
给我以下错误:
错误 1 foreach 语句无法对“Iesi.Collections.Generic.ISet”类型的变量进行操作,因为“Iesi.Collections.Generic.ISet”不包含“GetEnumerator”e:\Interviu\Suteki.TardisBank\Suteki 的公共定义。 TardisBank\Views\Account\Summary.cshtml 25 6 Suteki.TardisBank
在 View 文件夹内的 web.config 中,我添加了 Iesi 命名空间,但这无济于事。接下来我能做什么?