예제 #1
0
        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));
        }
예제 #2
0
        internal HealthcareRelationInternal(HealthcareEntityRelationType relationType, IEnumerable <HealthcareRelationEntity> entities)
        {
            if (entities == null)
            {
                throw new ArgumentNullException(nameof(entities));
            }

            RelationType = relationType;
            Entities     = entities.ToList();
        }
예제 #3
0
 internal HealthcareRelationInternal(HealthcareEntityRelationType relationType, IReadOnlyList <HealthcareRelationEntity> entities)
 {
     RelationType = relationType;
     Entities     = entities;
 }