public IHttpActionResult Post([FromBody] QuestionVM questionVM) { if (questionVM == null || !questionVM.isWalid()) { return(BadRequest()); } _questionService.AddQuestion(Mapper.Map <QuestionDTO>(questionVM)); return(Ok()); }
public IHttpActionResult Put(int?id, [FromBody] QuestionVM questionVM) { if (id == null || questionVM == null || !questionVM.isWalid()) { return(BadRequest()); } try { _questionService.Change(id.GetValueOrDefault(), Mapper.Map <QuestionDTO>(questionVM)); } catch (BILException myExc) { return(InternalServerError(myExc)); } return(Ok()); }