Exemplo n.º 1
0
 void IDbEntitySetInternal.MakeReadOnly()
 {
     if (valuesLoaded)
     {
         foreignKeys = null;
         columns     = null;
         setParent   = null;
         db          = null;
     }
 }
Exemplo n.º 2
0
        private void InitDb()
        {
            var dbConfiguration = GlobalDbConfiguration.GetConfigurationOrEmpty(typeof(TMember));

            if (dbConfiguration.GetDbForEvilLazyLoad != null)
            {
                db = dbConfiguration.GetDbForEvilLazyLoad();
            }
            else
            {
                throw new LazyLoadUnattachedEntityException("Lazy loading on a newly created entity which was not loaded from database is not allowed!");
            }
        }
Exemplo n.º 3
0
 internal void Init(
     IDb db,
     bool isForeignKey,
     Func <long?>[] foreignKeys,
     string[] columns,
     Action <TMember, DbEntity> setParent,
     DbEntity parent,
     bool lazyLoadValues,
     Action <TMember> beforeRightsCheckAction,
     Action <TMember> afterRightsCheckAction)
 {
     this.columns                 = columns;
     this.isForeignKey            = isForeignKey;
     this.parent                  = parent;
     this.setParent               = setParent;
     this.db                      = (IDbInternal)db;
     this.foreignKeys             = foreignKeys;
     this.lazyLoadValues          = lazyLoadValues;
     this.beforeRightsCheckAction = beforeRightsCheckAction;
     this.afterRightsCheckAction  = afterRightsCheckAction;
 }
Exemplo n.º 4
0
 void IDbEntityInternal.SetDb(IDbInternal db) => _db = db;
Exemplo n.º 5
0
 void IDbEntitySetInternal.SetDb(BaseDb db) => this.db = db;
Exemplo n.º 6
0
 protected void Init(IDb db, bool isForeignKey, string[] idColumnNames)
 {
     this.isForeignKey  = isForeignKey;
     this.idColumnNames = idColumnNames;
     this.db            = (IDbInternal)db;
 }
 internal MultipleResultSetReader(DbSqlCommand sqlCommand, IDbInternal db)
 {
     this.sqlCommand = sqlCommand;
     this.db         = db;
 }