BookServiceAsyncSample.Controllers.BookChaptersController.PutBookChapterAsync C# (CSharp) 메소드

PutBookChapterAsync() 개인적인 메소드

private PutBookChapterAsync ( System.Guid id, [ chapter ) : Task
id System.Guid
chapter [
리턴 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
        }