Пример #1
0
        public async Task <IActionResult> GetPublications()
        {
            try
            {
                var resp = _mapper.Map <List <PublicationDTO> >(await _publicationServices.GetPublications());

                if (resp == null)
                {
                    return(NotFound(resp));
                }

                return(Ok(resp));
            }
            catch (Exception e)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, new { message = e.Message }));
            }
        }