Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Best practices for instantiating ExchangeService? (DI Lifetime) #62

Open
Meligy opened this issue Mar 3, 2022 · 1 comment
Open

Comments

@Meligy
Copy link

Meligy commented Mar 3, 2022

Hello,
For the ExchangeService class, are you supposed to create a new instance whenever you need it, or should you try to reuse the same instance whenever possible?

For example, if you are registering it in Microsoft DI, should be singleton/scoped, or should it be transient?

@ricardodemauro
Copy link

I'm using it as Singleton because I'm making a single call on AutoDiscovery (which takes a lot of time to process).

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

No branches or pull requests

2 participants