Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Web.Mvc;
- using SSV.ViewModels;
- namespace SSV.Controllers
- {
- public class MatchesController : BaseController
- {
- //
- // GET: /Spiele/
- // Routed: /Matches/
- public ActionResult Index()
- {
- MatchesOverview vm = new MatchesOverview()
- {
- UpcomingFirst = Context.Games.Where(i => i.Date.CompareTo(DateTime.Now) == -1 && i.TeamId == 1).Take(5).ToList(),
- UpcomingSecond = Context.Games.Where(i => i.Date.CompareTo(DateTime.Now) == -1 && i.TeamId == 2).Take(5).ToList(),
- PastGames = Context.Games.Where(i => i.Date.CompareTo(DateTime.Now) == 1).ToList()
- };
- return View(vm);
- }
- //
- // GET: /Spiele/SpielDetails/42
- // Routed: /Matches/Detail/42
- public ActionResult Detail(int id)
- {
- MatchDetail vm = new MatchDetail()
- {
- Game = Context.Games.Single(i => i.Id == id)
- };
- return View(vm);
- }
- }
- }
Add Comment
Please, Sign In to add comment