Skip to content

Instantly share code, notes, and snippets.

@trashvin
Last active June 2, 2017 13:20
Show Gist options
  • Save trashvin/941570b67d882759f27040ae7c8e8f06 to your computer and use it in GitHub Desktop.
Save trashvin/941570b67d882759f27040ae7c8e8f06 to your computer and use it in GitHub Desktop.
Multiple assignment inside ForEach (LINQ)
//use curly brace to group assignment statements
_localDb.Where( i => i.id == id).ToList().ForEach( i => {
i.name = task.name;
i.completed = task.completed;
i.priority = task.priority;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment