3
上面可以看到FollowingUsers
和StatusUpdates
表。
在FollowingUsers
,我存储Follower
的Username
和Following
的Username
。 在StatusUpdates
,我店Status updates
的用户。
下面你可以看到我写的检索谁在登录的用户的状态更新原始查询。
var list = new List<StatusUpdate>();
list = (from x in db.StatusUpdates
where x.Author == User.Identity.Name
orderby x.Timestamp descending
select x)
.Take(count).ToList();
如何从以下获取状态更新的登录用户?
谢谢Tuskan360。但它没有工作:( – ChamingaD 2011-12-21 18:36:21
你能更具体吗?什么没有工作?你得到一个错误信息吗?它编译吗?你刚刚得到错误的数据吗? – ForbesLindesay 2011-12-21 19:14:04
另外,你是否使用查询SQL数据库LINQ to SQL?或其他东西? – ForbesLindesay 2011-12-21 19:14:37