Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tornikegomareli/2137f11cab85acdd75c9b0bde799cdae to your computer and use it in GitHub Desktop.
Save tornikegomareli/2137f11cab85acdd75c9b0bde799cdae to your computer and use it in GitHub Desktop.
public static void ChangeValueInList<T>(this IList<T> collection, int index, T value)
{
var valueToChange = collection.FirstOrDefault(o => collection.IndexOf(o) == index);
if(valueToChange != null)
{
valueToChange = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment