public Newsletter Clone(Newsletter newsletter)
 {
     return _cloneNewsletterService.Clone(newsletter);
 }
 public void Delete(Newsletter newsletter)
 {
     _session.Transact(session => session.Delete(newsletter));
 }
 public void Add(Newsletter newsletter)
 {
     _session.Transact(session => session.Save(newsletter));
 }
 public void Edit(Newsletter newsletter)
 {
     _session.Transact(session => session.Update(newsletter));
 }
        public Newsletter Clone(Newsletter newsletter)
        {
            var clone = new Newsletter
            {
                NewsletterTemplate = newsletter.NewsletterTemplate,
                Name = newsletter.Name,
                ContentItems = new List<ContentItem>()
            };

            foreach (var item in newsletter.ContentItems.OrderBy(x => x.DisplayOrder))
            {
                var type = item.GetType();
                if (CloneContentItemTypes.ContainsKey(type))
                {
                    var cloneType = CloneContentItemTypes[type];
                    var cloner = _kernel.Get(cloneType) as CloneContentItemBase;
                    if (cloner != null)
                    {
                        var contentItem = cloner.Clone(item);
                        contentItem.DisplayOrder = item.DisplayOrder;
                        contentItem.Name = item.Name;
                        contentItem.Newsletter = clone;
                        clone.ContentItems.Add(contentItem);
                    }
                }
            }

            _session.Transact(session =>
            {
                session.Save(clone);
                foreach (var item in clone.ContentItems)
                {
                    session.Save(item);
                }
            });

            return clone;
        }