Ejemplo n.º 1
0
        public UnitOfWork(ReyukoContext context)
        {
            _context = context;
            string timeOut = ConfigurationManager.AppSettings.Get("CommandTimeOut");

            if (!string.IsNullOrEmpty(timeOut))
            {
                _context.Database.CommandTimeout = int.Parse(timeOut);
            }
        }
Ejemplo n.º 2
0
        public DBTransaction(ReyukoContext context, System.Data.IsolationLevel isolationLevel = System.Data.IsolationLevel.Snapshot)
        {
            string contextName = AppConfig.Current.ContextName;

            if (contextName.ToLower() == "localcontext")
            {
                _transaction = context.Database.BeginTransaction();
            }
            else
            {
                _transaction = context.Database.BeginTransaction(isolationLevel);
            }
        }