Пример #1
0
        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);
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
            }
        }