I am working on a school project which involves managing driving instructor calendars.
The application stores the time periods over which an instructor is available.
public partial class AvailabilityPeriod // kind of pseudo code
{
Instructor instructor;
DateTime start;
DateTime end;
}
It also stores the individual appointments for this instructor, in a similar fashion.
When a customer says, for example, "I want a 2-hour lesson", I have to fetch availability periods and appointements of all instructors in order to compute their "actual availability" and then find someone having more than 2 hours free in his/her schedule.
Is there a better way ?
My question is almost an exact duplicate of Time Calendar Data Structure and I know it. But, well... We're in 2011 and I'm interested in Entity Framework-specific info, or at least something about doing this whith object relational mapping :-)