public HttpResponseMessage UpdateHandle(HandleUpdateRequest model) { if (!ModelState.IsValid) { return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } string userId = _userService.GetCurrentUserId(); _userService.UpdateHandle(model, userId); SuccessResponse response = new SuccessResponse(); return Request.CreateResponse(HttpStatusCode.OK, response); }
public void UpdateHandle(HandleUpdateRequest model, string userId) { DataProvider.ExecuteNonQuery(GetConnection, "dbo.Users_UpdateHandle" , inputParamMapper: delegate (SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@Handle", model.Handle); paramCollection.AddWithValue("@Avatar", model.Avatar); paramCollection.AddWithValue("@FirstName", model.FirstName); paramCollection.AddWithValue("@LastName", model.LastName); paramCollection.AddWithValue("@UserId", userId); } , returnParameters: delegate (SqlParameterCollection param) { } ); }