Ejemplo n.º 1
0
 /// <summary>
 /// Executes the command against the connection and converts the results to <typeparamref name="TEntity" /> objects asynchronously.
 /// </summary>
 /// <typeparam name="TEntity">The type of the entity.</typeparam>
 /// <param name="dataQuery">The <see cref="IDataQueryAsync"/> for this extension method.</param>
 /// <param name="cancellationToken">The cancellation instruction.</param>
 /// <returns>
 /// An <see cref="T:System.Collections.Generic.IEnumerable`1" /> of <typeparamref name="TEntity" /> objects.
 /// </returns>
 public static Task <IEnumerable <TEntity> > QueryAsync <TEntity>(this IDataQueryAsync dataQuery, CancellationToken cancellationToken = default(CancellationToken))
     where TEntity : class, new()
 {
     return(dataQuery.QueryAsync(ReaderFactory.EntityFactory <TEntity>, cancellationToken));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Executes the command against the connection and converts the results to dynamic objects asynchronously.
 /// </summary>
 /// <param name="dataQuery">The <see cref="IDataQueryAsync"/> for this extension method.</param>
 /// <param name="cancellationToken">The cancellation instruction.</param>
 /// <returns>
 /// An <see cref="T:System.Collections.Generic.IEnumerable`1" /> of dynamic objects.
 /// </returns>
 public static Task <IEnumerable <dynamic> > QueryAsync(this IDataQueryAsync dataQuery, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(dataQuery.QueryAsync(ReaderFactory.DynamicFactory, cancellationToken));
 }