Exemplo n.º 1
0
 /// <summary>
 /// Opens the blob located by the a database, table, column, and rowid for incremental asynchronous I/O as a <see cref="System.IO.Stream"/>.
 /// </summary>
 /// <param name="This">The asynchronous database connection.</param>
 /// <param name="database">The database containing the blob.</param>
 /// <param name="tableName">The table containing the blob.</param>
 /// <param name="columnName">The column containing the blob.</param>
 /// <param name="rowId">The row containing the blob.</param>
 /// <param name="canWrite">
 ///     <see langwords="true"/> if the Stream should be open for both read and write operations.
 ///     <see langwords="false"/> if the Stream should be open oly for read operations.
 /// </param>
 /// <returns>A <see cref="Task"/> that completes with a <see cref="System.IO.Stream"/> that can be used to asynchronously write and read to and from blob.</returns>
 public static Task <Stream> OpenBlobAsync(
     this IAsyncDatabaseConnection This,
     string database,
     string tableName,
     string columnName,
     long rowId,
     bool canWrite = false) =>
 This.OpenBlobAsync(database, tableName, columnName, rowId, canWrite, CancellationToken.None);
Exemplo n.º 2
0
 /// <summary>
 ///  Opens the blob located by the a database, table, column, and rowid for incremental asynchronous I/O as a <see cref="System.IO.Stream"/>.
 /// </summary>
 /// <param name="This">The asynchronous database connection.</param>
 /// <param name="columnInfo">The ColumnInfo of the blob value.</param>
 /// <param name="rowId">The row containing the blob.</param>
 /// <param name="canWrite">
 ///     <see langwords="true"/> if the Stream should be open for both read and write operations.
 ///     <see langwords="false"/> if the Stream should be open oly for read operations.
 /// </param>
 /// <param name="cancellationToken">Cancellation token that can be used to cancel the task.</param>
 /// <returns>A <see cref="Task"/> that completes with a <see cref="System.IO.Stream"/> that can be used to asynchronously write and read to and from blob.</returns>
 public static Task <Stream> OpenBlobAsync(
     this IAsyncDatabaseConnection This,
     ColumnInfo columnInfo,
     long rowId,
     bool canWrite,
     CancellationToken cancellationToken)
 {
     Contract.Requires(columnInfo != null);
     return(This.OpenBlobAsync(columnInfo.DatabaseName, columnInfo.TableName, columnInfo.OriginName, rowId, canWrite, cancellationToken));
 }
Exemplo n.º 3
0
 /// <summary>
 ///  Opens the blob located by the a database, table, column, and rowid for incremental asynchronous I/O as a <see cref="System.IO.Stream"/>.
 /// </summary>
 /// <param name="This">The asynchronous database connection.</param>
 /// <param name="columnInfo">The ColumnInfo of the blob value.</param>
 /// <param name="rowId">The row containing the blob.</param>
 /// <param name="canWrite">
 ///     <see langwords="true"/> if the Stream should be open for both read and write operations.
 ///     <see langwords="false"/> if the Stream should be open oly for read operations.
 /// </param>
 /// <returns>A <see cref="Task"/> that completes with a <see cref="System.IO.Stream"/> that can be used to asynchronously write and read to and from blob.</returns>
 public static Task <Stream> OpenBlobAsync(
     this IAsyncDatabaseConnection This,
     ColumnInfo columnInfo,
     long rowId,
     bool canWrite = false) =>
 This.OpenBlobAsync(columnInfo, rowId, canWrite, CancellationToken.None);