/// <summary> /// Asynchronously opens the given connection. /// </summary> /// <param name="shardConnection">The connection to Open</param> /// <param name="cancellationToken">The cancellation token to be passed down</param> /// <returns>The task handling the Open. A completed task if the conn is already Open</returns> internal static Task OpenShardConnectionAsync(DbConnection shardConnection, CancellationToken cancellationToken) { if (shardConnection.State != ConnectionState.Open) { return shardConnection.OpenAsync(cancellationToken); } else { return Task.FromResult<object>(null); } }