Group by variable integer range using Linq

后端 未结 4 1246
说谎
说谎 2020-11-27 20:40

I\'m trying to group a set of data based on the range of an integer, by the range does not increase at a fixed interval.

e.g. I have

Item ID Price

4条回答
  •  隐瞒了意图╮
    2020-11-27 21:13

    You could select the ints in different sets with Linq.

    Something like:

     var newList = theList.Where(i => i < 30 && i >10);
    

    This would get you all of th eints from a certain interval.

提交回复
热议问题