hi,
I have an issue with Service.Gateway.SendAllAsync.
we import via a KafkaConsumer a message, which contains multiple datasets, where we have already existing Import request imlpementations.
The current implementation is like this:
public async Task PostAsync(kafkaImportRequest request)
{
await Gateway.SendAllAsync(request.ConvertTo<List<InternalRequest>>()); // for the convertion exists a RequestConverter, which is registered via the AutoMapping
}
public async Task PostAsync(InternalRequest request)
{
// do some stuff
}
for the Internal Request exists a Request Validator to make sure not import invalid data (AbstractValidator).
the problem is now, that forwarding the request using Gateway.SendAllAsync doesn’t execute the existing request Validator. The request will be forwarded to PostAsync(InternalRequest request) without that, which results in importing invalid data.
our current workaround is, to run over the list using an foreach and use Gateway.SendAsync(…) , which validates the request.
My question is, is there another way to forward the requests in one call with validation?