public static PropertyPath DepureFirstLevelIfCollection(this PropertyPath source) { // when the component is used as elements of a collection, the name of the property representing // the collection itself may be ignored since each collection will have its own table. // Note: In some cases may be a problem. const int penultimateOffset = 2; if (!source.GetRootMember().GetPropertyOrFieldType().IsGenericCollection()) { return(source); } var paths = source.InverseProgressivePath().ToArray(); return(paths[paths.Length - penultimateOffset]); }