this seems really awkward …does anybody have any suggestions for a cleaner approach?
bool case1 = (dte.StartDateTime >= Date) && (dte.StartDateTime < Date.AddHours(_interval));
bool case2 = (dte.EndDateTime > Date) && (dte.EndDateTime < Date.AddHours(_interval));
bool case3 = (dte.StartDateTime <= Date) && (dte.EndDateTime >= Date.AddHours(_interval));
return ((dte.Association == Association) && (case1 | case2 | case3));
c#, .net 2.0
Well,
This is then short-circuited, and we only find the end date once.