예제 #1
0
        public async Task <ActionResult <Friend> > Put(Guid id, [FromBody] Friend friend)
        {
            var friendUpdate = await _friendService.GetAsync(id);

            if (friendUpdate is null)
            {
                return(NotFound("Amigo não encontrado"));
            }

            friendUpdate.Name = friend.Name;

            await _friendService.UpdateAsync(friendUpdate);

            return(CreatedAtRoute("Get", new { id = friendUpdate.Id }, friendUpdate));
        }