public IActionResult Update(string id, GroupQuestionModel groupQuestionModel) { if (ModelState.IsValid) { var updateCat = _groupQuestionService.Update(id, base.UserId, groupQuestionModel); } return(Ok()); }
public IActionResult Create(GroupQuestionModel groupQuestionModel) { if (ModelState.IsValid) { var newCat = _groupQuestionService.Insert(base.UserId, groupQuestionModel); } return(Ok()); }
public GroupQuestionModel Insert(string userCurrentId, GroupQuestionModel groupQuestion) { try { var newGQuestion = _mapper.Map<GroupQuestion>(groupQuestion); newGQuestion.CreatedBy = userCurrentId; newGQuestion.Slug = StringHelper.ToUrlFriendly(groupQuestion.Name); _groupQuestionRepo.Insert(newGQuestion); return groupQuestion; } catch { throw; } }
public GroupQuestionModel Update(string groupQuestionId, string userCurrentId, GroupQuestionModel groupQuestion) { try { var updateGQuestion = _groupQuestionRepo.GetById(groupQuestionId); _mapper.Map(groupQuestion, updateGQuestion); updateGQuestion.LastUpdatedBy = userCurrentId; _groupQuestionRepo.Update(updateGQuestion); return groupQuestion; } catch { throw; } }