コード例 #1
0
        public async Task <IActionResult> GetAuthors(GenericQuery query)
        {
            try
            {
                var authors = await authorsRepository.GetAuthorsAsync(query);

                return(Ok(mapper.Map <QueryResult <Author>, QueryResultResource <AuthorResource> >(authors)));
            }
            catch (System.Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }