簡體   English   中英

使用EWS托管API 2.0在一個服務調用中更新約會

[英]Update appointments in one service call using EWS managed API 2.0

我正在為每個現有約會設置一個自定義擴展屬性,如下所示:

var extendedPropertyDefinition = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "RateTheMeetingId24", MapiPropertyType.Integer);
var propertySet = new PropertySet(PropertySet.FirstClassProperties) { extendedPropertyDefinition };
appointment.Load(propertySet);
appointment.SetExtendedProperty(extendedPropertyDefinition, meetingId);

然后我要更新約會:

appointment.Update(ConflictResolutionMode.AlwaysOverwrite);

它工作正常,但是非常慢,因為Update()創建了一個調用以交換每個約會。 我想在一個電話中更新會議。 我可以使用設置的自定義屬性列出我的約會清單,然后我想使用類似的方法:

UpdateAppointment(List<Appointment> appointmentsWithExtendedPropertySetted)
{
    appointmentsWithExtendedPropertySetted.UpdateAll();
}

我在MSDN中找到有關UpdateItems方法的參考: ExchangeService.UpdateItems方法

但我不知道如何使用它。

我得到了如何解決我的MSDN論壇上的問題的方法: 在一個服務呼叫中更新約會

我需要一次為一個約會設置屬性,然后將其添加到批處理中,在為所有約會設置屬性后,我需要對約會批處理使用_service.UpdateItems()方法:

pulic void UpdateAppointments(List<Item> _updateBatch)
{
    Service.UpdateItems(upUpdateBatch, Folder.Id, ConflictResolutionMode.AlwaysOverwrite, MessageDisposition.SaveOnly, SendInvitationsOrCancellationsMode.SendToNone);
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM