繁体   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