Ejemplo 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(IDbEntity e)
        {
            var cachedDbEntity = new CachedDbEntity();

            cachedDbEntity.Entity      = e;
            cachedDbEntity.EntityState = DbEntityState.Merged;
            cachedDbEntity.DetermineEntityReferences();
            // no copy required

            PutInternal(cachedDbEntity);
        }
Ejemplo 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(IDbEntity e)
        {
            var cachedDbEntity = new CachedDbEntity();

            cachedDbEntity.Entity      = e;
            cachedDbEntity.EntityState = DbEntityState.Persistent;
            cachedDbEntity.DetermineEntityReferences();
            cachedDbEntity.MakeCopy();

            PutInternal(cachedDbEntity);
        }