我相信这对知道答案的人来说是基本的。但我被困住了。我曾试图查找答案,但无济于事。我如何在后面的代码中引用fbreregistered值?
using (kvEntities ent = new kvEntities())
{
var user = from u in ent.kvUsers
where u.fbID == id
select new { u.fbID, u.fbRegistered};
if (user.fbRegistered) // < ???
{
// so how do I reference fbRegistered just above?
// this gives me an error.
}
}
谢谢!
user
包含collection。使用First
或Single
方法:
if (user.First().fbRegistered) ...