I have an open class.
public class StoreItems { public string itemName; public string itemPrice; public string itemQuantity; }
I have a list.
public List <StoreItems> itemData = new List<StoreItems> ();
The user enters the name of the item, and they should check to see if that item name is in my itemData itemName.
My current code is something like this
if (itemData.Find(x => x.itemData.Equals(userInput)) { //already in list } else { //add data }
However, I get an error when itemData cannot be explicitly converted to bool. Tips will be appreciated
source share