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

PostBookChapterAsync() private method

private PostBookChapterAsync ( [ chapter ) : Task
chapter [
return Task
        public async Task<IActionResult> PostBookChapterAsync([FromBody]BookChapter chapter)
        {
            if (chapter == null)
            {
                return BadRequest();
            }
            await _repository.AddAsync(chapter);
            // return a 201 response, Created
            return CreatedAtRoute(nameof(GetBookChapterByIdAsync), new { id = chapter.Id }, chapter);
        }