Lets assume:
List which element is:
List
public class Element(){ int Weight {get;set;} }
What I want to a
// assuming rnd is an already instantiated instance of the Random class var max = list.Sum(y => y.Weight); var rand = rnd.Next(max); var res = list .FirstOrDefault(x => rand >= (max -= x.Weight));