BooksServiceSample.Controllers.BookChaptersController.PutBookChapter C# (CSharp) Method

PutBookChapter() private method

private PutBookChapter ( string id, [ chapter ) : IActionResult
id string
chapter [
return IActionResult
        public IActionResult PutBookChapter(string id, [FromBody]BookChapter chapter)
        {
            if (chapter == null || id != chapter.Id)
            {
                return BadRequest();
            }
            if (_repository.Find(id) == null)
            {
                return NotFound();
            }

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