Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我们有一个项目列表,这个列表包含另一个用户列表。
如何构建一个 LINQ 查询,让我根据他的 UserID 获取特定用户的所有项目?
谢谢。
让我们尝试这样的事情:
Projects.Where(pr => pr.Users.Any(us => us.ID == uid) )
我建议你阅读LINQ教程或这里