protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); var dbContext = new SpaceCheeseDb(); }
public ActionResult Index() { ViewBag.Title = "Home Page"; using (var db = new SpaceCheeseDb()) { var scores = db.Scores; ViewBag.Scores = scores.ToList().OrderBy(x => x.Moves).Take(5); return View(); } }