Example #1
0
        public IActionResult Update(string id, APIPlayer playerIn)
        {
            var player = _playerService.Get(id);

            if (player == null)
            {
                return(NotFound());
            }

            _playerService.Update(id, playerIn);
            return(NoContent());
        }
Example #2
0
        public ActionResult <APIPlayer> Create(APIPlayer player)
        {
            _playerService.Create(player);

            return(CreatedAtRoute("GetPlayer", new { id = player.Id.ToString() }, player));
        }
Example #3
0
 public void Update(string id, APIPlayer playerIn) => _players.ReplaceOne(player => player.Id == id, playerIn);
Example #4
0
 public void Remove(APIPlayer playerIn) => _players.DeleteOne(player => player.Id == playerIn.Id);
Example #5
0
 public APIPlayer Create(APIPlayer player)
 {
     _players.InsertOne(player);
     return(player);
 }