I'm trying to compare if item is already existing in listview.
It says :
Use of unassigned local variable 'alreadyInList'
bool alreadyInList;
foreach (var itm in lvCart.Items)
{
if (itm == item)
{
alreadyInList = true;
break;
}
}
if(!alreadyInList)
{
lvCart.Items.Add(new ListViewItem(new string[] { item, price, noi }));
}