private void findDeletedTopics(TopicToken original, TopicToken @new)
        {
            var deletedTopics = original.All().Where(x => @new.Find(x.Id) == null)
                                .Select(x => new DeleteTopic(x));

            _deltas.AddRange(deletedTopics);
        }
Example #2
0
        public IEnumerable <IDelta> DetermineDeltas(TopicToken originalRoot)
        {
            var original = originalRoot.Find(Id);

            if (original == null)
            {
                yield return(new NewTopic(this));
            }
            else
            {
                if (original.File != File)
                {
                    yield return(new MoveTopic(original.File, File));
                }

                if (original.Title != Title)
                {
                    yield return(new RewriteTitle(File, Title));
                }

                if (original.Url != Url)
                {
                    yield return(new RewriteUrl(File, Url));
                }
            }
        }