I`ve got a struct that includes numeral variable
public struct A
{
public int x;
public string y;
}
Also i have a List of a struct type:List<A> l = new List<A>()
After adding noumerus elements into the list, a want to set a value to variable y but only for the element where x=1
I am able to find the element in the list that fullfill the condition
l.Find(item => item.x == 1)
how i can to set the value of y for that specific element`? I tryed the elementary way (from my opinion) but it wrong
l.Find(item => item.x == 1).y="valueX"
Thank you in advance