Ejemplo n.º 1
0
        public async Task <Unit> Handle(DeleteRepoCommand request, CancellationToken cancellationToken)
        {
            var existingRepo = await _repoRepository.GetById(request.Id);

            if (existingRepo == null)
            {
                throw new Exception("Repository not found. Delete failed.");
            }

            await _repoRepository.Remove(request.Id);

            return(Unit.Value);
        }