/// <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); }
/// <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); }