public ActionResult Edit([Bind(Include = "Id,Name")] QuestionTypeVM questionTypeVM) { if (ModelState.IsValid) { QuestionTypeDTO questionTypeDTO = Mapper.Map <QuestionTypeDTO>(questionTypeVM); QuestionTypeService.Update(questionTypeDTO); return(RedirectToAction("Index")); } return(View(questionTypeVM)); }
public IActionResult Update([FromBody] QuestionType questionType, int id) { if (!ModelState.IsValid) { return(BadRequest()); } questionType.Id = id; _service.Update(questionType); return(Ok(questionType)); }