Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Consider the following line of code:
AttendeeAvailability attendeeAvailability;
. . .
if (attendeeAvailability.WorkingHours.DaysOfTheWeek.Contains(DateTime.Today.DayOfWeek) == false)
{
. . .
}
You’ll get a compile time error -- Argument 1: cannot convert from 'System.DayOfWeek' to 'Microsoft.Exchange.WebServices.Data.DayOfTheWeek'
One way to resolve it is by converting it to a string representation and parsing into the Exchange library known data type, e.g.:
if (attendeeAvailability.WorkingHours.DaysOfTheWeek.Contains((DayOfTheWeek)Enum.Parse(typeof(DayOfTheWeek), DateTime.Today.DayOfWeek.ToString())) == false)
{
. . .
}