Beispiel #1
0
 public void AddPlayer()
 {
     using (var db = new UsernameModel())
     {
         usernameList  = new List <string>();
         highscoreList = new List <int>();
         var query = from player in db.Tables select player;
         foreach (var item in query)
         {
             usernameList.Add(item.Username);
             highscoreList.Add(item.Score);
         }
     }
 }
 private void AddScore()
 {
     using (var db = new UsernameModel())
     {
         table = new Table
         {
             Username = PlayerNameInput.Username,
             Score    = score,
         };
         db.Tables.Add(table);
         db.SaveChanges();
         Close();
     }
 }