예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public Task <Player> UpdateName(Guid id, [FromBody] UpdatedPlayerName player)
 {
     return(_processor.UpdatePlayerName(id, player));
 }
예제 #4
0
 public Task <Player> UpdatePlayerName(Guid id, UpdatedPlayerName player)
 {
     return(_repository.UpdatePlayerName(id, player));
 }