コード例 #1
0
        public IEntityMapper GetEntityMapper(Jiesen.DapperPoco.DbContext dbCtx)
        {
            var key = dbCtx.GetType().TypeHandle;

            return(_entityMappers.GetOrAdd(key, () =>
            {
                var eBuilder = new EntitiesBuilder();
                dbCtx.OnEntitiesBuilding(eBuilder);

                return new DefaultEntityMapper(eBuilder.Build());
            }));
        }
コード例 #2
0
ファイル: Transaction.cs プロジェクト: sachem1/DapperPoco
 public void Complete()
 {
     _dbCtx.CommitTransaction();
     _dbCtx = null;
 }
コード例 #3
0
ファイル: Transaction.cs プロジェクト: sachem1/DapperPoco
 public Transaction(Jiesen.DapperPoco.DbContext dbCtx, IsolationLevel isolation = IsolationLevel.ReadCommitted)
 {
     _dbCtx = dbCtx;
     dbCtx.BeginTransaction(isolation);
 }