ews-managed-api icon indicating copy to clipboard operation
ews-managed-api copied to clipboard

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

Open Meligy opened this issue 3 years ago • 1 comments

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?

Meligy avatar Mar 03 '22 03:03 Meligy

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

ricardodemauro avatar Oct 20 '22 15:10 ricardodemauro