如何使用LINQ查询基于用户名表检索客户端?
答案 0 :(得分:1)
搜索具有所需用户名的用户并获取相关客户端。
Dim username = "Bob"
Dim clients =
From user In db.App_Users
Where user.Username = username
Select user.Dim_Client
答案 1 :(得分:0)
要根据用户名获取客户端,此类内容应该有效。
dim client = ( _
From client In Dim_Client
Where client.App_Users.Any(Function(user) user.Username = "foo")
Select client).Single