C#C
C#3y ago
Emelie

❔ Help me understand this lambda expression

var myKey = availableProducts.FirstOrDefault(x => x.Value == input).Key;
Console.WriteLine("Quantity: left " + myKey);
Im trying to understand how this code works (how it gets the key for the input value in a dictionary). Been searching the web but not really getting more clear.. mostly I dont understand the use of "x". Many thanks for any help!
Was this page helpful?