Así es como recorro la lista para asignar
var data = query.Select(ticket => new
{
ticket.TicketId,
ticket.TicketFolio,
ticket.TicketAplicant,
ticket.TicketService,
ticket.TicketStatus,
ticket.TicketSubjet,
ticket.TicketEmployee
}).ToList();
var ticketList = new List<object>();
foreach (var ticketIter in data)
{
var queryRecords = TicketDetailsModel.ConsultRecordList(db, ticketIter.TicketId);
var dataRecords = queryRecords.OrderBy(records => records.RecordId).ToList();
ticketList.Add(new
{
ticketIter.TicketId,
ticketIter.TicketFolio,
ticketIter.TicketAplicant,
ticketIter.TicketService,
ticketIter.TicketStatus,
ticketIter.TicketSubjet,
ticketIter.TicketEmployee
});
}
return Json(new DataTablesResponse(requestModel.Draw, ticketList, filteredCount, totalCount));
El atributo TicketStatus
corresponde al estado