I have a list which I want to update using LINQ.
class Student { private string name; private int marks; public string Name { get; set;} pub
LINQ is for querying, not for updating the data. Use LINQ to get the items that you want to modify, and then modify them in a foreach loop:
foreach
foreach ( var tom in myList.Where(w => w.Name == "Tom")) { tom.Marks = 35; }
Demo.