Esempio n. 1
0
        public async Task <IActionResult> ItemsPost(string values)
        {
            var entity = new NcScenarioItem();

            ScenarioItemViewModel viewModel;

            if (!this.TryValidateViewModelAndPopulate(values, entity, mapper, out viewModel))
            {
                return(this.GetBadRequestWithFullErrorMessage <ScenarioItemViewModel>(ModelState));
            }

            await scenarioRepository.InsertItemAsync(entity);

            return(Ok(viewModel));
        }