anonymous problem in linq query
Posted
by ognjenb
on Stack Overflow
See other posts from Stack Overflow
or by ognjenb
Published on 2010-04-27T09:28:28Z
Indexed on
2010/04/27
9:33 UTC
Read the original article
Hit count: 521
asp.net-mvc
|LINQ
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.
© Stack Overflow or respective owner