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));
        }
コード例 #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 HealthcareEntityRelation(HealthcareEntityRelationType relationType, IReadOnlyCollection <HealthcareEntityRelationRole> roles)
 {
     RelationType = relationType;
     Roles        = roles;
 }
コード例 #4
0
 internal HealthcareRelationInternal(HealthcareEntityRelationType relationType, IReadOnlyList <HealthcareRelationEntity> entities)
 {
     RelationType = relationType;
     Entities     = entities;
 }