Пример #1
0
        public async Task <IActionResult> Post([FromBody] PeopleCreateCommand value)
        {
            if (ModelState.IsValid)
            {
                var result = await Mediator.Send(value);

                return(Ok(result));
            }
            return(NoContent());
        }
        public async Task <IActionResult> Create(PeopleCreateCommand command)
        {
            if (ModelState.IsValid)
            {
                await Mediator.Send(command);

                return(RedirectToAction(nameof(Index)));
            }

            return(View(command));
        }