public HttpResponseMessage UpdateEvent(EventFormUpdateRequest model) { if (!ModelState.IsValid) { return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } SuccessResponse response = new SuccessResponse(); _eventsService.Update(model); return Request.CreateResponse(response); }
public void Update(EventFormUpdateRequest model) { DataProvider.ExecuteNonQuery(GetConnection, "dbo.Events_Update" , inputParamMapper: delegate (SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@Title", model.Title); paramCollection.AddWithValue("@Description", model.Description); paramCollection.AddWithValue("@EventTime", model.EventTime); paramCollection.AddWithValue("@VenueName", model.VenueName); paramCollection.AddWithValue("@Url", model.Url); paramCollection.AddWithValue("@Type", model.Type); paramCollection.AddWithValue("@Tags", model.Tags); paramCollection.AddWithValue("@Id", model.Id); }, returnParameters: delegate (SqlParameterCollection param) { //Int32.TryParse(param["@Id"].Value.ToString(), out id); } ); }