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); } }
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); }