I have some list (where T is a custom class, and class has some properties). I would like to know how to change one or more values inside of it by using Lambda Expressions,
I know this is an old post but, I've always used an updater extension method:
public static void Update<TSource>(this IEnumerable<TSource> outer, Action<TSource> updator)
{
foreach (var item in outer)
{
updator(item);
}
}
list.Where(w => w.Name == "height").ToList().Update(u => u.height = 30);