예제 #1
0
        public async Task <CommandResult> Handle(RemoveMeasureCommand request, CancellationToken cancellationToken)
        {
            Measure measure = await _measureRepository.GetByIdAsync(request.MeasureId);

            if (!FoundValidMeasure(measure))
            {
                return(FailureDueToMeasureNotFound());
            }

            await _measureRepository.RemoveAsync(measure);

            return(await CommitAndPublishDefaultAsync());
        }