Esempio n. 1
0
        public override Category GetCategoryByName(string name, bool throwIfNotFound)
        {
            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                CategoryDataStore dataStore = new CategoryDataStore(transaction);

                Category category = dataStore.FindByName(name);
                if (category == null && throwIfNotFound)
                {
                    throw new ForumCategoryNotFoundException(name);
                }
                else if (category == null)
                {
                    return(null);
                }

                return(category);
            }
        }