public void Update(SMEUpdateRequest model) { DataProvider.ExecuteNonQuery("dbo.SME_Update" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@Id", model.Id); paramCollection.AddWithValue("@ModBy", model.ModifiedBy); paramCollection.AddWithValue("@MaxInt", model.MaxInteractionsPer1k); paramCollection.AddWithValue("@MinInt", model.MinInteractionsPer1k); paramCollection.AddWithValue("@SumInt", model.SumInteractionsPer1k); } ); }
// PUT api/sme public HttpResponseMessage Update(SMEUpdateRequest model) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } try { _SMEService.Update(model); return(Request.CreateResponse(HttpStatusCode.OK, new SuccessResponse())); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex)); } }