public async Task <DeleteCustomerAddressCommandResponse> Handle(DeleteCustomerAddressCommand command) { var customer = await _repository.AsQuery().SingleOrDefaultAsync(p => p.UserId == command.UserId); if (customer == null) { throw new DomainException("مشتری یافت نشد"); } _personDomainService.AddressIsDefaultAddress(customer, command.CustomerAddressId); var address = customer.CustomerAddresses.SingleOrDefault(p => p.Id == command.CustomerAddressId); if (address == null) { throw new DomainException("ادرس یافت نشد"); } customer.CustomerAddresses.Remove(address); return(new DeleteCustomerAddressCommandResponse()); }