当前位置: 首页>>代码示例>>C#>>正文


C# ITransaction类代码示例

本文整理汇总了C#中ITransaction的典型用法代码示例。如果您正苦于以下问题:C# ITransaction类的具体用法?C# ITransaction怎么用?C# ITransaction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ITransaction类属于命名空间,在下文中一共展示了ITransaction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnNewTransaction

 private void OnNewTransaction(ITransaction transaction, TransactionMode transactionMode, IsolationMode isolationMode, bool distributedTransaction)
 {
     if (!transaction.DistributedTransaction)
     {
         transaction.Enlist(new RhinoTransactionResourceAdapter(transactionMode));
     }
 }
开发者ID:JackWangCUMT,项目名称:rhino-tools,代码行数:7,代码来源:RhinoTransactionFacility.cs

示例2: SchemaManager

        public SchemaManager(ITransaction transaction)
        {
            if (transaction == null)
                throw new ArgumentNullException("transaction");

            Transaction = transaction;
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:7,代码来源:SchemaManager.cs

示例3: DetachFrom

        public void DetachFrom(ITransaction transaction)
        {
            transaction.UnregisterOnCommit(OnCommit);

            if (transaction is ICallbackHandler)
                ((ICallbackHandler)transaction).OnCallbackDetached(this);
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:TableCommitCallback.cs

示例4: AttachTo

        public void AttachTo(ITransaction transaction)
        {
            transaction.RegisterOnCommit(OnCommit);

            if (transaction is ICallbackHandler)
                ((ICallbackHandler)transaction).OnCallbackAttached(this);
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:TableCommitCallback.cs

示例5: UnitOfWorkSynchronization

 /// <summary>
 /// ���캯��
 /// </summary>
 public UnitOfWorkSynchronization(ITransaction transaction, UnitOfWorkDelegate unitOfWorkDelegate)
 {
     _transaction = transaction;
     _unitOfWorkDelegate = unitOfWorkDelegate;
     _asyncMessageBus = DependencyResolver.Resolve<IAsyncMessageBus>();
     _logger = DependencyResolver.Resolve<ILoggerFactory>().Create("EventSourcing.UnitOfWorkSynchronization");
 }
开发者ID:sampson890727,项目名称:eventsourcing,代码行数:10,代码来源:UnitOfWorkSynchronization.cs

示例6: Insert

        public Dictionary<string, object> Insert(string tableName, Dictionary<string, object> row, ITransaction transaction = null)
        {
            if (!DataStore.ContainsKey(tableName))
                DataStore.Add(tableName, new FakeDBTable());

            var table = DataStore[tableName];

            var dictToUse = row.Copy();
            //var id = DataStore[tableName].Count + 1;
            var primaryKeys = Analyzer.GetPrimaryKeys(tableName);
            var autoKey = Analyzer.GetAutoNumberKey(tableName);

            if (autoKey != null)
            {
                if (!dictToUse.ContainsKey(autoKey))
                    dictToUse.Add(autoKey, table.NextAutoKey++);
                else
                    dictToUse[autoKey] = table.NextAutoKey++;
            }

            var invalid = primaryKeys.Where(key => dictToUse[key] == null);
            if (invalid.Any())
                throw new KeyNotSetException(tableName, invalid);

            table.Add(dictToUse);
            return dictToUse.WhereKeys(key => primaryKeys.Contains(key));
        }
开发者ID:TrinityWestern,项目名称:Lasy,代码行数:27,代码来源:FakeDB.cs

示例7: RawRead

        public IEnumerable<Dictionary<string, object>> RawRead(string tableName, Dictionary<string, object> id, ITransaction transaction = null)
        {
            if (!DataStore.ContainsKey(tableName))
                return new List<Dictionary<string, object>>();

            return DataStore[tableName].FindByFieldValues(id);
        }
开发者ID:TrinityWestern,项目名称:Lasy,代码行数:7,代码来源:FakeDB.cs

示例8: UnitOfWork

 public UnitOfWork(IProvider dataProvider)
 {
     provider = dataProvider as Provider;
     if (provider == null)
         throw new Exception("Invalid Data Provider");
     transaction = provider.Session.BeginTransaction();
 }
开发者ID:SpectralAngel,项目名称:Antem,代码行数:7,代码来源:UnitOfWork.cs

示例9: SessionInitializeTransaction

 protected void SessionInitializeTransaction()
 {
     if (session == null) {
         session = NHibernateHelper.OpenSession ();
         tx = session.BeginTransaction ();
     }
 }
开发者ID:pablovargan,项目名称:winforms-ooh4ria,代码行数:7,代码来源:BasicCAD.cs

示例10: if

 //查找用户的基本套餐
 public Int32 getId(Int64 num)
 {
     trans = session.BeginTransaction();
     try
     {
         IEnumerable<Rule> rule = session.CreateQuery("from Rule as c where c.Mobilenumber='" + num + "'").List<Rule>();
         Int32 id = 0;
         foreach (Rule r in rule)
         {
             if (r.Chargeid == 1)
             {
                 id = 1;
                 break;
             }
             else if (r.Chargeid == 2)
             {
                 id = 2;
                 break;
             }
             else if (r.Chargeid == 3)
             {
                 id = 3;
                 break;
             }
             else continue;
         }
         return id;
     }
     catch (Exception)
     {
         throw new Exception();
     }
 }
开发者ID:kutang,项目名称:mobile,代码行数:34,代码来源:RuleDao.cs

示例11: Dispose

        public void Dispose()
        {
            if (disposed)
                return;

            if (session == null)
                return;

            try
            {
                if (preventCommit)
                    transaction.Rollback();
                else
                    transaction.Commit();
            }
            catch
            {
                transaction.Rollback();
                throw;
            }
            finally
            {
                transaction.Dispose();
            }

            session.Dispose();
            session = null;
            transaction = null;
            disposed = true;
        }
开发者ID:BrandyFx,项目名称:Brandy,代码行数:30,代码来源:DefaultSessionProvider.cs

示例12: Setup

 public void Setup()
 {
     session = WindsorPersistenceFixture.Container.Resolve<ISession>();
     repository = new SecurityRepository();
     repository.Session = session;
     tx = session.BeginTransaction();
 }
开发者ID:PolishDev,项目名称:shop-manager,代码行数:7,代码来源:SecurityRepositoryTests.cs

示例13: BeginTransaction

 public void BeginTransaction()
 {
     if (_transaction == null)
     {
         _transaction = Session.BeginTransaction();
     }
 }
开发者ID:RodolfoTI,项目名称:NHibernateBootstrap,代码行数:7,代码来源:UnitOfWorkBase.cs

示例14: Start

 public void Start()
 {
     _session = _sessionSource.CreateSession();
     _session.FlushMode = FlushMode.Commit;
     _transaction = _session.BeginTransaction();
     _isInitialized = true;
 }
开发者ID:rauhryan,项目名称:warmup-templates,代码行数:7,代码来源:NHibernateTransactionBoundary.cs

示例15: UnitOfWork

 public UnitOfWork(ISessionFactory sessionFactory)
 {
     _sessionFactory = sessionFactory;
     CurrentSession = _sessionFactory.OpenSession();
     //CurrentSession.EnableFilter("translationFilter").SetParameter("locale", Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName);
     _transaction = CurrentSession.BeginTransaction();
 }
开发者ID:ankitkumar9018,项目名称:SampleSolrApp,代码行数:7,代码来源:UnitOfWork.cs


注:本文中的ITransaction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。