Exemple #1
0
 public async Task UpdateCategoryAsync(CategoryDTO category)
 {
     if (Get(category.Id) == null)
     {
         throw new Exception("Taki produkt nie istnieje");
     }
     else
     {
         Shop.Core.Domain.Category model = new Shop.Core.Domain.Category(category.Id, category.Name, category.Description);
         await categoryRepository.UpdateCategoryAsync(model);
     }
 }
Exemple #2
0
 public async Task AddCategory(CreateCategoryDTO category)
 {
     Shop.Core.Domain.Category model = new Shop.Core.Domain.Category(category.Id, category.Name, category.Description);
     await categoryRepository.AddCategory(model);
 }