src/Shared/EntityFramework/Core/Mapping/ViewGeneration/Structures/MemberProjectionIndex.cs
// <summary>
// Given the <paramref name="member" /> and one of its <paramref name="possibleType" />s, determine the attributes that are relevant
// for this <paramref name="possibleType" /> and return a <see cref="MemberPath" /> signature corresponding to the
// <paramref
//     name="possibleType" />
// and the attributes.
// If <paramref name="needKeysOnly" />=true, collect the key fields only.
// </summary>
// <param name="possibleType">
// the <paramref name="member" /> 's type or one of its subtypes
// </param>
Given the  and one of its s, determine the attributes that are relevant
for this  and return a  signature corresponding to the

and the attributes.
If =true, collect the key fields only.
Given the and one of its s determine the attributes that are relevant for this and return a signature corresponding to the and the attributes . If = true collect the key fields only .
private static void GatherSignatureFromTypeStructuralMembers(
            MemberProjectionIndex index,
            EdmItemCollection edmItemCollection,
            MemberPath member,
            StructuralType possibleType,
            bool needKeysOnly)
        {
            foreach (EdmMember structuralMember in Helper.GetAllStructuralMembers(possibleType))
            {
                if (MetadataHelper.IsNonRefSimpleMember(structuralMember))
                {
                    if (!needKeysOnly
                        || MetadataHelper.IsPartOfEntityTypeKey(structuralMember))
                    {
                        var nonStructuredMember = new MemberPath(member, structuralMember);
                        index.CreateIndex(nonStructuredMember);
                    }
                }
                else
                {
                    Debug.Assert(
                        structuralMember.TypeUsage.EdmType is ComplexType ||
                        structuralMember.TypeUsage.EdmType is RefType, 
                        "Only non-scalars expected - complex types, association ends");
                    var structuredMember = new MemberPath(member, structuralMember);
                    GatherPartialSignature(
                        index,
                        edmItemCollection,
                        structuredMember,
                        needKeysOnly || Helper.IsAssociationEndMember(structuralMember));
                }
            }
        }
private static void GatherSignatureFromTypeStructuralMembers ( MemberProjectionIndex index , EdmItemCollection edmItemCollection , MemberPath member , StructuralType possibleType , bool needKeysOnly ) { foreach ( EdmMember structuralMember in Helper . GetAllStructuralMembers ( possibleType ) ) { if ( MetadataHelper . IsNonRefSimpleMember ( structuralMember ) ) { if ( ! needKeysOnly || MetadataHelper . IsPartOfEntityTypeKey ( structuralMember ) ) { var nonStructuredMember = new MemberPath ( member , structuralMember ) ; index . CreateIndex ( nonStructuredMember ) ; } } else { Debug . Assert ( structuralMember . TypeUsage . EdmType is ComplexType || structuralMember . TypeUsage . EdmType is RefType , " " ) ; var structuredMember = new MemberPath ( member , structuralMember ) ; GatherPartialSignature ( index , edmItemCollection , structuredMember , needKeysOnly || Helper . IsAssociationEndMember ( structuralMember ) ) ; } } }
Given the  and one of its s, determine the attributes that are relevant
for this  and return a  signature corresponding to the
Given the and one of its s determine the attributes that are relevant for this and return a signature corresponding to the
// For each child member of this type, collect all the relevant scalar fields // Note: scalarMember's parent has already been added to the projectedSlotMap // for association ends // Only keys are required for entities referenced by association ends of an association.
index
MemberProjectionIndex
edmItemCollection
EdmItemCollection
member
MemberPath
possibleType
StructuralType
the  's type or one of its subtypes
the ' s type or one of its subtypes
needKeysOnly
bool