public IHttpActionResult Put(CommentVoteAddRequest model) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _commentVoteService.Put(model); return(Ok(new SuccessResponse())); } catch (Exception ex) { _errorLogService.Post(new Models.Requests.Logs.ErrorLogAddRequest { ErrorSourceTypeId = 1, Message = ex.Message, StackTrace = ex.StackTrace, Title = "Error in " + GetType().Name + " " + System.Reflection.MethodBase.GetCurrentMethod().Name }); return(BadRequest(ex.Message)); } }
public void Put(CommentVoteAddRequest model) { DataProvider.ExecuteNonQuery("dbo.Comments_CommentVote_Update", inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@upvote", model.Upvote); paramCollection.AddWithValue("@downvote", model.Downvote); paramCollection.AddWithValue("@commentId", model.CommentId); }); }