You can do something like this:
var newList = list.Where(w => w.Name == "height")
.Select(s => new {s.Name, s.Value= 30 }).ToList();
But I would rather choose to use foreach
because LINQ
is for querying while you
want to edit the data.