Esempio n. 1
0
        /// <summary>
        /// Put a <seealso cref="DbEntityState.MERGED"/> object into the cache.
        /// </summary>
        /// <param name="e"> the object to put into the cache </param>
        public virtual void putMerged(DbEntity e)
        {
            CachedDbEntity cachedDbEntity = new CachedDbEntity();

            cachedDbEntity.Entity      = e;
            cachedDbEntity.EntityState = MERGED;
            cachedDbEntity.determineEntityReferences();
            // no copy required

            putInternal(cachedDbEntity);
        }
Esempio n. 2
0
        /// <summary>
        /// Put a <seealso cref="DbEntityState.PERSISTENT"/> object into the cache.
        /// </summary>
        /// <param name="e"> the object to put into the cache </param>
        public virtual void putPersistent(DbEntity e)
        {
            CachedDbEntity cachedDbEntity = new CachedDbEntity();

            cachedDbEntity.Entity      = e;
            cachedDbEntity.EntityState = PERSISTENT;
            cachedDbEntity.determineEntityReferences();
            cachedDbEntity.makeCopy();

            putInternal(cachedDbEntity);
        }