Linq query with Array in where clause?

前端 未结 4 995
无人共我
无人共我 2020-12-28 16:23

I have searched for this, but still can\'t seem to get this to work for me. I have an array of Id\'s associated with a user (their Organization Id). These are placed in an

4条回答
  •  醉酒成梦
    2020-12-28 17:02

    A check using the Contains method should do the job here.

    var query = (from p in this.Database.Personnels
                 where OrgIds.Contains(p.OrganisationId)
                 select p).ToList();
    

提交回复
热议问题