// POST api/players
        public IHttpActionResult Post(Player p)
        {
            if (!ModelState.IsValid)
                return BadRequest(ModelState);

            _brokenShoeLeagueRepository.CreatePlayer(p);
            _brokenShoeLeagueRepository.SaveChanges();
            return Ok(p);
        }
 public PlayerViewModel(Player player)
 {
     Name = player.Name;
     Enabled = player.Enabled;
     ImageProfileUrl = player.ImageProfileUrl;
 }
 public void UpdatePlayer(Player player)
 {
     var playerDb = Players.Find(player.Id);
     playerDb.Name = player.Name;
     playerDb.Enabled = player.Enabled;
     SaveChanges();
 }
 public void CreatePlayer(Player newPlayer)
 {
     newPlayer.ImageProfileUrl = "~/Content/Images/_defaultPlayer.png";
     Players.Add(newPlayer);
     SaveChanges();
 }
 public void RemovePlayer(Player player)
 {
     Players.Remove(player);
     SaveChanges();
 }