Last active
June 2, 2017 13:20
-
-
Save trashvin/941570b67d882759f27040ae7c8e8f06 to your computer and use it in GitHub Desktop.
Multiple assignment inside ForEach (LINQ)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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