Does anyone know of any way to bind to multiple items in a single EWS call, using the EWS Managed API, given only the ItemIds of the items in question?
Here's how my application works at the moment:
Trouble is, it doesn't take very long to process each item, so my code is spending about half of its time in Item.Bind(). It's probably not making the Exchange mailbox server tremendously happy either, having to satisfy a constant barrage of tiny queries. It seems to me it would be far more efficient to "batch up" the requests, loading properties for maybe 100 or so items at a time.
Right now, I'm sure you're asking - why not just skip the database and call ExchangeService.LoadPropertiesForItems() after each FindItems() call? Well... there's a definite possibility that this thing will be stopped before it's finished processing all the items. When it starts up again (maybe hours or days later), it needs to be able to resume from the point where it left off. The code that's using FindItems() is sufficiently non-trivial that it would be a total nightmare to figure out how to save its state for later resumption.
I've found Loading Properties for Multiple Items with One Call to Exchange Web Services, which explains that LoadPropertiesForItems() is using the EWS GetItem call behind the scenes. That does accept a list of ItemIds, but that functionality doesn't seem to be exposed through the Managed API (LoadPropertiesForItems() requires a list of already-bound Item objects, not just ItemIds).
So a few questions really:
ExchangeService.BindToItems is what you're looking for.