Friday, 15 March 2013

.net - Getting Room Appointments Efficiently from Exchange -



.net - Getting Room Appointments Efficiently from Exchange -

the problem

i need able appointment info meeting rooms using exchange managed api. have had service running month serves purpose fine using exchangeservice.getuseravailability() follows:

class="lang-cs prettyprint-override">private ienumerable<calendarevent> getevents(exchangeservice exchangeservice, string room, datetime time, datetime end) { list<attendeeinfo> attendees = new list<attendeeinfo>(); end = new datetime(time.ticks + math.max(end.ticks - time.ticks, time.adddays(1).ticks - time.ticks)); attendeeinfo roomattendee = new attendeeinfo(); roomattendee.attendeetype = meetingattendeetype.room; roomattendee.smtpaddress = getemailaddress(room); attendees.add(roomattendee); collection<calendarevent> events = exchangeservice.getuseravailability( attendees, new timewindow(time, end), availabilitydata.freebusy ).attendeesavailability[0].calendarevents; homecoming (from e in events e.endtime > time select e); }

however, have had extend service perform other tasks have required larger spans of time (gone 1 day several months). method becomes highly inefficient increment in time, , can throw errors when there many results.

the question

is efficient way of going this? have found no improve ways, grateful confirmation.

you can seek using exchangeservice.finditems enables :

use pagination fetch huge resultsets. select fields want server

specify searchfilter filter query server side :

from e in events e.endtime > time select e

.net wcf calendar exchange-server ews-managed-api

No comments:

Post a Comment