public async Task <Player> UpdatePlayerName(Guid id, UpdatedPlayerName player) { var filter = Builders <Player> .Filter.Eq("Id", id); var update = Builders <Player> .Update.Set("NewName", player.UpdatedName); var player2 = await collection.FindOneAndUpdateAsync(filter, update); return(player2); }
public async Task <Player> UpdatePlayerName(Guid id, UpdatedPlayerName player) { await Task.CompletedTask; Player found = GetPlayerById(id); if (found != null) { found.Name = player.UpdatedName; } return(found); }
public Task <Player> UpdateName(Guid id, [FromBody] UpdatedPlayerName player) { return(_processor.UpdatePlayerName(id, player)); }
public Task <Player> UpdatePlayerName(Guid id, UpdatedPlayerName player) { return(_repository.UpdatePlayerName(id, player)); }