示例#1
0
        //[Authorize(Policy = "CanCreateSchoolingEvent")]
        public async Task <IActionResult> Post([FromBody] CreateSchoolingEventViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(Response(viewModel));
            }

            viewModel.Id = Guid.NewGuid();

            await _schoolingEventService.Create(viewModel);

            return(Response(viewModel));
        }
        public async Task Create(CreateSchoolingEventViewModel viewModel)
        {
            var command = Mapper.Map <CreateNewSchoolingEventCommand>(viewModel);

            await _bus.SendCommand(command);
        }