Exemple #1
0
        private static IEnumerable <string> GetPropertyPathSegments(
            InternalMemberEntry property)
        {
            do
            {
                yield return(property.Name);

                property = property is InternalNestedPropertyEntry ? (InternalMemberEntry)((InternalPropertyEntry)property).ParentPropertyEntry : (InternalMemberEntry)null;
            }while (property != null);
        }
Exemple #2
0
        // <summary>
        // Gets names of the property and its ancestor properties as enumerable walking "bottom-up".
        // </summary>
        // <param name="property"> Property for which to get the segments. </param>
        // <returns> Names of the property and its ancestor properties. </returns>
        private static IEnumerable <string> GetPropertyPathSegments(InternalMemberEntry property)
        {
            DebugCheck.NotNull(property);

            do
            {
                yield return(property.Name);

                property = (property is InternalNestedPropertyEntry)
                               ? ((InternalNestedPropertyEntry)property).ParentPropertyEntry
                               : null;
            }while (property != null);
        }
Exemple #3
0
        // <summary>
        // Calculates a "path" to a property. For primitive properties on an entity type it is just the
        // name of the property. Otherwise it is a dot separated list of names of the property and all
        // its ancestor properties starting from the entity.
        // </summary>
        // <param name="property"> Property for which to calculate the path. </param>
        // <returns> Dot separated path to the property. </returns>
        public static string GetPropertyPath(InternalMemberEntry property)
        {
            DebugCheck.NotNull(property);

            return(string.Join(".", GetPropertyPathSegments(property).Reverse()));
        }
Exemple #4
0
 public static string GetPropertyPath(InternalMemberEntry property)
 {
     return(string.Join(".", DbHelpers.GetPropertyPathSegments(property).Reverse <string>()));
 }