public static string GetAASNameForAssetId(string assetId) { try { assetId = WebUtility.UrlEncode(assetId); var path = $"assets/@qs?qs=IRI,{assetId}"; JArray jObject = AASRestClient.GetJArray(path).Result; return((string)jObject[0]["idShort"]); } catch (Exception) { // Could not get asset with assetId return(""); } }
/// <summary> /// Gets the right value for the assetId /// </summary> /// <param name="assetId"></param> /// <param name="value"></param> /// <returns></returns> private static string getValuesAccordingToAssetHelper(string assetId, string value) { try { assetId = WebUtility.UrlEncode(assetId); var path = $"assets/@qs?qs=IRI,{assetId}"; JArray jObject = AASRestClient.GetJArray(path).Result; return((string)jObject[0]["idShort"]); } catch (Exception) { // Could not get asset with assetId return(value); } }