linqを使用してリストからアイテムを削除するには?linqを使用してリストからアイテムを削除します
私はアイテムのリストを持っていて、それ自身は他のアイテムのリストを持っています。 もっと明確にするためにコードを確認してください。
public Class BaseItems
{
public int ID { get; set; }
public List<IAppointment> Appointmerts { get; set; }
}
Public DeleteApp(List<IAppointment> appointmentsToCheck)
{
List<BaseItems> _lstBase ; // is having list of appointments
//now I want to remove all items from _lstBase which _lstBase.Appointmerts contains
any item of appointmentsToCheck (appointmentsToCheck item and BaseItems.Appointmerts
item is having a same reference)
//_lstBase.RemoveAll(a => a.Appointmerts.Contains(//any item from appointmentsToCheck));
}