Ejemplo n.º 1
0
        public void Dispose()
        {
            if (mMode == UnitOfWorkMode.Tracking && mTransaction != null)
            {
                mTransaction.Dispose();
                mTransaction = null;

                if (!mIsTransactionFinalized)
                {
                    if (mScope != null)
                    {
                        LogHelper.LogInfo(mScope, ERROR_MESSAGE_TRANSACTION_NOT_FINALIZED);
                    }
                    else
                    {
                        LogHelper.LogInfo <RepoUnitOfWork>(ERROR_MESSAGE_TRANSACTION_NOT_FINALIZED);
                    }
                }
            }

            if (mContext != null)
            {
                mContext.Dispose();
                mContext = null;
            }
        }
Ejemplo n.º 2
0
        private void InitializeUnitOfWork(UnitOfWorkMode mode)
        {
            mContext = new ClasaEntitiesDb();

            if (mRepositories == null)
            {
                InitializeRepositoriesIoc();
            }

            if (mode == UnitOfWorkMode.Tracking)
            {
                mTransaction = mContext.Database.BeginTransaction();
            }
        }
Ejemplo n.º 3
0
 protected GenericDataRepository()
 {
     Context            = new ClasaEntitiesDb();
     IsEntityTrackingOn = false;
 }
Ejemplo n.º 4
0
 public OrderedConfigurableQuery(ClasaEntitiesDb context, IOrderedQueryable <TEntity> dbQuery)
 {
     mContext = context;
     mDbQuery = dbQuery;
 }