Как я могу передать значение модели из вида в другой вид при нажатии кнопки ссылки?
CONTROLLER:
public class ViewModel
{
public List<DeliverySchedule> ScheduleList { get; set; }
public DeliverySchedule ScheduleDetail { get; set; }
}
public class DeliverySchedule
{
public int Id { get; set; }
public string split_date { get; set; }
public string split_hour { get; set; }
public string split_qty { get; set; }
public string remarks { get; set; }
}
public ActionResult Delete(int id)
{
var model = new ViewModel();
model.ScheduleDetail = sipContext.OrderDeliverySchedules
.Where(o => o.Id == id).SingleOrDefault();
return View(model);
}
ВИД:
@model Interisland.Areas.v2.Controllers.OrderConfirmationController.ViewModel
@{
var ScheduleList = Model.ScheduleList;
}
<table id="contentTable" class="table table-hover table-bordered table-sm" style="width:100%">
<thead>
<tr class="table-light">
<th style="width:10%">Delivery Date</th>
<th style="width:10%">Hour</th>
<th style="width:10%">Quantity</th>
<th style="width:60%">Remarks</th>
<th style="width:10%"></th>
</tr>
</thead>
<tbody>
@for (int i = 0; i < ScheduleList.Count; i++)
{
<tr>
<td>@ScheduleList[i].split_date</td>
<td>@ScheduleList[i].split_hour</td>
<td>@ScheduleList[i].split_qty</td>
<td>@ScheduleList[i].remarks</td>
<td>
@Url.Action("Edit", "id", new RouteValueDictionary(new { Id = ScheduleList[i].Id }))
</td>
</tr>
}
</tbody>
</table>
Он продолжает выдавать мне эту ошибку:
CS0828: Невозможно назначить группу методов для свойства анонимного типа
Что-то не так с моим кодом?
Заранее большое спасибо за любую помощь