How to use 'In' SQL keyword in Entity Framework?

后端 未结 3 358
失恋的感觉
失恋的感觉 2021-01-20 18:52

This is my SQL command

SELECT KEY,NAME
from  COMPANY c 
WHERE     KEY IN (select KEY from USER_COMPANY  where UserId = @UserId)
order by NAME asc
         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-20 19:06

    My understanding is that the translation from .Contains() to IN is only just being added to EF6.

    According to this work item (http://entityframework.codeplex.com/workitem/245) and the release note: Improved performance of Enumerable.Contains in LINQ queries.

    So look for it in EF6

提交回复
热议问题