Exemplo n.º 1
0
 /// <summary>
 /// Configures an async Scan operation against DynamoDB, finding items that match the specified conditions.
 /// </summary>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <param name="take">The number of items to take.</param>
 /// <param name="skip">The number of items to skip.</param>
 /// <returns>The async task.</returns>
 public async Task <List <T> > ScanAsync <ST>(CancellationToken cancellationToken, int take = 100, SkipCount <ST> skip = null)
 {
     if (skip != null)
     {
         List <ScanCondition> queryFilterInternal = new List <ScanCondition>();
         queryFilterInternal.Add(skip.GetSkipQuery());
         return(await ScanAsyncEx(queryFilterInternal, cancellationToken, take));
     }
     else
     {
         return(await ScanAsyncEx(new List <ScanCondition>(), cancellationToken, take));
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Configures an async Query operation against DynamoDB, finding items that match the specified hash primary key.
 /// </summary>
 /// <param name="hashKeyValue">Hash key of the items to query.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <param name="take">The number of items to take.</param>
 /// <param name="skip">The number of items to skip.</param>
 /// <returns>The async task.</returns>
 public async Task <List <T> > QueryAsync <ST>(object hashKeyValue, CancellationToken cancellationToken, int take = 100, SkipCount <ST> skip = null)
 {
     if (skip != null)
     {
         List <ScanCondition> queryFilter = new List <ScanCondition>();
         queryFilter.Add(skip.GetSkipQuery());
         return(await QueryAsyncEx(hashKeyValue, cancellationToken, take, queryFilter));
     }
     else
     {
         return(await QueryAsyncEx(hashKeyValue, cancellationToken, take));
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Configures an async Scan operation against DynamoDB, finding items that match the specified conditions.
 /// </summary>
 /// <param name="conditions">The scan conditions.</param>
 /// <param name="take">The number of items to take.</param>
 /// <param name="skip">The number of items to skip.</param>
 /// <returns>The async task.</returns>
 public async Task <List <T> > ScanAsync <ST>(List <ScanCondition> conditions, int take = 100, SkipCount <ST> skip = null)
 {
     if (skip != null)
     {
         List <ScanCondition> queryFilterInternal = new List <ScanCondition>();
         queryFilterInternal.Add(skip.GetSkipQuery());
         if (conditions != null)
         {
             queryFilterInternal.AddRange(conditions);
         }
         return(await ScanAsyncEx(queryFilterInternal, CancellationToken.None, take));
     }
     else
     {
         return(await ScanAsyncEx(conditions, CancellationToken.None, take));
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Configures an async Query operation against DynamoDB, finding items that match the specified hash primary key.
 /// </summary>
 /// <param name="hashKeyValue">Hash key of the items to query.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <param name="queryFilter">Query filter for the Query operation operation.</param>
 /// <param name="take">The number of items to take.</param>
 /// <param name="skip">The number of items to skip.</param>
 /// <returns>The async task.</returns>
 public async Task <List <T> > QueryAsync <ST>(object hashKeyValue, CancellationToken cancellationToken, List <ScanCondition> queryFilter, int take = 100, SkipCount <ST> skip = null)
 {
     if (skip != null)
     {
         List <ScanCondition> queryFilterInternal = new List <ScanCondition>();
         queryFilterInternal.Add(skip.GetSkipQuery());
         if (queryFilter != null)
         {
             // Add the rest of the queries.
             queryFilterInternal.AddRange(queryFilter);
         }
         return(await QueryAsyncEx(hashKeyValue, cancellationToken, take, queryFilterInternal));
     }
     else
     {
         return(await QueryAsyncEx(hashKeyValue, cancellationToken, take, queryFilter));
     }
 }