本文整理汇总了C#中ITransaction.GetTableManager方法的典型用法代码示例。如果您正苦于以下问题:C# ITransaction.GetTableManager方法的具体用法?C# ITransaction.GetTableManager怎么用?C# ITransaction.GetTableManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITransaction
的用法示例。
在下文中一共展示了ITransaction.GetTableManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Session
/// <summary>
/// Constructs the session for the given user and transaction to the
/// given database.
/// </summary>
/// <param name="transaction">A transaction that handles the commands issued by
/// the user during the session.</param>
/// <param name="userName"></param>
/// <seealso cref="ITransaction"/>
public Session(ITransaction transaction, string userName)
: base(transaction as IEventSource)
{
if (transaction == null)
throw new ArgumentNullException("transaction");
if (String.IsNullOrEmpty(userName))
throw new ArgumentNullException("userName");
if (String.Equals(userName, User.SystemName, StringComparison.OrdinalIgnoreCase) ||
String.Equals(userName, User.PublicName, StringComparison.OrdinalIgnoreCase))
throw new ArgumentException(String.Format("Cannot open a session for user '{0}'.", userName));
Transaction = transaction;
Context = transaction.Context.CreateSessionContext();
Context.RegisterInstance(this);
Transaction.Context.Route<QueryEvent>(OnQueryCommand);
Transaction.GetTableManager().AddInternalTables(new SessionTableContainer(this));
access = new SessionAccess(this);
if (!transaction.Database.Sessions.Add(this))
throw new InvalidOperationException("The session was already in the database session list");
User = new User(this, userName);
startedOn = DateTimeOffset.UtcNow;
this.OnEvent(new SessionEvent(SessionEventType.Begin));
}