You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.7 KiB

2 years ago
using System.Data;
namespace Connected.ServiceModel.Client.Data;
/// <summary>
/// Defines the transaction on the remote table storage.
/// </summary>
/// <remarks>
/// Connection write operations using this transaction are queued until
/// the <see cref="Commit"/> is called.
/// </remarks>
internal class TableTransaction : IDbTransaction
{
/// <summary>
/// Creates new <see cref="TableTransaction"/> object.
/// </summary>
/// <param name="connection">The storage connection associated with the transaction.</param>
public TableTransaction(IDbConnection connection)
{
Connection = connection;
}
/// <summary>
/// The storage connection that created the transaction.
/// </summary>
/// <remarks>
/// Multiple connections can use the transaction, but only one is directly associated with the transaction.
/// </remarks>
public IDbConnection? Connection { get; }
/// <summary>
/// The isolation level of the transaction. It's always <see cref="IsolationLevel.Snapshot"/> on this transaction.
/// </summary>
public IsolationLevel IsolationLevel { get; } = IsolationLevel.Snapshot;
/// <summary>
/// Commits this transaction. This call actually performs a REST call to the remote service.
/// </summary>
/// <exception cref="NotImplementedException"></exception>
public void Commit()
{
throw new NotImplementedException();
}
/// <summary>
/// Disposes the <see cref="TableTransaction"/> object.
/// </summary>
public void Dispose()
{
/*
* Nothing really to do here.
*/
}
/// <summary>
/// Rolls back any changes made in this transaction.
/// </summary>
public void Rollback()
{
/*
* This call doesm't have to do enything since we weren't perform
* any calls to the remote service. We just discard the operations.
*/
}
}