You should be able to do a names.ForEach(...)

|-----Original Message-----
|From: [email protected] [mailto:ozdotnet-
|[email protected]] On Behalf Of Arjang Assadi
|Sent: Friday, 25 February 2011 12:37 PM
|To: ozDotNet
|Subject: Linq (To Objects) Update ( like sql )
|
|When using Linq to Objects, is it possible to change a property value on
all the
|selected values?
|I am NOT using Linq to sql, I have list items and want to change value of
some
|properties depending on names e.g.
|
|//typo in name entry, can not change the persisted data, instead correcting
in
|code, there are no ID's to create a correction table for specific records,
just
|having to hard code it heuristics.
|
|var names = from p in nameList
|                  where p.FirstName == "Pater"
|                  set p.FirstName = "Peter"
|                  select p;
|
|Regards
|
|Arjang

Reply via email to