// To get current user id
var currentUsrId = Convert.ToInt16(Membership.GetUser().ProviderUserKey);
var IDquery = My_usr_contacts_requests.Where(i => i.requests_to_usr_id == currentUsrId)
.Select(i => new { i.from_usr_id })
.ToArray();
var mainquery = My_usr_biographic_details
.Join(
My_usr_profiles_companies, i => i.usr_id, j => j.company_usr_id,
(i, j) => new
{
usr_id = j.company_usr_id,
})
.Where(i =>IDquery.contains(i.usr_id))
.ToArray();
当我执行时,我在 中获取值数组IDquery
,并且我想在 mainquery 的 where 条件中使用这些值,如上所示,但是当我这样给出时,它在 mainquery where 条件下显示错误。你能告诉我如何使用从IDquery
in检索到的值数组mainquery
吗?