public async Task <IActionResult> DeletePostConfirmed(long id) { var post = await _groupRepository.GetPostByIdAsync(id); var groupId = post.Group.Id; await _groupRepository.DeletePostAsync(post); return(RedirectToAction(nameof(Details), new { id = groupId })); }