src/EntityFramework/Core/Mapping/ViewGeneration/Structures/TypeConstant.cs
// <summary>
// Given the <paramref name="outputMember" /> in the output extent view, generates a constructor expression for
// <paramref name="outputMember" />'s type, i.e, an expression of the form "Type(....)"
// If <paramref name="outputMember" /> is an association end then instead of constructing an Entity or Complex type, constructs a reference.
// </summary>
Given the  in the output extent view, generates a constructor expression for
's type, i.e, an expression of the form "Type(....)"
If  is an association end then instead of constructing an Entity or Complex type, constructs a reference.
Given the in the output extent view generates a constructor expression for ' s type i . e an expression of the form " Type ( .... ) " If is an association end then instead of constructing an Entity or Complex type constructs a reference .
private void AsCql(Action<EntitySet, IList<MemberPath>> createRef, Action<IList<MemberPath>> createType, MemberPath outputMember)
        {
            var refScopeEntitySet = outputMember.GetScopeOfRelationEnd();
            if (refScopeEntitySet != null)
            {
                var entityType = refScopeEntitySet.ElementType;
                var keyMemberOutputPaths = new List<MemberPath>(entityType.KeyMembers.Select(km => new MemberPath(outputMember, km)));
                createRef(refScopeEntitySet, keyMemberOutputPaths);
            }
            else
            {
                Debug.Assert(m_edmType is StructuralType, "m_edmType must be a structural type.");
                var memberOutputPaths = new List<MemberPath>();
                foreach (EdmMember structuralMember in Helper.GetAllStructuralMembers(m_edmType))
                {
                    memberOutputPaths.Add(new MemberPath(outputMember, structuralMember));
                }
                createType(memberOutputPaths);
            }
        }
private void AsCql ( Action < EntitySet , IList < MemberPath > > createRef , Action < IList < MemberPath > > createType , MemberPath outputMember ) { var refScopeEntitySet = outputMember . GetScopeOfRelationEnd ( ) ; if ( refScopeEntitySet != null ) { var entityType = refScopeEntitySet . ElementType ; var keyMemberOutputPaths = new List < MemberPath > ( entityType . KeyMembers . Select ( km => new MemberPath ( outputMember , km ) ) ) ; createRef ( refScopeEntitySet , keyMemberOutputPaths ) ; } else { Debug . Assert ( m_edmType is StructuralType , " " ) ; var memberOutputPaths = new List < MemberPath > ( ) ; foreach ( EdmMember structuralMember in Helper . GetAllStructuralMembers ( m_edmType ) ) { memberOutputPaths . Add ( new MemberPath ( outputMember , structuralMember ) ) ; } createType ( memberOutputPaths ) ; } }
Given the  in the output extent view, generates a constructor expression for
's type, i.e, an expression of the form "Type(....)"
If  is an association end then instead of constructing an Entity or Complex type, constructs a reference.
Given the in the output extent view generates a constructor expression for ' s type i . e an expression of the form " Type ( .... ) " If is an association end then instead of constructing an Entity or Complex type constructs a reference .
// Construct a scoped reference: CreateRef(CPerson1Set, NewRow(pid1, pid2), CPerson1) // Construct an entity/complex/Association type in the Members order for fields: CPerson(CPerson1_Pid, CPerson1_Name)
createRef
Action<EntitySet, IList<MemberPath>>
createType
Action<IList<MemberPath>>
outputMember
MemberPath