In your current implementation all update handlers share a scope because getUpdates can return more than one update at a time. I think it would be better if every individual update would have it's own scope. It can be achieved by using IServiceScopeFactory and explicitly creating scope for each update inside HandleUpdateAsync.
In your current implementation all update handlers share a scope because
getUpdates
can return more than one update at a time. I think it would be better if every individual update would have it's own scope. It can be achieved by usingIServiceScopeFactory
and explicitly creating scope for each update inside HandleUpdateAsync.