public IHttpActionResult CreateAnswerHistory([FromBody] AnswerHistoryModel answerHistory) { AnswerHistoryDTO answerHistoryDTO; try { answerHistoryDTO = _answerHistoryService.Insert(Mapper.Map <AnswerHistoryModel, AnswerHistoryDTO>(answerHistory)); } catch (Exception ex) { return(InternalServerError()); } return(Ok(Mapper.Map <AnswerHistoryDTO, AnswerHistoryModel>(answerHistoryDTO))); }
public IHttpActionResult UpdateAnswerHistory([FromBody] AnswerHistoryModel answerHistory) { bool updateResult; try { updateResult = _answerHistoryService.Update(Mapper.Map <AnswerHistoryModel, AnswerHistoryDTO>(answerHistory)); } catch (Exception ex) { return(InternalServerError(ex)); } if (updateResult) { return(Ok()); } else { return(BadRequest()); } }