如何从List <T>元素集合中更新特定元素?

Vip*_*pul 2 c#

我有一个自定义对象列表列表,我想更新一个特定的元素说从顶部的第3个元素,我将如何在C#中做到这一点?

Dan*_*ite 8

// Updates a property or member of the item
myList[2].myProperty = something;

// Replaces the item in the list
myList[2] = someNewItem;
Run Code Online (Sandbox Code Playgroud)