private static Dictionary <string, ReferenceType> GetAdminVdcRefs( vCloudClient client, string url) { try { Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_URL_MSG) + " - " + url); VdcReferencesType vdcReferencesType = SdkUtil.Get <VdcReferencesType>(client, url, 200); Dictionary <string, ReferenceType> dictionary = new Dictionary <string, ReferenceType>(); if (vdcReferencesType.VdcReference != null) { dictionary = ((IEnumerable <ReferenceType>)vdcReferencesType.VdcReference).ToDictionary <ReferenceType, string, ReferenceType>((Func <ReferenceType, string>)(vdcReference => vdcReference.name), (Func <ReferenceType, ReferenceType>)(vdcReference => vdcReference)); } return(dictionary); } catch (Exception ex) { throw new VCloudException(ex.Message); } }
private static Dictionary <string, ReferenceType> GetAdminVdcRefs( vCloudClient client, string url) { try { Dictionary <string, ReferenceType> dictionary = new Dictionary <string, ReferenceType>(); Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_URL_MSG) + " - " + url); VdcReferencesType vdcReferencesType = SdkUtil.Get <VdcReferencesType>(client, url, 200); if (vdcReferencesType.VdcReference != null) { foreach (ReferenceType referenceType in vdcReferencesType.VdcReference) { dictionary.Add(referenceType.name, referenceType); } } return(dictionary); } catch (Exception ex) { throw new VCloudException(ex.Message); } }