コード例 #1
0
ファイル: ZuoraClient.cs プロジェクト: yousefcodes/ZuoraMagic
        /// <summary>
        ///     Generic string query method
        ///     - Defaults to a limit of 2000. If a higher
        ///     limit is specified, ZuoraMagic will implement the
        ///     'queryMore' SOAPAction to capture all results.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="query"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        public virtual IEnumerable <T> Query <T>(string query, int limit = 0) where T : ZObject
        {
            query = QueryBuilder.ValidateAndFlattenQuery <T>(query);

            return(2000 > limit
                ? PerformArrayRequest <T>(SoapRequestManager.GetQueryRequest(query, limit, Login()))
                : PerformAdvancedQuery <T>(query, limit));
        }
コード例 #2
0
ファイル: ZuoraClient.cs プロジェクト: yousefcodes/ZuoraMagic
 /// <summary>
 ///     Generic predicate query method implementing
 ///     deeper Zuora API features.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="predicate"></param>
 /// <param name="limit"></param>
 /// <returns></returns>
 public virtual QueryResult <T> PerformQuery <T>(Expression <Func <T, bool> > predicate, int limit = 0)
     where T : ZObject
 {
     return(PerformGenericRequest <QueryResult <T> >(SoapRequestManager.GetQueryRequest(predicate, limit, Login())));
 }
コード例 #3
0
ファイル: ZuoraClient.cs プロジェクト: yousefcodes/ZuoraMagic
 /// <summary>
 ///     Generic string query method implementing
 ///     deeper Zuora API features.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="query"></param>
 /// <param name="limit"></param>
 /// <returns></returns>
 public virtual QueryResult <T> PerformQuery <T>(string query, int limit = 0) where T : ZObject
 {
     return(PerformGenericRequest <QueryResult <T> >(SoapRequestManager.GetQueryRequest(query, limit, Login())));
 }
コード例 #4
0
 /// <summary>
 ///     Advanced Query
 ///      - Query items based on generic object
 ///      - Utilize included raw query
 ///      - Returns query locator, and done status which
 ///        can be used to bypass the 200 record limit.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="query"></param>
 /// <returns></returns>
 public QueryResult <T> AdvancedQuery <T>(string query) where T : SObject
 {
     return(PerformQueryRequest <T>(SoapRequestManager.GetQueryRequest(query, Login())));
 }
コード例 #5
0
 /// <summary>
 ///     Advanced Query
 ///      - Query items based on generic object
 ///      - Generate query using predicate
 ///      - Returns query locator, and done status which
 ///        can be used to bypass the 200 record limit.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="predicate"></param>
 /// <param name="limit"></param>
 /// <returns></returns>
 public QueryResult <T> AdvancedQuery <T>(Expression <Func <T, bool> > predicate, int limit = 0) where T : SObject
 {
     return(PerformQueryRequest <T>(SoapRequestManager.GetQueryRequest(predicate, limit, Login())));
 }
コード例 #6
0
 /// <summary>
 ///     Simple Query
 ///      - Query items based on generic object
 ///      - Utilize included raw query
 ///      - Limited by 200 records
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="query"></param>
 /// <returns></returns>
 public virtual IEnumerable <T> Query <T>(string query) where T : SObject
 {
     // TODO: Validate query
     return(PerformArrayRequest <T>(SoapRequestManager.GetQueryRequest(query, Login())));
 }
コード例 #7
0
 /// <summary>
 ///     Simple Query
 ///      - Query items based on generic object
 ///      - Generate query using predicate
 ///      - Limited by 200 records
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="predicate"></param>
 /// <param name="limit"></param>
 /// <returns></returns>
 public virtual IEnumerable <T> Query <T>(Expression <Func <T, bool> > predicate, int limit = 0) where T : SObject
 {
     return(PerformArrayRequest <T>(SoapRequestManager.GetQueryRequest(predicate, limit, Login())));
 }