public IActionResult DeletePost(Post post)
        {
            User user = new User();

            user.Id = (int)HttpContext.Session.GetInt32("Id");
            _postLogic.DeletePost(post, user);
            return(RedirectToAction("Overview", "Profile"));
        }
Beispiel #2
0
        public async Task <IActionResult> DeleteConfirmed(int PostId)
        {
            ViewBag.UserId = HttpContext.Session.GetInt32("UserId");

            _postLogic.DeletePost(PostId);
            await _postLogic.Save();

            // Get userId from session variable
            //var userId = HttpContext.Session.GetInt32("userId");

            // redirect to Index
            // return RedirectToAction(nameof(DriverIndex), new { driverId = userId });
            return(RedirectToAction(nameof(Index), "User"));
        }
Beispiel #3
0
 // DELETE api/<controller>/5
 public void Delete(int Id)
 {
     PostLogic.DeletePost(Id);
 }