public HttpResponseMessage EditUserInfo(UserInfoUpdate model, int id) { if (!ModelState.IsValid) { return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } SucessResponse response = new SucessResponse(); _userDataService.Update(model); return Request.CreateResponse(response); }
public void Update(UserInfoUpdate model) { DataProvider.ExecuteNonQuery(GetConnection, "dbo.Users_Update", inputParamMapper: delegate (SqlParameterCollection u) { u.AddWithValue("@Id", model.Id); u.AddWithValue("@FirstName", model.FirstName); u.AddWithValue("@LastName", model.LastName); u.AddWithValue("@UserName", model.UserName); u.AddWithValue("@Email", model.Email); u.AddWithValue("@Phone", model.Phone); u.AddWithValue("@Gender", model.Gender); u.AddWithValue("@Bio", model.Bio); u.AddWithValue("@CoverPhotoId", model.CoverPhotoId); u.AddWithValue("@AvatarPhotoId", model.AvatarPhotoId); }); }