public override async Task <SubscriberHasPermissionCommandResponse> Handle(SubscriberHasPermissionCommand request, CancellationToken cancellationToken) { var subscription = await subscriberRepository.GetSubscriptionByUserId(request.UserId); if (subscription != null) { var granted = subscription.HasPermission(request.ProductNumber); return(new SubscriberHasPermissionCommandResponse() { CommandId = request.CommandId, Granted = granted }); } else { throw new Exception($"{nameof(SubscriberHasPermissionCommandHandler)}: Subscription for user '{request.UserId}' not found."); } }