public async Task Put()

in dotnet8/web/{{cookiecutter.project_name}}/src/ServerlessAPI/Controllers/BooksController.cs [68:85]


    public async Task<IActionResult> Put(Guid id, [FromBody] Book book)
    {
        if (id == Guid.Empty || book == null) return ValidationProblem("Invalid request payload");

        // Retrieve the book.
        var bookRetrieved = await bookRepository.GetByIdAsync(id);

        if (bookRetrieved == null)
        {
            var errorMsg = $"Invalid input! No book found with id:{id}";
            return NotFound(errorMsg);
        }

        book.Id = bookRetrieved.Id;

        await bookRepository.UpdateAsync(book);
        return Ok();
    }