public IActionResult Update(string id, APIPlayer playerIn) { var player = _playerService.Get(id); if (player == null) { return(NotFound()); } _playerService.Update(id, playerIn); return(NoContent()); }
public ActionResult <APIPlayer> Create(APIPlayer player) { _playerService.Create(player); return(CreatedAtRoute("GetPlayer", new { id = player.Id.ToString() }, player)); }
public void Update(string id, APIPlayer playerIn) => _players.ReplaceOne(player => player.Id == id, playerIn);
public void Remove(APIPlayer playerIn) => _players.DeleteOne(player => player.Id == playerIn.Id);
public APIPlayer Create(APIPlayer player) { _players.InsertOne(player); return(player); }