Beispiel #1
0
 public void AddCategory(CategoryRequest request)
 {
     try
     {
         categoryRepository.AddEntity(BuildCategoryFromRequest(request));
     }catch (RepositoryException e)
     {
         throw new OperationException(e.Message, e);
     }
 }
        public IActionResult AddCategory([FromBody] CategoryData value)
        {
            var Category = new Category
            {
                Id   = Guid.NewGuid(),
                Name = value.Name
            };

            _categoryRepository.AddEntity(Category);
            return(Ok(Category));
        }
Beispiel #3
0
 public void AddCategory(Category category)
 {
     categoryRepository.AddEntity(category);
 }