Hi, About the subscription Topic at the end: The solution is having the Subscription return Type "IAsyncEnumerable". It seems, that the interface is checked directly. If you return the IEventStream hc sais it cannot cast the type (As seen in the exception), even though it implements IAsyncEnumerable. Here a snippet from my subscription: [SubscribeAndResolve] public async ValueTask UserUpdated([Service] ITopicEventReceiver receiver) { return await receiver.SubscribeAsync(Channels.UserUpdated); } Another cause of error will be that the ITopicEventReceiver has to be injected as service, otherwise hc interpret it as parameter (or you use SubscriptionType and do it manually). Cheers!
Alright! That was really hot. 🙏 Will embark on it soon.
Hi,
About the subscription Topic at the end:
The solution is having the Subscription return Type "IAsyncEnumerable". It seems, that the interface is checked directly. If you return the IEventStream hc sais it cannot cast the type (As seen in the exception), even though it implements IAsyncEnumerable. Here a snippet from my subscription:
[SubscribeAndResolve]
public async ValueTask UserUpdated([Service] ITopicEventReceiver receiver)
{
return await receiver.SubscribeAsync(Channels.UserUpdated);
}
Another cause of error will be that the ITopicEventReceiver has to be injected as service, otherwise hc interpret it as parameter (or you use SubscriptionType and do it manually).
Cheers!
Very helpful, Thanks !
I did the exact same thing, but I don't have the possibiltiy to add middlewares to my queries. Has it changed?
How does this work with microservices?
At 46:15 - Don't you have to follow any order here like:
1. UseSelection
2. UseFiltering
3. UseSorting
4. UsePaging
This is very hot stuff!