public override void DeleteCategory(Category category)
        {
            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                CategoryDataStore dataStore = new CategoryDataStore(transaction);

                // Delete should only be allowed if the following conditions are true:
                // 1. There are no child categories.
                if (dataStore.FindAllChildren(category.Id).Count > 0)
                {
                    throw new SchemaIntegrityException("Category has child categories");
                }

                // 2. There are no articles associated with this category.
                ItemDataStore ads = new ItemDataStore(transaction);
                if (ads.FindByCategory(category).Count > 0)
                {
                    throw new SchemaIntegrityException("News items are associated with this category");
                }

                // Delete all Access records.
                AccessDataStore accessDs  = new AccessDataStore(transaction);
                IList <Access>  allAccess = accessDs.FindAllByItem(category.Id);

                foreach (Access access in allAccess)
                {
                    access.Deleted = true;
                    accessDs.Update(access);
                }

                category.Deleted = true;
                category.Name   += DateTimeHelper.GetCurrentTimestamp();
                dataStore.Update(category);

                transaction.Commit();
            }
        }
        public override IList <Item> GetItems(Category category, bool recursive)
        {
            IList <Item> items = null;

            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                ItemDataStore dataStore = new ItemDataStore(transaction);
                items = dataStore.FindByCategory(category);
                if (recursive)
                {
                    CategoryDataStore ds       = new CategoryDataStore(transaction);
                    IList <Category>  children = ds.FindAllChildren(category.Id);
                    foreach (Category child in children)
                    {
                        IList <Item> childItems = GetItems(child, recursive);
                        foreach (Item item in childItems)
                        {
                            items.Add(item);
                        }
                    }
                }
            }
            return(items);
        }