BooksServiceSample.Controllers.BookChaptersController.PutBookChapter C# (CSharp) 메소드

PutBookChapter() 개인적인 메소드

private PutBookChapter ( string id, [ chapter ) : IActionResult
id string
chapter [
리턴 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
        }