C# List<Apple>删除指定的对象
List<Apple> listApples = new List<Apple>();
listApples.Add(new Apple("1","1","1"));
listApples.Add(new Apple("2", "2", "2"));
listApples.Add(new Apple("3", "3", "3"));
listApples.Add(new Apple("4", "4", "4"));
listApples.Where(t=>t.Name=="2");
listApples.RemoveAt(listApples.IndexOf(listApples.Where(t=>t.Name=="2").ToArray()[0]));
foreach (var item in listApples)
{
Console.WriteLine(item.Name);
}