public async Task <IActionResult> Create(SkillEditViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            var skillGroup = new SkillModel
            {
                SkillGroupId     = viewModel.SkillGroupId,
                SkillTypeId      = viewModel.SkillTypeId,
                SkillName        = viewModel.SkillName,
                SkillDescription = viewModel.SkillDescription,
            };

            await _skillService.AddAsync(skillGroup);

            return(RedirectToAction(nameof(Index)));
        }
Beispiel #2
0
        public async Task <IActionResult> PostAsync([FromBody] SkillCreationModel skill)
        {
            await _skillService.AddAsync(_mapper.Map <SkillCreationModel, SkillServiceModel>(skill));

            return(Ok());
        }