src/Shared/EntityFramework/Internal/Linq/NonGenericDbQueryProvider.cs
// <summary>
// Creates an appropriate generic IQueryable using Reflection and the underlying ElementType of
// the given ObjectQuery.
// </summary>
Creates an appropriate generic IQueryable using Reflection and the underlying ElementType of
the given ObjectQuery.
Creates an appropriate generic IQueryable using Reflection and the underlying ElementType of the given ObjectQuery .
private IQueryable CreateQuery(ObjectQuery objectQuery)
        {
            var internalQuery = CreateInternalQuery(objectQuery);
            var genericDbQueryType = typeof(InternalDbQuery<>).MakeGenericType(internalQuery.ElementType);
            var constructor = genericDbQueryType.GetConstructors(BindingFlags.Instance | BindingFlags.Public).Single();
            return (IQueryable)constructor.Invoke(new object[] { internalQuery });
        }
private IQueryable CreateQuery ( ObjectQuery objectQuery ) { var internalQuery = CreateInternalQuery ( objectQuery ) ; var genericDbQueryType = typeof ( InternalDbQuery < > ) . MakeGenericType ( internalQuery . ElementType ) ; var constructor = genericDbQueryType . GetConstructors ( BindingFlags . Instance | BindingFlags . Public ) . Single ( ) ; return ( IQueryable ) constructor . Invoke ( new object [ ] { internalQuery } ) ; }
Creates an appropriate generic IQueryable using Reflection and the underlying ElementType of
the given ObjectQuery.
Creates an appropriate generic IQueryable using Reflection and the underlying ElementType of the given ObjectQuery .
objectQuery
ObjectQuery