private async Task <OrganizationDetailCollection> RetrieveOrganizationsAsync(ConnectionDetail currentDetail) { WebRequest.GetSystemWebProxy(); var service = await CrmConnectionHelper.GetDiscoveryServiceAsync(currentDetail); var request = new RetrieveOrganizationsRequest(); var response = (RetrieveOrganizationsResponse)service.Execute(request); return(response.Details); }
private async Task <OrganizationDetail> RetrieveOrganizationAsync(ConnectionDetail currentDetail) { if (currentDetail.OrganizationId == null) { return(null); } WebRequest.GetSystemWebProxy(); var service = await CrmConnectionHelper.GetDiscoveryServiceAsync(currentDetail); var request = new RetrieveOrganizationsRequest(); var response = (RetrieveOrganizationsResponse)service.Execute(request); return(response.Details.Where(d => d.OrganizationId == new Guid(currentDetail.OrganizationId)).FirstOrDefault()); }