public HttpResponseMessage PaymentsUpdate(PaymentsUpdateRequest model) { if (!ModelState.IsValid) { return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } SuccessResponse response = new SuccessResponse(); _paymentsService.Update(model); return Request.CreateResponse(response); }
//end Add public void Update(PaymentsUpdateRequest model) { DataProvider.ExecuteNonQuery(GetConnection, "dbo.Payments_UpdateById" , inputParamMapper: delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@LoanAmount", model.LoanAmount); paramCollection.AddWithValue("@LoanTerm", model.LoanTerm); paramCollection.AddWithValue("@LoanApr", model.LoanApr); paramCollection.AddWithValue("@PurchasePrice", model.PurchasePrice); paramCollection.AddWithValue("@CarMake", model.CarMake); paramCollection.AddWithValue("@CarModel", model.CarModel); paramCollection.AddWithValue("@CarYear", model.CarYear); paramCollection.AddWithValue("@CarCondition", model.CarCondition); paramCollection.AddWithValue("@Id", model.Id); //paramCollection.AddWithValue("@UserId", userId); }, returnParameters: delegate(SqlParameterCollection param) { } ); }