Beispiel #1
0
        public async Task <IActionResult> Delete(int?ReplyId)
        {
            if (ReplyId != null)
            {
                ReplyModel reply = await _db.Replies.Include(p => p.Pictures).FirstOrDefaultAsync(i => i.Id == ReplyId);

                TopicModel topic = await _db.Topics.FirstOrDefaultAsync(i => i.Id == reply.TopicId);


                _db.DeleteReply(reply, topic);

                await _db.SaveChangesAsync();

                return(RedirectToAction("OpenTopic", "SingleForum", new { TopicId = topic.Id }));
            }
            return(NotFound());
        }