public HttpResponseMessage Update(QuestionsUpdateRequest req)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
            questionsService.Update(req);
            SuccessResponse response = new SuccessResponse();

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Exemplo n.º 2
0
 public void Update(QuestionsUpdateRequest req)
 {
     dataProvider.ExecuteNonQuery(
         "Question_update",
         delegate(SqlParameterCollection parameter)
     {
         parameter.AddWithValue("@id", req.Id);
         parameter.AddWithValue("@question", req.Question);;
         parameter.AddWithValue("@subject", req.Subject);
     }
         );
 }