Is it possible to set property on each element from List using LINQ.
for example:
var users = from u in context.Users where u.Name == \"George\" sele
You can create your own ForEach extension method:
public static IEnumerable ForEach(this IEnumerable source, Action action)
{
foreach (var element in source)
{
action(element);
}
return source;
}
Then your code can be simplified to:
context.Users.Where(x => x.Name == "George").ForEach(u => u.MyProp = false);
EDIT: You could also yield return each item after the call to action() (no pun intended) to leave the deferred execution untouched.