
public ActionResult Performances(string id)
{
var query =
from f in _db.Production
join g in _db.Run on f.show equals g.Production.show
join l in _db.Performance on g.startDate equals l.runStartDate
where f.show == id
select new ShowPerformance
{
Venuename = g.venue,
Showname = f.show,
RunStart = g.startDate,
RunEnd = g.endDate,
PerformanceDate = l.performanceDate,
PerformanceTime = l.performanceTime
};
return View(query.ToList());
}
The query can not distuingish between a performance in ShowA run1 and Show A run2 it just duplicates all performances ShowA run1 and Show A run2
I think the problem might be how you join Performance to Run/Production
without something like the
on g.runId equals l.runIdthen you will get all the performances for all the productions/runs.