public IHttpActionResult postScore(PlayerScoreObject gs) { using (ApplicationDbContext db = new ApplicationDbContext()) { db.GameScores.Add(new GameScore { GameID = gs.GameId, PlayerID = gs.PlayerId, score = gs.score }); db.SaveChanges(); return(Content(HttpStatusCode.OK, gs)); } }
void PopulateList() { if (populated == true) { return; } //Create a list at the size of friends. for (int i = 0; i < SocialCenter.Instance.FriendSize; i++) { PlayerScoreObject newObject = NGUITools.AddChild(TopScores.gameObject, PlayerObjectPrefab.gameObject).GetComponent <PlayerScoreObject>(); //Deactivate and add to the list. newObject.gameObject.SetActive(false); _PlayersObjects.Add(newObject); } populated = true; }