Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Extension methods not available in Scorable #35

Open
ankitbko opened this issue Aug 28, 2017 · 0 comments
Open

Extension methods not available in Scorable #35

ankitbko opened this issue Aug 28, 2017 · 0 comments

Comments

@ankitbko
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant