src/Shared/EntityFramework/Core/Objects/DataRecordObjectView.cs
// <summary>
// Return the element type for the supplied type.
// </summary>
// <returns>
// If <paramref name="type" /> represents a list type that doesn't also implement ITypedList or IListSource, return the element type for items in that list. Otherwise, return the type supplied by
// <paramref
//     name="type" />
// .
// </returns>
// <remarks>
// The algorithm here is lifted from System.Windows.Forms.ListBindingHelper,
// from the GetListItemType(object) method.
// The Entity Framework could not take a dependency on WinForms,
// so we lifted the appropriate parts from the WinForms code here.
// Not the best, but much better than guessing as to what algorithm is proper for data binding.
// </remarks>
Return the element type for the supplied type.
Return the element type for the supplied type .
private static Type GetListItemType(Type type)
        {
            Type itemType;
            if (typeof(Array).IsAssignableFrom(type))
            {
                itemType = type.GetElementType();
            }
            else
            {
                var typedIndexer = GetTypedIndexer(type);
                if (typedIndexer != null)
                {
                    itemType = typedIndexer.PropertyType;
                }
                else
                {
                    itemType = type;
                }
            }
            return itemType;
        }
private static Type GetListItemType ( Type type ) { Type itemType ; if ( typeof ( Array ) . IsAssignableFrom ( type ) ) { itemType = type . GetElementType ( ) ; } else { var typedIndexer = GetTypedIndexer ( type ) ; if ( typedIndexer != null ) { itemType = typedIndexer . PropertyType ; } else { itemType = type ; } } return itemType ; }
Return the element type for the supplied type.
Return the element type for the supplied type .
If  represents a list type that doesn't also implement ITypedList or IListSource, return the element type for items in that list. Otherwise, return the type supplied by


If represents a list type that doesn ' t also implement ITypedList or IListSource return the element type for items in that list . Otherwise return the type supplied by
type
Type
remarks
The algorithm here is lifted from System.Windows.Forms.ListBindingHelper,
from the GetListItemType(object) method.
The Entity Framework could not take a dependency on WinForms,
so we lifted the appropriate parts from the WinForms code here.
Not the best, but much better than guessing as to what algorithm is proper for data binding.
The algorithm here is lifted from System . Windows . Forms . ListBindingHelper from the GetListItemType ( object ) method . The Entity Framework could not take a dependency on WinForms so we lifted the appropriate parts from the WinForms code here . Not the best but much better than guessing as to what algorithm is proper for data binding .