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());
}
查詢無法在昭和RUN1,並顯示出性能之間distuingish RUN2它只是複製所有演出昭和RUN1,並顯示出RUN2
你能提供數據庫中的數據嗎? – Femaref 2011-04-04 17:35:36
首先,我可以建議更改變量名稱,使其更易於遵循(prod,run和perf,而不是f,g和l)。另外,我對連接線感興趣 - 什麼是Production.show? – HitLikeAHammer 2011-04-04 17:44:25
@HitLikeAHammer @Femaref感謝您的回答。下面的答案完成了這項工作。 – 2011-04-04 17:53:26