Can I use LINQ to retrieve only “on change” values?

前端 未结 5 830
死守一世寂寞
死守一世寂寞 2021-01-22 20:36

What I\'d like to be able to do is construct a LINQ query that retrieved me a few values from some DataRows when one of the fields changes. Here\'s a contrived example to illus

5条回答
  •  无人共我
    2021-01-22 21:23

    I think what you are trying to accomplish is not possible using the "syntax suggar". However it could be possible using the extension method Select that pass the index of the item you are evaluating. So you could use the index to compare the current item with the previous one (index -1).

提交回复
热议问题