Remove instances from a list by using LINQ or Lambda?

前端 未结 7 1581
囚心锁ツ
囚心锁ツ 2021-02-05 03:26

Now I come a stage to get all my data as a list in cache(objects) and my next thing I have to do is to remove some instances from the list.

Normally, I would do removing

7条回答
  •  [愿得一人]
    2021-02-05 03:55

    foreach(var item in toBeRemovedLItems) {   
       list.RemoveAll(one => one.Value1 == item.Value1 && one.Value2 < item.Value2); 
    }
    

    Too late again. Oh well.

提交回复
热议问题