/// <summary> /// Read PatternForSemanticVersionDTO values from the named child property. /// </summary> /// <param name="jObj">JSON parent container.</param> /// <param name = "publicId" > Public id(component ids).</param> /// <returns>Definition for semantic version values.</returns> public static IEnumerable <PatternVersionDTO> ReadPatternVersionList( this JObject jObj, IPublicId publicId) { List <PatternVersionDTO> retVal = new List <PatternVersionDTO>(); JArray items = jObj.ReadToken <JArray>(ComponentFieldForJson.DEFINITION_VERSIONS); foreach (JObject item in items.Values <JObject>()) { retVal.Add(PatternVersionDTO.Make(item, publicId)); } return(retVal); }
/// <summary> /// Read an array or TypePatternVersionDTO items. /// </summary> /// <param name="publicId">Public id (component ids).</param> /// <returns>TypePatternVersionDTO[].</returns> public PatternVersionDTO[] GetPatternVersionList(IPublicId publicId) { Int32 length = this.GetInt32(); PatternVersionDTO[] retVal = new PatternVersionDTO[length]; // Generate array to avoid multiple enumerations of componentUuids. Guid[] componentUuidArr = publicId.AsUuidArray; for (Int32 i = 0; i < length; i++) { retVal[i] = PatternVersionDTO.Make(this, publicId); } return(retVal); }