// PUT api/user/5 public bool Put([FromBody] User Usr) { ServiceResponse <User> Response = _userRepository.Update(Usr); if (Response.Error) { throw new HttpResponseException(this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, Response.Message)); } return(true); }
public void UpdateUser() { var users = new UserTable { UserId = 1002, FirstName = "NUNIT", LastName = "NUNIT", EmployeeId = 3, Deleted = false }; bool updated = user.Update(users.UserId, users); Assert.AreEqual(true, updated); }
public IHttpActionResult UpdateUser(UserTable Users) { if (ModelState.IsValid) { try { bl.Update(Users.UserId, Users); } catch (Exception) { return(Ok("Error is occured during updated !")); } return(Ok("Record is updated Sucessfully !")); } return(Ok()); }