src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Finds the first scalar Property with the specified local name in the Entity Properties tree
///     (i.e. including all Properties from all Complex Properties on any level)
/// </summary>
/// <param name="entity">Entity to search in</param>
/// <param name="propName">Searched Property local name</param>
/// <param name="properties">Path to the found Property in the Entity Properties tree</param>
/// <returns>True if the scalar Property is found</returns>
Finds the first scalar Property with the specified local name in the Entity Properties tree
Finds the first scalar Property with the specified local name in the Entity Properties tree
internal static bool FindScalarPropertyPathByLocalName(EntityType entity, string propName, out List<Property> properties)
        {
            properties = new List<Property>();
            foreach (var property in entity.Properties())
            {
                var complexProperty = property as ComplexConceptualProperty;
                if (complexProperty != null)
                {
                    if (FindScalarPropertyPathByLocalName(complexProperty, propName, properties))
                    {
                        properties.Insert(0, complexProperty);
                        return true;
                    }
                }
                else
                {
                    if (property.LocalName.Value.Equals(propName, StringComparison.CurrentCulture))
                    {
                        properties.Add(property);
                        return true;
                    }
                }
            }
            return false;
        }
internal static bool FindScalarPropertyPathByLocalName ( EntityType entity , string propName , out List < Property > properties ) { properties = new List < Property > ( ) ; foreach ( var property in entity . Properties ( ) ) { var complexProperty = property as ComplexConceptualProperty ; if ( complexProperty != null ) { if ( FindScalarPropertyPathByLocalName ( complexProperty , propName , properties ) ) { properties . Insert ( 0 , complexProperty ) ; return true ; } } else { if ( property . LocalName . Value . Equals ( propName , StringComparison . CurrentCulture ) ) { properties . Add ( property ) ; return true ; } } } return false ; }
Finds the first scalar Property with the specified local name in the Entity Properties tree
(i.e.
Finds the first scalar Property with the specified local name in the Entity Properties tree ( i . e .
True if the scalar Property is found
True if the scalar Property is found
entity
EntityType
Entity to search in
Entity to search in
propName
string
Searched Property local name
Searched Property local name
List<Property>
out
properties
Path to the found Property in the Entity Properties tree
Path to the found Property in the Entity Properties tree