Exemplo n.º 1
0
        public void Lock(Topic topic)
        {
            var eventArgs = new TopicEventArgs()
            {
                Topic = topic
            };

            if (Locking.RaiseAndContinue(this, eventArgs))
            {
                topic.Locked = true;
                _databaseContext.Database.Save(topic);
                Locked.Raise(this, eventArgs);
            }
            else
            {
                CancelledByEvent.Raise(this, eventArgs);
            }
        }