public async Task <IActionResult> CreateCategory(CreateCategoryDTO dto)
        {
            var category = Data.Domain.Entities.Forum.Category.Create(dto.Name, dto.Description);
            await _categoryRepo.Add(category);

            await _categoryRepo.Save();

            return(RedirectToAction("Index", "AdminPanel"));
        }
Beispiel #2
0
        public bool CreateForumCategory(ForumCategory forumCategory)
        {
            bool flag = false;

            try
            {
                _forumCategoryRepository.Add(forumCategory);
                _unitOfWork.Commit();
                flag = true;
            }
            catch { }

            return(flag);
        }