I have a Schedule class:
public class Schedule
{
.....
public DateTime? StartDate{get;set;}
public DateTime? EndDate{get;set;}
....
}
I would like to get the list of started Schedule objects from an IEnumerable list in the optimal way using linq or lambda.
NOTE: An empty date value means infinity here. However, unspecified schedule period (empty start and end dates) means schedule is not started ..
This assumes you actually want what you said – all started schedules, including those that already ended.
Also, you might want to change the way you represent unspecified schedule period, probably by adding a
boolfor that. Ifnullmeans infinity, it should always mean infinity.