Given this classic VB.NET code
For Each item in myColl
item.PropX = "New Value"
Next
What will be the linq for the same purpose (in VB.NET)?
Given this classic VB.NET code
For Each item in myColl
item.PropX = "New Value"
Next
What will be the linq for the same purpose (in VB.NET)?
OP's previous question:
For c# this is how I do it:
var query = myColl.Select(item => { item.PropX = "New Value"; return
item; }).ToList()
What will be the linq for VB.NET?
This is probably the structure you're looking for, though I'm not sure this is what you want to do as all this is doing is setting query as an IEnumerable of string, where it's always "New Value".
dim query = myColl.Select(Function(item) item.PropX = "New Value")
UPDATED QUESTION OP did make changes to the question that invalidated most of the answers on this thread. The updated question in case it gets changed again:
For Each item in myColl item.PropX = "New Value" Next
What will be the linq for the same in VB.NET?
UPDATED ANSWER:
Assuming myColl is of type List:
myColl.ForEach(Function(x) x.PropX = "New Value")
Though this isn't recommended. OP's better off using a normal foreach loop.