コード例 #1
0
        public async Task <IActionResult> CreateMessage([FromBody, Bind("Text", "CatalogId", "Subject")] MessageViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var message = _mapper.Map <Message>(model);

            await _catalogService.CreateMessage(message);

            return(Created("", _mapper.Map <MessageViewModel>(message)));
        }