public IActionResult Delete(int id) { IActionResult response = null; string mess = string.Empty; UserModels userModels = new UserModels(); var identity = (ClaimsIdentity)User.Identity; IEnumerable <Claim> claims = identity.Claims; var userLogin = claims.FirstOrDefault(c => c.Type == ClaimTypes.Email).Value; UserPage userPage = userModels.GetUserPagebyId(id); if (userPage != null) { //// delete UserPageAction bool rt = userModels.DeleteUserPage(userPage.Id); if (rt) { response = Json(new { code = Constant.Success, message = Constant.MessageDeleteCompleted }); } else { response = Json(new { code = Constant.Fail, message = Constant.MessageDeleteUncompleted }); } } else { response = Json(new { code = Constant.NotExist, message = Constant.MessageNotExist }); } return(response); }