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

PostBookChapter() private method

private PostBookChapter ( [ chapter ) : IActionResult
chapter [
return IActionResult
        public IActionResult PostBookChapter([FromBody]BookChapter chapter)
        {
            if (chapter == null)
            {
                return BadRequest();
            }
            _repository.Add(chapter);
            // return a 201 response, Created
            return CreatedAtRoute(nameof(GetBookChapterById), new { id = chapter.Id }, chapter);
        }