Ejemplo n.º 1
0
        public ActionResult Remove(long domain_id)
        {
            using (DomainRepository domain_repository = new DomainRepository())
            {
                domain_repository.Remove(domain_id);

                using (ContentRepository content_repository = new ContentRepository())
                {
                    foreach (var item in content_repository.GetByDomain(domain_id))
                    {
                        ModelUtility.RemoveContent(item.content_id);
                    }
                }

                using (TemplateRepository template_repository = new TemplateRepository())
                {
                    template_repository.RemoveByDomain(domain_id);
                }

                using (ViewRepository view_repository = new ViewRepository())
                {
                    view_repository.RemoveByDomain(domain_id);
                }

                using (BlockRepository block_repository = new BlockRepository())
                {
                    block_repository.RemoveByDomain(domain_id);
                }

                using (VariableRepository variable_repository = new VariableRepository())
                {
                    variable_repository.RemoveByDomain(domain_id);
                }

                using (TagRepository tag_repository = new TagRepository())
                {
                    tag_repository.RemoveByDomain(domain_id);
                }
            }

            return(RedirectToAction("Index"));
        }