EntityCollection _ReqAttendees = _appointmentContext.GetAttributeValue<EntityCollection>("requiredattendees"); if ((_ReqAttendees != null) && (_ReqAttendees.Entities.Count > 0)) { foreach (var _party in _ReqAttendees.Entities) { if (_party.GetAttributeValue<EntityReference>("partyid").LogicalName == "contact") { // Do the work // Contact ID : _party.GetAttributeValue<EntityReference>("partyid").Id } } }
Hope this is helpful.