@using System.Data
@model DataTable
@foreach (var row in Model.Rows)
{
@row[] // how do you cast this to a object?
}
Run Code Online (Sandbox Code Playgroud)
如何使用Razor语法将@row转换为对象?
考虑到最后一个是我想要的,我在Select上得到一个错误:
AwardsListViewModel viewModel = AwardListViewModel
{
menuChild = repository
.menuChild
.Where(p => p.MenuParentAcronym == "Awards Processing"
&& p.IsActive == "True")
.OrderBy(c => c.DisplayOrder)
.Select(m => m.Description == "Awards Processing List")
};
Run Code Online (Sandbox Code Playgroud)
错误是:不能将类型转换System.Linq.IQueryable<bool>为System.Collections.Generic.IEnumerable<AwardsSystem30.Domain.Entities.MenuChild>.存在显式转换(您是否错过了演员?)
我该如何施展?