/// <summary> /// Compile the query into a EasyTableQueryDescription. /// </summary> /// <returns> /// The compiled OData query. /// </returns> internal EasyTableQueryDescription Compile <T>(EasyTableQuery <T> query) { // Compile the query from the underlying IQueryable's expression // tree EasyTableQueryTranslator <T> translator = new EasyTableQueryTranslator <T>(query); EasyTableQueryDescription compiledQuery = translator.Translate(); return(compiledQuery); }
/// <summary> /// Initializes a new instance of the EasyTableQueryTranslator /// class. /// </summary> /// <param name="query"> /// The <see cref="T:EasyTableQuery`1{T}"/> which /// is being translated. /// </param> public EasyTableQueryTranslator(EasyTableQuery <T> query) { Debug.Assert(query != null); this.query = query; this.queryDescription = new EasyTableQueryDescription() { IncludeTotalCount = query.RequestTotalCount, }; }
public string ToODataString <T>(EasyTableQuery <T> query) { EasyTableQueryDescription description = this.Compile(query); return(description.ToODataString()); }