Your problem is here:
DeleteActionURL = @Url.Action("DeleteFaultType","Administration", /*...*/),
EditActionURL = @Url.Action("EditFaultType", "Administration", /*...*/)
LINQ tries to create expression tree, which would be mapped to SQL code, but it doesn't know how to map Url.Action
. One way to fix this would be change Linq to Entities to Linq to Objects, which can be done using ToList()
method on your entity:
ListItems = _context.FaultTypes.ToList().Select(i => ...)