Created
April 1, 2020 11:35
-
-
Save tornikegomareli/2137f11cab85acdd75c9b0bde799cdae to your computer and use it in GitHub Desktop.
This file contains 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
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