src/EntityFramework/Core/Objects/DataClasses/EntityCollection.cs
// ----------------------
// IListSource  method
// ----------------------
/// <summary>
///     Returns the collection as an <see cref="T:System.Collections.IList" /> used for data binding.
/// </summary>
/// <returns>
///     An <see cref="T:System.Collections.IList" /> of entity objects.
/// </returns>
Returns the collection as an  used for data binding.
Returns the collection as an used for data binding .
[SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
        IList IListSource.GetList()
        {
            EntityType rootEntityType = null;
            if (WrappedOwner.Entity != null)
            {
                EntitySet singleEntitySet = null;
                if (null != RelationshipSet)
                {
                    singleEntitySet = ((AssociationSet)RelationshipSet).AssociationSetEnds[ToEndMember.Name].EntitySet;
                    var associationEndType = (EntityType)((RefType)(ToEndMember).TypeUsage.EdmType).ElementType;
                    var entitySetType = singleEntitySet.ElementType;
                    if (associationEndType.IsAssignableFrom(entitySetType))
                    {
                        rootEntityType = entitySetType;
                    }
                    else
                    {
                        rootEntityType = associationEndType;
                    }
                }
            }
            return ObjectViewFactory.CreateViewForEntityCollection(rootEntityType, this);
        }
[ SuppressMessage ( " " , " " ) ] IList IListSource . GetList ( ) { EntityType rootEntityType = null ; if ( WrappedOwner . Entity != null ) { EntitySet singleEntitySet = null ; if ( null != RelationshipSet ) { singleEntitySet = ( ( AssociationSet ) RelationshipSet ) . AssociationSetEnds [ ToEndMember . Name ] . EntitySet ; var associationEndType = ( EntityType ) ( ( RefType ) ( ToEndMember ) . TypeUsage . EdmType ) . ElementType ; var entitySetType = singleEntitySet . ElementType ; if ( associationEndType . IsAssignableFrom ( entitySetType ) ) { rootEntityType = entitySetType ; } else { rootEntityType = associationEndType ; } } } return ObjectViewFactory . CreateViewForEntityCollection ( rootEntityType , this ) ; }
Returns the collection as an  used for data binding.
Returns the collection as an used for data binding .
// if the collection is attached, we can use metadata information; otherwise, it is unavailable // the type is constrained to be either the entitySet.ElementType or the end member type, whichever is most derived // entity set exposes a subtype of the association // use the end type otherwise
An  of entity objects.
An of entity objects .