取出数据库满足条件的记录的ID,把值放到list中
public ActionResult vote(int id=)
{
int userid = Convert.ToInt32(Request.Cookies["id"].Value);
var q = from p in db.als where p.uid== userid select p.lid;
List <int> pp= new List<int>();
foreach (var item in q)
{
pp.Add(Convert.ToInt32(item));
//遍历linq取出的数据加入到list中
}
pp.Contains(id);
while(pp.Contains(id))
{
id=id+;
}
list newlist = db.lists.Find(id);
return View(newlist);
}