protected override async Task Handle(Command request, CancellationToken cancellationToken)
            {
                var utilityBill = await _repository.Get(request.Id);

                if (utilityBill is null)
                {
                    throw new Exception("Utility Bill doesn't exist");
                }

                await _repository.Delete(utilityBill);
            }
Exemple #2
0
            protected override async Task Handle(Command request, CancellationToken cancellationToken)
            {
                var utilityBill = await _repository.Get(request.Id);

                if (utilityBill is null)
                {
                    throw new Exception("Utility Bill doesn't exist!");
                }

                MapUtilityBillViewToModel(utilityBill, request);
                await _repository.Update(utilityBill);
            }