泛型和linq
List<AddressEntity> AddressEntityList = new List<AddressEntity>();
AddressEntityList.Add(new AddressEntity { LinkManName = "111111" });
AddressEntityList.Add(new AddressEntity { LinkManName = "22222" });
AddressEntityList.Add(new AddressEntity { LinkManName = "333333333" });
AddressEntityList.Add(new AddressEntity { LinkManName = "444444444" });
var list = AddressEntityList;
foreach (AddressEntity temp2 in list.Where(x => x.LinkManName != "22222"))
{
Response.Write(temp2.LinkManName + "<br/>");
}
AddressEntityList.Add(new AddressEntity { LinkManName = "111111" });
AddressEntityList.Add(new AddressEntity { LinkManName = "22222" });
AddressEntityList.Add(new AddressEntity { LinkManName = "333333333" });
AddressEntityList.Add(new AddressEntity { LinkManName = "444444444" });
var list = AddressEntityList;
foreach (AddressEntity temp2 in list.Where(x => x.LinkManName != "22222"))
{
Response.Write(temp2.LinkManName + "<br/>");
}