/// <summary>
 /// CheckAttributeConstraint looks at the the ConceptTypeChildPath for an attribute, setting the attribute to nullable when some point in the path is not mandatory.
 /// </summary>
 private static void CheckAttributeConstraint(Attribute attribute, EntityType entity)
 {
     if (entity == null)
     {
         entity = attribute.EntityType;
     }
     attribute.IsMandatory = AllStepsMandatory(entity, AttributeHasConceptTypeChild.GetConceptTypeChildPath(attribute));
 }
        private static Attribute CreateAttributeForInformationType(InformationType informationType, Stack <ConceptTypeChild> conceptTypeChildPath)
        {
            conceptTypeChildPath.Push(informationType);
            Attribute attribute = new Attribute(informationType.Store,
                                                new PropertyAssignment[] {
                new PropertyAssignment(Attribute.NameDomainPropertyId, informationType.Name)
            });

            foreach (Uniqueness u in UniquenessIncludesConceptTypeChild.GetUniquenessCollection(informationType))
            {
                if (u.IsPreferred)
                {
                    attribute.IsPrimaryIdComponent = true;
                    break;
                }
            }

            ConceptTypeChild[] conceptTypeChildPathReverse = conceptTypeChildPath.ToArray();
            sys.Array.Reverse(conceptTypeChildPathReverse);
            AttributeHasConceptTypeChild.GetConceptTypeChildPath(attribute).AddRange(conceptTypeChildPathReverse);
            conceptTypeChildPath.Pop();
            return(attribute);
        }