I have an object list and I can add record with that sentence:
List<DragerClass.Alarm> alarms = new List<DragerClass.Alarm>();
public void createAlarm(int i, int[] alarms)
{
alarms.Add(new DragerClass.Alarm(i, DateTime.Now, DragerClass.Dedector.Dedector_Name[i] + " UNDER RANGE"))`;
}
But when I try to remove an item, it behaves like lambda expression doesn't support:
public void removeAlarm(int i)
{
alarms.Remove(x => x.Dedector_No == i);
}
I see that message when I stand on the code
cannot convert lambda expression to type 'Drager_GasDedection.DragerClass.Alarm' because it is not a delegate type
I'm using Visual Studio 2010 and I also added System.Data.Entity in references. But still same. Thanks for any help.
alarms.RemoveAt(i);Removewith predicate is incorrectalarms.RemoveAll(x => x.Dedector_No == i);