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
You can use LINQ's Where method to filter out values that should not be a part of the list. The result is an IEnumerable
with the elements removed.
var res = list.Where(item => !(one.Value1 == item.Value1 && one.Value2 < item.Value2));
This will not updated the original List
instance but instead will create a new IEnumerable
with the values removed.