Here is a working mock of what you are trying to do:
1. Model
using System.Collections.Generic;
namespace MvcQueue.Models
{
public class DataModel
{
public Queue<List<string>> Data { get; set; }
= new Queue<List<string>>();
}
}
2. Controller:
using MvcQueue.Models;
using System.Collections.Generic;
using System.Web.Mvc;
namespace MvcQueue.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
var results = new DataModel();
for (int i = 0; i < 10; i++)
{
results.Data.Enqueue(new List<string>() { "aaa", "bbb", "ccc" });
}
return View(results.Data);
}
}
}
3. View:
@{
ViewBag.Title = "Queue Data Test";
}
<div>
@foreach (var item in Model)
{
<p> data:
@string.Join(", ", item);
</p>
}
</div>
If you need to declare the
Model
in the view:
@Model = IEnumerable<List<string>>;