public bool MoveNext()
 {
     if (asyncEnumerator == null)
     {
         throw new ObjectDisposedException(GetType().FullName);
     }
     return(TaskUtilities.ExecuteSynchronously(() => asyncEnumerator.MoveNext(cancellationToken)));
 }
 public void Dispose()
 {
     if (this.asyncEnumerator != null)
     {
         TaskUtilities.ExecuteSynchronously(() => this.asyncEnumerator.Dispose(cancellationToken));
         this.asyncEnumerator = null;
     }
 }
 public static void Connect(this IConnectableConnection connection, CancellationToken?cancellationToken = null)
 {
     TaskUtilities.ExecuteSynchronously(() => connection.ConnectAsync(cancellationToken));
 }
 public static T Run <T>(this IConnection connection, IScalarQuery <T> queryObject, IQueryConverter queryConverter = null, CancellationToken?cancellationToken = null)
 {
     return(TaskUtilities.ExecuteSynchronously(() => connection.RunAsync <T>(queryObject, queryConverter, cancellationToken)));
 }
 public static IConnection Get(this IConnectionFactory connectionFactory)
 {
     return(TaskUtilities.ExecuteSynchronously(() => connectionFactory.GetAsync()));
 }