src/Misc/EFTools/EntityDesign/UI/Views/MappingDetails/Columns/ColumnUtils.cs
// <summary>
//     Add this property to the list-of-values (lov) parameter, but if the Property is a
//     ComplexProperty then expand down to its constituent ScalarProperties
// </summary>
// <param name="lov">list-of-values to be appended to</param>
// <param name="property">property to be added</param>
// <param name="ancestorComplexProperties">any ancestor complex properties (should initially be null or empty)</param>
Add this property to the list-of-values (lov) parameter, but if the Property is a
ComplexProperty then expand down to its constituent ScalarProperties
Add this property to the list - of - values ( lov ) parameter but if the Property is a ComplexProperty then expand down to its constituent ScalarProperties
internal static void AddPropertyToListOfValues(
            Dictionary<MappingLovEFElement, string> lov, Property property, List<Property> ancestorComplexProperties)
        {
            if (ancestorComplexProperties == null)
            {
                ancestorComplexProperties = new List<Property>();
            }
            ancestorComplexProperties.Add(property); 
            var complexProperty = property as ComplexConceptualProperty;
            if (complexProperty != null)
            {
                if (complexProperty.ComplexType.Status == BindingStatus.Known)
                {
                    foreach (var prop in complexProperty.ComplexType.Target.Properties())
                    {
                        AddPropertyToListOfValues(lov, prop, new List<Property>(ancestorComplexProperties));
                    }
                }
            }
            else
            {
                var sb = new StringBuilder();
                foreach (var prop in ancestorComplexProperties)
                {
                    sb.Append(prop.LocalName.Value);
                    sb.Append(".");
                }
                var displayName = BuildPropertyDisplay(sb.ToString(0, sb.Length - 1), property.TypeName);
                lov.Add(new MappingLovEFElement(ancestorComplexProperties, displayName), displayName);
            }
        }
internal static void AddPropertyToListOfValues ( Dictionary < MappingLovEFElement , string > lov , Property property , List < Property > ancestorComplexProperties ) { if ( ancestorComplexProperties == null ) { ancestorComplexProperties = new List < Property > ( ) ; } ancestorComplexProperties . Add ( property ) ; var complexProperty = property as ComplexConceptualProperty ; if ( complexProperty != null ) { if ( complexProperty . ComplexType . Status == BindingStatus . Known ) { foreach ( var prop in complexProperty . ComplexType . Target . Properties ( ) ) { AddPropertyToListOfValues ( lov , prop , new List < Property > ( ancestorComplexProperties ) ) ; } } } else { var sb = new StringBuilder ( ) ; foreach ( var prop in ancestorComplexProperties ) { sb . Append ( prop . LocalName . Value ) ; sb . Append ( " " ) ; } var displayName = BuildPropertyDisplay ( sb . ToString ( 0 , sb . Length - 1 ) , property . TypeName ) ; lov . Add ( new MappingLovEFElement ( ancestorComplexProperties , displayName ) , displayName ) ; } }
Add this property to the list-of-values (lov) parameter, but if the Property is a
ComplexProperty then expand down to its constituent ScalarProperties
Add this property to the list - of - values ( lov ) parameter but if the Property is a ComplexProperty then expand down to its constituent ScalarProperties
// at this point it has actually become "ancestors and self" // in order to know which property should be mapped we need to store list of all ancestor properties that will need to be mapped in the middle
lov
Dictionary<MappingLovEFElement, string>
list-of-values to be appended to
list - of - values to be appended to
property
Property
property to be added
property to be added
ancestorComplexProperties
List<Property>
any ancestor complex properties (should initially be null or empty)
any ancestor complex properties ( should initially be null or empty )