public ActionResult RequestAccess(int userId) { int userID = GetUserID(); var requestorID = Convert.ToInt32(userID); var viewModel = new CollectionAccessViewModel(); viewModel.Requester = _userService.GetUserByID(requestorID); viewModel.Requester_ID = requestorID; viewModel.Owner = _userService.GetUserByID(userId); viewModel.Owner_ID = userId; var data = Mapper.Map <CollectionAccessViewModel, CollectionAccess>(viewModel); _requestService.AddCollectionRequest(data); return(Json("Success")); }