/// <summary>
        /// Compile the query into a MobileServiceTableQueryDescription.
        /// </summary>
        /// <returns>
        /// The compiled OData query.
        /// </returns>
        internal MobileServiceTableQueryDescription Compile <T>(MobileServiceTableQuery <T> query)
        {
            // Compile the query from the underlying IQueryable's expression
            // tree
            MobileServiceTableQueryTranslator <T> translator    = new MobileServiceTableQueryTranslator <T>(query);
            MobileServiceTableQueryDescription    compiledQuery = translator.Translate();

            return(compiledQuery);
        }
Пример #2
0
        /// <summary>
        /// Compile the query into a MobileServiceTableQueryDescription.
        /// </summary>
        /// <returns>The compiled OData query.</returns>
        internal MobileServiceTableQueryDescription Compile()
        {
            // Compile the query from the underlying IQueryable's expression
            // tree
            MobileServiceTableQueryDescription compiledQuery = MobileServiceTableQueryTranslator.Translate(this.Query.Expression);

            // Forward along the request for the total count
            compiledQuery.IncludeTotalCount = this.RequestTotalCount;

            // Associate the current table with the compiled query
            if (string.IsNullOrEmpty(compiledQuery.TableName))
            {
                SerializableType type = SerializableType.Get(
                    compiledQuery.ProjectionArgumentType ?? typeof(T));
                compiledQuery.TableName = type.TableName;
            }

            return(compiledQuery);
        }