An Activity occurs at a location on a specific date, but each activity may be repeated at the same or different locations on different dates. I have created an entity framework model, and wish to populate it with relevant Activities which occur between two dates, ordered by the locations distance from a specified location.
I therefore have a the following tables:
Activity (A)
Occurrence (O)
Location (L)
With relationships as follows:
A 1-n O n-1 L
I am having some difficulty in doing this using linq to entities, but am sure that I can achieve it in a stored procedure.
Is this something that I should be able to do using Linq or is it too complex a problem for Linq to create the Sql? Any pointers about writing the Linq query would be appreciated, if it is something that it should be able to do.