anonymous problem in linq query
- by ognjenb
var query2 = from i in proba.id_person
select i.id;
foreach (var k in query2)
{
var upit = from l in proba.name
join f in proba1.last_name on l.id equals f.id
where l.id == k
select new { l.ime, f.prezime };
foreach (var g in upit) {
model.Add(new ViewModel
{
Name = g.ime,
last_name = g.prezime,
id_person = k
});
}
}
return View(model);
Why I have this error: The specified LINQ expression contains references to queries that are associated with different contexts.