I am trying to build a tool that calculates something called quota based upon when employees are scheduled to work and when they request off.

My ShiftSet object is a set of Shift objects which consist of a StartTime and EndTime (both of type time(7). Each ShiftSet corresponds to a day.

ScheduleExceptions are times that an employee has off. There can be any number of overlapping or non-overlapping ScheduleExceptions in a day. They are of the datetime data type.

An example of a ShiftSet:  

08:00-10:00  

10:00-12:00  

13:00-15:00  

15:00-17:00 

An example of ScheduleExceptions for that same day:  

07:30-10:30  

14:35-16:00

What I need to do is to find the amount of time that the employee is working on a day. The way I can figure to do this is to calculate the intersection of ShiftSet and the inverse of ScheduleExceptions.

How would I do this with time? I would prefer to use Linq if possible.