//OLD CODE
IQueryable matches = from m in db.Matches
where (m.Date >= date && m.Date <= date.AddHours(24)) &&
m.Stage.Name == stageName &&
m.MatchDay.Title == matchDayTitle
orderby m.Date
select new
{
MatchDay = m.MatchDay.Title,
Time = string.Format("{0:t}", m.Date),
TeamAFlagIconUrl = m.Team.FlagIconURL,
TeamAName = m.Team.Name,
TeamBFlagIconUrl = m.Team1.FlagIconURL,
TeamBName = m.Team1.Name
};
//NEW CODE
//Get all matches
IQueryable matches = from m in db.Matches
where (m.Date >= date && m.Date <= date.AddHours(24)) &&
m.Stage.Name == stageName &&
m.MatchDay.Title == matchDayTitle
orderby m.Date
select new
{
MatchDay = m.MatchDay.Title,
Time = string.Format("{0:t}", m.Date),
TeamAFlagIconUrl = m.MatchTeams.????,
TeamAName = m.MatchTeams.????,
TeamBFlagIconUrl = m.MatchTeams.????,
TeamBName = m.MatchTeams.????
};
return matches;
|