I've a problem with linq methods of a List<T>
where T is a custom class.
This is my class:
public class RoomWorkingPlan
{
public Int64 m_IdRoom;
public Dictionary<DateTime, List<WorkInterval>> workingPlan = new Dictionary<DateTime, List<WorkInterval>>();
}
I'm trying to use the methods any or select on a list like this :
List<RoomWorkingPlan> roomsworking = (List<RoomWorkingPlan>)m_RoomAvailable.Values.Cast<RoomWorkingPlan>().ToList();
DateTime startingDate = DateTime.now;
if (!roomsworking.Any<RoomWorkingPlan>(r => r.workingPlan.ContainsKey(startingDate)))
{
return false;
}
but I received an error message saying "the expression cannot contains a Lambda Expression". Any ideas? On the http://msdn.microsoft.com all the examples contains Lamda expressions..
EDIT: m_RoomAvailable is an hashtable containing an int64 as key and RoomWorkingPlan as value.