Using more than one condition in linq's where method

前端 未结 7 1463
南方客
南方客 2020-12-15 15:44

I have a line of code using where:

codebase.Methods.Where(x => x.Body.Scopes.Count > 5);

How can I insert more than one condition? So

7条回答
  •  被撕碎了的回忆
    2020-12-15 16:08

    What would "y" represent?

    You can just use a standard && condition. No need for a "y":

    codebase.Methods.Where(x => x.Body.Scopes.Count > 5 && x.Body.SomethingElse < 14);
    

提交回复
热议问题