コード例 #1
0
ファイル: ELinqQueryState.cs プロジェクト: jwanagel/jjwtest
 /// <summary>
 ///     Constructs a new <see cref="ELinqQueryState" /> instance based on the specified Linq Expression,
 ///     copying the state information from the specified ObjectQuery.
 /// </summary>
 /// <param name="elementType"> The element type of the implemented ObjectQuery, as a CLR type. </param>
 /// <param name="query"> The ObjectQuery from which the state information should be copied. </param>
 /// <param name="expression"> The Linq Expression that defines this query. </param>
 internal ELinqQueryState(
     Type elementType, ObjectQuery query, Expression expression,
     ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory = null)
     : base(elementType, query)
 {
     DebugCheck.NotNull(expression);
     _expression = expression;
     _objectQueryExecutionPlanFactory = objectQueryExecutionPlanFactory ?? new ObjectQueryExecutionPlanFactory();
 }
コード例 #2
0
 internal ELinqQueryState(
     Type elementType,
     ObjectQuery query,
     Expression expression,
     ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory = null)
     : base(elementType, query)
 {
     this._expression = expression;
     this._objectQueryExecutionPlanFactory = objectQueryExecutionPlanFactory ?? new ObjectQueryExecutionPlanFactory((System.Data.Entity.Core.Common.Internal.Materialization.Translator)null);
 }
コード例 #3
0
 internal ELinqQueryState(
     Type elementType,
     ObjectContext context,
     Expression expression,
     ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory = null)
     : base(elementType, context, (ObjectParameterCollection)null, (Span)null)
 {
     this._expression = expression;
     this._useCSharpNullComparisonBehavior = context.ContextOptions.UseCSharpNullComparisonBehavior;
     this._objectQueryExecutionPlanFactory = objectQueryExecutionPlanFactory ?? new ObjectQueryExecutionPlanFactory((System.Data.Entity.Core.Common.Internal.Materialization.Translator)null);
 }
コード例 #4
0
        // <summary>
        // Initializes a new query EntitySqlQueryState instance.
        // </summary>
        // <param name="commandText"> The Entity-SQL text of the query </param>
        // <param name="expression">
        // Optional <see cref="DbExpression" /> that defines the query. Must be semantically equal to the
        // <paramref name="commandText" />.
        // </param>
        // <param name="context"> The ObjectContext containing the metadata workspace the query was built against, the connection on which to execute the query, and the cache to store the results in. Must not be null. </param>
        internal EntitySqlQueryState(
            Type elementType, string commandText, DbExpression expression, bool allowsLimit, ObjectContext context,
            ObjectParameterCollection parameters, Span span,
            ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory = null)
            : base(elementType, context, parameters, span)
        {
            Check.NotEmpty(commandText, "commandText");

            _queryText       = commandText;
            _queryExpression = expression;
            _allowsLimit     = allowsLimit;
            _objectQueryExecutionPlanFactory = objectQueryExecutionPlanFactory ?? new ObjectQueryExecutionPlanFactory();
        }
コード例 #5
0
        // <summary>
        // Creates a new compiled query state instance
        // </summary>
        // <param name="elementType"> The element type of the new instance (the 'T' of the ObjectQuery &lt; T &gt; that the new state instance will back)" </param>
        // <param name="context"> The object context with which the new instance should be associated </param>
        // <param name="lambda">
        // The compiled query definition, as a <see cref="LambdaExpression" />
        // </param>
        // <param name="cacheToken"> The cache token to use when retrieving or storing the new instance's execution plan in the query cache </param>
        // <param name="parameterValues"> The values passed into the CompiledQuery delegate </param>
        internal CompiledELinqQueryState(
            Type elementType, ObjectContext context, LambdaExpression lambda, Guid cacheToken, object[] parameterValues,
            ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory = null)
            : base(elementType, context, lambda)
        {
            DebugCheck.NotNull(parameterValues);

            _cacheToken      = cacheToken;
            _parameterValues = parameterValues;

            EnsureParameters();
            Parameters.SetReadOnly(true);

            _objectQueryExecutionPlanFactory = objectQueryExecutionPlanFactory ?? new ObjectQueryExecutionPlanFactory();
        }
コード例 #6
0
        /// <summary>
        /// Creates a new compiled query state instance
        /// </summary>
        /// <param name="elementType">The element type of the new instance (the 'T' of the ObjectQuery&lt;T&gt; that the new state instance will back)"</param>
        /// <param name="context">The object context with which the new instance should be associated</param>
        /// <param name="lambda">The compiled query definition, as a <see cref="LambdaExpression"/></param>
        /// <param name="cacheToken">The cache token to use when retrieving or storing the new instance's execution plan in the query cache</param>
        /// <param name="parameterValues">The values passed into the CompiledQuery delegate</param>
        internal CompiledELinqQueryState(
            Type elementType, ObjectContext context, LambdaExpression lambda, Guid cacheToken, object[] parameterValues,
            ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory = null)
            : base(elementType, context, lambda)
        {
            //Contract.Requires(parameterValues != null);

            _cacheToken = cacheToken;
            _parameterValues = parameterValues;

            EnsureParameters();
            Parameters.SetReadOnly(true);

            _objectQueryExecutionPlanFactory = objectQueryExecutionPlanFactory ?? new ObjectQueryExecutionPlanFactory();
        }
コード例 #7
0
 internal CompiledELinqQueryState(
     Type elementType,
     ObjectContext context,
     LambdaExpression lambda,
     Guid cacheToken,
     object[] parameterValues,
     ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory = null)
     : base(elementType, context, (Expression)lambda, (ObjectQueryExecutionPlanFactory)null)
 {
     this._cacheToken      = cacheToken;
     this._parameterValues = parameterValues;
     this.EnsureParameters();
     this.Parameters.SetReadOnly(true);
     this._objectQueryExecutionPlanFactory = objectQueryExecutionPlanFactory ?? new ObjectQueryExecutionPlanFactory((System.Data.Entity.Core.Common.Internal.Materialization.Translator)null);
 }
コード例 #8
0
ファイル: ELinqQueryState.cs プロジェクト: jwanagel/jjwtest
        /// <summary>
        ///     Constructs a new <see cref="ELinqQueryState" /> instance based on the specified Linq Expression
        ///     against the specified ObjectContext.
        /// </summary>
        /// <param name="elementType"> The element type of the implemented ObjectQuery, as a CLR type. </param>
        /// <param name="context"> The ObjectContext with which the implemented ObjectQuery is associated. </param>
        /// <param name="expression"> The Linq Expression that defines this query. </param>
        internal ELinqQueryState(
            Type elementType, ObjectContext context, Expression expression,
            ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory = null)
            : base(elementType, context, null, null)
        {
            //
            // Initialize the LINQ expression, which is passed in via
            // public APIs on ObjectQuery and must be checked here
            // (the base class performs similar checks on the ObjectContext and MergeOption arguments).
            //
            DebugCheck.NotNull(expression);
            // closure bindings and initializers are explicitly allowed to be null

            _expression = expression;
            _useCSharpNullComparisonBehavior = context.ContextOptions.UseCSharpNullComparisonBehavior;
            _objectQueryExecutionPlanFactory = objectQueryExecutionPlanFactory ?? new ObjectQueryExecutionPlanFactory();
        }
コード例 #9
0
 internal EntitySqlQueryState(
     Type elementType,
     string commandText,
     DbExpression expression,
     bool allowsLimit,
     ObjectContext context,
     ObjectParameterCollection parameters,
     Span span,
     ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory = null)
     : base(elementType, context, parameters, span)
 {
     Check.NotEmpty(commandText, nameof(commandText));
     this._queryText       = commandText;
     this._queryExpression = expression;
     this._allowsLimit     = allowsLimit;
     this._objectQueryExecutionPlanFactory = objectQueryExecutionPlanFactory ?? new ObjectQueryExecutionPlanFactory((System.Data.Entity.Core.Common.Internal.Materialization.Translator)null);
 }