BindToItem method
Binds to multiple items in a single call to EWS.
The Ids of the items to bind to.
The set of properties to load.
The SmtpAddress of mailbox that hosts all items we need to bind to
Binds to item.
The item id.
The property set.
Implementation
//ServiceResponseCollection<GetItemResponse> BindToGroupItems(
// Iterable<ItemId> itemIds,
// PropertySet propertySet,
// string anchorMailbox)
// {
// EwsUtilities.ValidateParamCollection(itemIds, "itemIds");
// EwsUtilities.ValidateParam(propertySet, "propertySet");
// EwsUtilities.ValidateParam(propertySet, "anchorMailbox");
//
// return this.InternalBindToItems(
// itemIds,
// propertySet,
// anchorMailbox,
// ServiceErrorHandling.ReturnErrors);
// }
/// <summary>
/// Binds to item.
/// </summary>
/// <param name="itemId">The item id.</param>
/// <param name="propertySet">The property set.</param>
/// <returns>Item.</returns>
Future<Item?> BindToItem(ItemId? itemId, PropertySet propertySet) async {
EwsUtilities.ValidateParam(itemId, "itemId");
EwsUtilities.ValidateParam(propertySet, "propertySet");
ServiceResponseCollection<GetItemResponse> responses =
await this.InternalBindToItems(
[itemId],
propertySet,
null,
/* anchorMailbox */
ServiceErrorHandling.ThrowOnError);
return responses[0].Item;
}