internal static HealthcareRelationInternal DeserializeHealthcareRelationInternal(JsonElement element) { HealthcareEntityRelationType relationType = default; IList <HealthcareRelationEntity> entities = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("relationType")) { relationType = new HealthcareEntityRelationType(property.Value.GetString()); continue; } if (property.NameEquals("entities")) { List <HealthcareRelationEntity> array = new List <HealthcareRelationEntity>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(HealthcareRelationEntity.DeserializeHealthcareRelationEntity(item)); } entities = array; continue; } } return(new HealthcareRelationInternal(relationType, entities)); }
internal HealthcareRelationInternal(HealthcareEntityRelationType relationType, IEnumerable <HealthcareRelationEntity> entities) { if (entities == null) { throw new ArgumentNullException(nameof(entities)); } RelationType = relationType; Entities = entities.ToList(); }
internal HealthcareRelationInternal(HealthcareEntityRelationType relationType, IReadOnlyList <HealthcareRelationEntity> entities) { RelationType = relationType; Entities = entities; }