I am building an application that lists football matches for a tournament. I have attachd the database diagram for further explanation.
I am trying to list all the matches in a grid but I am having difficulty retrieving the names of TeamA and TeamB from dw_Team. TeamA and TeamB's ID's are both foreign keys in the dw_Match table. You'll have to look at the database diagram for a cleared understanding.
The code I am currently using is only returning TeamA's name, and not team B. Can someone help me out with the LINQ/Lamba query that I need?
Thanks in advance.
var matches = from m in db.Matches
ID = m.ID,
StageName = m.Stage.Name,
MatchDayTitle = m.MatchDay.Title,
Date = m.Date,
Time = m.Time,
TeamAName = m.Team.Name,
TeamBName = m.Team.Name