private void UpdadeAssociationConnectorType(StoredAssociationInfo association)
 {
     if (string.IsNullOrEmpty(association.ConnectorTypeName))
     {
         return;
     }
     association.ConnectorType = types[association.ConnectorTypeName];
 }
 private void UpdateAssociationReferencedType(StoredAssociationInfo association)
 {
     if (string.IsNullOrEmpty(association.ReferencedTypeName))
     {
         return;
     }
     association.ReferencedType = types[association.ReferencedTypeName];
 }
 private void UpdateAssociationReferencingField(StoredAssociationInfo association)
 {
     if (string.IsNullOrEmpty(association.ReferencingFieldName))
     {
         return;
     }
     association.ReferencingField = fieldMap[association.ReferencingFieldName];
 }
 private void UpdateAssociationMultiplicity(StoredAssociationInfo association)
 {
     if (string.IsNullOrEmpty(association.MultiplicityName))
     {
         throw new ArgumentException();
     }
     association.Multiplicity = (Multiplicity)Enum.Parse(typeof(Multiplicity), association.MultiplicityName);
 }
        private void UpdateAssociationReversed(StoredAssociationInfo association)
        {
            if (string.IsNullOrEmpty(association.ReversedName))
            {
                return;
            }
            StoredAssociationInfo r;

            if (associations.TryGetValue(association.ReversedName, out r))
            {
                association.Reversed = r;
            }
        }
        private static StoredAssociationInfo ConvertAssociation(AssociationInfo source)
        {
            var result = new StoredAssociationInfo {
                Name                 = source.Name,
                MappingName          = source.AuxiliaryType != null ? source.AuxiliaryType.MappingName : null,
                ConnectorTypeName    = source.AuxiliaryType != null ? source.AuxiliaryType.Name : null,
                IsMaster             = source.IsMaster,
                MultiplicityName     = source.Multiplicity.ToString(),
                ReferencedTypeName   = source.TargetType.Name,
                ReferencingFieldName = source.OwnerField.Name,
                ReversedName         = source.Reversed != null ? source.Reversed.Name : null,
            };

            return(result);
        }