Hello,
I am getting a list of objects where each object has 2 properties:
StartDate and FinishDate.
I want to select only the items where DateTime.Now is in range ...
But following the next rules:
1. DateTime.Now StartDate if only StartDate is defined
2. DateTime.Now < FinishDate if only FinishDate is defined
3. StartDate < DateTime.Now < FinishDate if only FinishDate is defined
If both dates are undefined then select the record no matter what ...
Is this possible?
I think I might to something in my Linq expression as follows:
....
where Check(StartDate, FinishDate) == true
Where Check would be a function to do the testing ...
Is this the way to go?
Thanks,
Miguel