Esempio n. 1
0
        public async Task Handle(CreateCategoryCommand command)
        {
            var mainCategory = await _mainCategoryRepository.GetByIdAsync(command.MainCategoryId);

            var category = new Category(command.Title, command.IsActive, command.ImageName);

            mainCategory.AddFirstLevelOfCategory(category);

            _mainCategoryRepository.Update(mainCategory);
        }
 public async Task Edit(CategoryDTO editDTO)
 {
     _mainCategoryRepository.Update(_Mapper.Map <MainCategories>(editDTO));
     await _mainCategoryRepository.Commit();
 }