I have a cshtml view linked to a controller for a model for one table in my database, but I need to do a for each loop that references a second model for a second table. Since setting 2 models at the top of the page is not possible foreach (var row in model) won't work.
what I need is something like this
@model MVCapp.Models.COOKIE
@using MVCapp.Models;
@{
ViewBag.Title = "Update";
;
foreach (var row in IEnumerable<MVCapp.Models.COOKIE_JARS)
{
some code
}
}
Update:
Although that is not allowed because I'm using a type like a variable. So what I am asking is if there is a way to set type:IEnumerable<MVCapp.Models.COOKIE_JARS to a variable or a second model, Or if there is a completely alternative method to achieve this looping through a second database table that I am trying to attempt.
Tuple<Model1,Model2>.Tuple<Model,Model2>method I get the does not contain public definition forGetEnumeratorUsingIEnumerable<Tuple<Model1,Model2>>Does not seem to fix this as well asTuple<IEnumerable<Model>,IEnumerable<Model2>ModeltoModel.Item1in my foreach loop.