public void Delete(Topic topic) { var eventArgs = new TopicEventArgs() { Topic = topic }; if (Deleting.RaiseAndContinue(this, eventArgs)) { _databaseContext.Database.Delete(topic); Deleted.Raise(this, eventArgs); } else { CancelledByEvent.Raise(this, eventArgs); } }
public void Delete(Models.Forum forum) { var eventArgs = new ForumEventArgs() { Forum = forum }; if (Deleting.RaiseAndContinue(this, eventArgs)) { _databaseContext.Database.Delete(forum); Deleted.Raise(this, eventArgs); } else { CancelledByEvent.Raise(this, eventArgs); } }
public void Delete(Comment comment) { var eventArgs = new CommentEventArgs() { Comment = comment }; if (Deleting.RaiseAndContinue(this, eventArgs)) { UpdateTopicPostsCount(comment, false); _databaseContext.Database.Delete(comment); Deleted.Raise(this, eventArgs); } else { CancelledByEvent.Raise(this, eventArgs); } }