示例#1
0
        public async Task <IActionResult> CreateOneAsync(
            [FromBody] CreatePublicationDto createPublicationDto
            )
        {
            var item = await _publicationService.CreateOneAsync(createPublicationDto);

            return(Ok(item));
        }
示例#2
0
        public async Task <IActionResult> CreateOneAsync(
            [FromBody] CreatePublicationDto createPublicationDto
            )
        {
            try
            {
                var created = await _publicationService.CreateOneAsync(createPublicationDto);

                return(Ok(created));
            }
            catch (Exception e)
            {
                return(HttpExceptionMapper.ToHttpActionResult(e));
            }
        }