Please see my other LINQ articles.
Use LINQ to update values during a query.
This article will demonstrate how to perform a SET, similar to sql SET during a query.
First, I’ll populate a List<T> collection of Person objects.
Now, I’ll call ForEach() on each person object, assigning the length of FirstName to the FNameLen property of each person object.
Now when I display my person collection, I can also set the value of this newly set property.
.NET Fiddle: https://dotnetfiddle.net/QXW3A5