我有一个视图模型类,它有一个名为 Title 的属性,我想在 Razor 的索引视图上呈现它
班级
public class vmAppointment
{
public Appointment Appointment { get; private set; }
public IEnumerable<SelectListItem> EmployeeList { get; set; }
public string Title { get; set; }
}
索引视图
@model IEnumerable<JJ.ViewModels.vmAppointment>
<h2>@Model.Title</h2> WRONG! how can i reference my property here?
如何在视图中呈现属性值?