Exemple #1
0
        public TaskCategoryModel UpdateCategory(TaskCategoryModel category)
        {
            if (IsCategoryNull(category))
            {
                throw new Exception("Cannot be update empty category.");
            }

            if (IsCategoryPropertiesNull(category))
            {
                throw new Exception("Cannot be update category with empty properties.");
            }

            var updateCategory = _mapper.Map <TaskCategoryEntity>(category);

            _taskCategoryRepository.UpdateCategory(updateCategory);
            return(category);
        }