public async Task <Result <int> > Handle(DeleteExpenseCategoryCommand command, CancellationToken cancellationToken)
            {
                var expenseCategory = await _repository.GetByIdAsync(command.Id);

                await _repository.DeleteAsync(expenseCategory);

                await _unitOfWork.Commit(cancellationToken);

                return(Result <int> .Success(expenseCategory.Id));
            }
            public async Task <Response <int> > Handle(DeleteExpenseCategoryCommand request, CancellationToken cancellationToken)
            {
                var category = await _categoryRepository.GetByIdAsync(request.Id);

                if (category == null)
                {
                    throw new ApiException("Category not Found.");
                }
                await _categoryRepository.DeleteAsync(category);

                await _unitOfWork.Commit(cancellationToken);

                return(new Response <int>(category.Id));
            }
 public async Task DeleteAsync(int categoryId)
 {
     await _repository.DeleteAsync(categoryId);
 }