public async Task <Player> UpdatePlayerName(Guid id, UpdatedPlayerName player) { var filter = Builders <Player> .Filter.Eq("Id", id); var update = Builders <Player> .Update.Set("Name", 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, UpdatedPlayerName player) { return(_repository.UpdatePlayerName(id, player)); }
public Task <Player> UpdateName(Guid id, [FromBody] UpdatedPlayerName player) { return(_processor.UpdateName(id, player)); }