I want to use AuthBot in a Scorable. The Scorable will act as middleware and make sure the user is authenticated before allowing Dialogs to take over.
Now this works quite fine. The problem is that I don't have access to IBotContext in Scorable. Autofac will throw error if you try to get it from constructor. This means that I can't use any of the extensions to get token.
If I re-implement the extensions on IBotData instead, everything works. In fact IBotContext derives from IBotData. But this approach just leads to code duplication. I had literally copy pasted the entire code and just modified it to extend on IBotData. The only drawback is that we can't use context.PostAsync to send reply back to user.
Any thoughts on moving the extension methods to IBotData?
I want to use AuthBot in a Scorable. The Scorable will act as middleware and make sure the user is authenticated before allowing Dialogs to take over.
Now this works quite fine. The problem is that I don't have access to
IBotContext
in Scorable. Autofac will throw error if you try to get it from constructor. This means that I can't use any of the extensions to get token.If I re-implement the extensions on
IBotData
instead, everything works. In factIBotContext
derives fromIBotData
. But this approach just leads to code duplication. I had literally copy pasted the entire code and just modified it to extend onIBotData
. The only drawback is that we can't usecontext.PostAsync
to send reply back to user.Any thoughts on moving the extension methods to
IBotData
?