SyntaxFix
Write A Post
Hire A Developer
Questions
AllDogs.First(d => d.Id == "2").Name = "some value";
However, a safer version of that might be this:
var dog = AllDogs.FirstOrDefault(d => d.Id == "2"); if (dog != null) { dog.Name = "some value"; }