コード例 #1
0
        public async Task <IActionResult> GetBookChapterByIdAsync(Guid id)
        {
            BookChapter chapter = await _repository.FindAsync(id);

            if (chapter == null)
            {
                return(NotFound());
            }
            else
            {
                return(new ObjectResult(chapter));
            }
        }
コード例 #2
0
        public async Task <IActionResult> GetBookChapterByIdAsync(Guid id)
        {
            string message = string.Format($"Id={id.ToString()}");

            _logger.LogInformation(message);
            BookChapter chapter = await _repository.FindAsync(id);

            if (chapter == null)
            {
                return(NotFound());
            }
            else
            {
                return(new ObjectResult(chapter));
            }
        }