Beispiel #1
0
        public IActionResult Create([FromBody] CreateWordCommand command, [FromRoute] long dictid, [FromRoute] long themeid)
        {
            command.DictionaryId = dictid;
            command.ThemeId      = themeid;
            var result = _commandBus.Send(command);

            if (!result.IsValid())
            {
                var Error = (InvalidResult)result;
                return(BadRequest(Error.Errors));
            }

            long wordId = command.Id;

            return(RedirectToAction("Get", new { dictid = dictid, themeid = themeid, id = wordId }));
        }
        public async Task <IActionResult> Create([FromBody] CreateWordCommand command)
        {
            await Mediator.Send(command);

            return(NoContent());
        }