有返回視圖查詢在實體框架
var res = (from results in db.JobSearchAgents
where results.SiteID == 110 && results.UserID == sess
select results).AsEnumerable().Select(results => new Agentlist
{
JobSearchAgentID = results.JobSearchAgentID.ToString(),
EmailAddress = results.EmailAddress,
Keywords = results.Keywords,
Country = results.Country,
zipcode = results.ZipCode,
miles = results.Miles.ToString()
});
return View(res);
你的問題是什麼? – 2011-05-27 12:41:01