Example #1
0
        /// <summary>
        ///     Creates a provider that wraps the given provider.
        /// </summary>
        /// <param name="provider"> The provider to wrap. </param>
        public DbQueryProvider(InternalContext internalContext, ObjectQueryProvider provider)
        {
            DebugCheck.NotNull(internalContext);
            DebugCheck.NotNull(provider);

            _internalContext = internalContext;
            _provider        = provider;
        }
Example #2
0
        private TResult ExecuteQuery <TResult>(ObjectContext context, params object[] parameterValues)
        {
            bool             isSingleton;
            Type             elementType = GetElementType(typeof(TResult), out isSingleton);
            ObjectQueryState queryState  = new CompiledELinqQueryState(elementType, context, _query, _cacheToken, parameterValues);

            System.Collections.IEnumerable query = queryState.CreateQuery();
            if (isSingleton)
            {
                return(ObjectQueryProvider.ExecuteSingle <TResult>(Enumerable.Cast <TResult>(query), _query));
            }
            else
            {
                return((TResult)query);
            }
        }
 /// <summary>
 ///     Creates a provider that wraps the given provider.
 /// </summary>
 /// <param name="provider"> The provider to wrap. </param>
 public NonGenericDbQueryProvider(InternalContext internalContext, ObjectQueryProvider provider)
     : base(internalContext, provider)
 {
 }