Example #1
0
        public DbRepoStatusCode ActivateContentCategory(int categoryId, string isActive)
        {
            using (var context = new ApplicationDbContext())
            {
                var contentCategory = context.ContentCategories.SingleOrDefault(c => c.Id == categoryId);

                if (contentCategory == null)
                {
                    return(DbRepoStatusCode.NotFound);
                }

                _categoryManageService.ActivateContentCategory(contentCategory, isActive);

                context.SaveChanges();

                return(DbRepoStatusCode.Success);
            }
        }
Example #2
0
        public void ActivateContentCategory(string request, bool isActive)
        {
            _contentCategoryManageService.ActivateContentCategory(_contentCategory, request);

            Assert.AreEqual(_contentCategory.IsActive, isActive);
        }