public ActionResult Create(CRUDUserRequest user) { using (var client = new HttpClient()) { client.BaseAddress = new Uri(Constants.ProfileApiUrl); //HTTP Post var responseTask = client.PostAsJsonAsync("profiles/saveUser", user); responseTask.Wait(); var result = responseTask.Result; } return(RedirectToAction("GetUsers")); }
public ActionResult UpdateUserDetails(UserDetailsBO user) { CRUDUserRequest userResponse = new CRUDUserRequest { EmailId = user.EmailId, FirstName = user.FirstName, LastName = user.LastName, PhoneNumber = user.PhoneNumber, Status = user.Status, UserId = user.UserId }; using (var client = new HttpClient()) { client.BaseAddress = new Uri(Constants.ProfileApiUrl); //HTTP Post var responseTask = client.PostAsJsonAsync("profiles/saveUser", userResponse); responseTask.Wait(); var result = responseTask.Result; } return(RedirectToAction("GetUsers")); }
public IHttpActionResult SaveUserDetails([FromBody] CRUDUserRequest request) { try { UserDetailsBO userBO = new UserDetailsBO { EmailId = request.EmailId, FirstName = request.FirstName, LastName = request.LastName, PhoneNumber = request.PhoneNumber, Status = request.Status, UserId = request.UserId }; _profileService.SaveUserDetails(userBO); } catch (Exception ex) { return(InternalServerError()); } return(Ok()); }