コード例 #1
0
        public IHttpActionResult GetAuthorById(int authorId)
        {
            AuthorServices authorService = CreateAuthorService();
            var            author        = authorService.GetAuthorById(authorId);

            return(Ok(author));
        }
コード例 #2
0
        public IActionResult GetAuthorById(int id)
        {
            var author = _authorService.GetAuthorById(id);

            if (author == null)
            {
                return(NotFound());
            }
            return(Ok(author));
        }
コード例 #3
0
        public IActionResult GetAuthorById(int id)
        {
            var author = _authorServices.GetAuthorById(id);

            return(Ok(author));
        }
コード例 #4
0
 public async Task <ActionResult <Author> > GetAuthor(int id)
 {
     return(Ok(new { data = await _authorServices.GetAuthorById(id), success = true }));
 }