BookServiceAsyncSample.Controllers.BookChaptersController.PutBookChapterAsync C# (CSharp) Method

PutBookChapterAsync() private method

private PutBookChapterAsync ( System.Guid id, [ chapter ) : Task
id System.Guid
chapter [
return Task
        public async Task<IActionResult> PutBookChapterAsync(Guid id, [FromBody]BookChapter chapter)
        {
            if (chapter == null || id != chapter.Id)
            {
                return BadRequest();
            }
            if (await _repository.FindAsync(id) == null)
            {
                return NotFound();
            }

            await _repository.UpdateAsync(chapter);
            return new NoContentResult();  // 204
        }