Mongodb, linq driver. How to construct Contains with variable or statements

前端 未结 2 1736
予麋鹿
予麋鹿 2021-01-13 13:29

I\'m using the Mongo LINQ Driver for C#, works great.

Sorting a lot of properties but heres a problem I can\'t solve, its probably simple.

var identi         


        
2条回答
  •  一个人的身影
    2021-01-13 14:03

    var identifierList = new []{"10", "20", "30"};
    var newList = list.ToList().Where(x => identifierList.Contains(x.Identifier));
    

    You will just have to use List instead of Ienumerable (do that by using the .ToList())

    If it doesn't work please add your list TYPE

提交回复
热议问题