private static void EatCandy(CandyStorage db) { int increment = 0; var candiesInList = db.ShowList(); Console.WriteLine("Enter number corresponding to the desired candy to eat:\n"); foreach (var candy in candiesInList) { increment++; Console.Write($"{increment})\t {candy.Name}\n"); } var selectedCandy = Convert.ToInt32(Console.ReadLine()) - 1; db.EatChosenCandy(candiesInList[selectedCandy].Name); }