internal static HealthcareRelationInternal DeserializeHealthcareRelationInternal(JsonElement element) { HealthcareEntityRelationType relationType = default; IReadOnlyList <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 HealthcareEntityRelation(HealthcareEntityRelationType relationType, IReadOnlyCollection <HealthcareEntityRelationRole> roles) { RelationType = relationType; Roles = roles; }
internal HealthcareRelationInternal(HealthcareEntityRelationType relationType, IReadOnlyList <HealthcareRelationEntity> entities) { RelationType = relationType; Entities = entities; }