public async Task Delete(int id) { var forum = GetById(id); var posts = _postService.GetPostsByForumId(id); foreach (var post in posts) { var postsReplies = _postReplyService.GetPostsRepliesByPostId(post.Id); await _postReplyService.DeletePostRepliesList(postsReplies); } await _postService.DeletePostList(posts); _context.Remove(forum); await _context.SaveChangesAsync(); }