Ejemplo n.º 1
0
 public ActionResult Scores()
 {
     using (HighscoreEntities db = new HighscoreEntities())
     {
         return(View(db.Scores.ToList()));
     }
 }
Ejemplo n.º 2
0
 public ActionResult AddScores(string username, string emailAddress, int highScore)
 {
     using (HighscoreEntities db = new HighscoreEntities())
     {
         var score = new Score {
             Username = username, EmailAddress = emailAddress, HighScore = highScore
         };
         db.Scores.Add(score);
         db.SaveChanges();
     }
     return(View("Success"));
 }