I'm building an object model layer on top of EWS, and am exposing an object that is an EmailMessage, internally, that has several standard properties which I load on startup, and allow the user to have different "views" on that object (ViewAsEntity1, ViewAsEntity2) which loads other custom properties on demand (some are Extended Properties, some Internet Headers).
The problem is that I call Item.Bind() with one PropertySet (the standard properties), but when the user asks to ViewAsEntity1, I call ServiceObject.Load() with the new PropertySet, which either means I lose the original set of properties, or I re-retrieve them.
So my question are:
1) If I call ServiceObject.Load twice, with the same properties in the PropertySet, does Exchange really send the same data over, or does it assume I already have it cached (if it is unchanged), and doesn't send it again? And if so, does EWS know not to clobber the existing data in the PropertyBag?
2) If the answer to #1 is no, what's the best way to avoid expensive EWS calls again and again? I was hoping to keep my Object Model layer thin and simply refer calls to properties into the internal EWSItem object, but if #1 is wrong, I guess I'll have to copy all the data to my objects manually. Is there a better way?
I'm using .NET 4.5, Managed EWS 2.0 and Exchange 2010 SP1