/// <summary> /// Detach the entity from cache /// </summary> internal void DetachCache() { this._entityChangedHandler = null; this._cacheEntry = null; this._entityKey = null; //TODO:this.Relationships.DetachContext(); }
/// <summary> /// Attach the entity to cache /// </summary> /// <param name="cacheEntry"></param> /// <param name="changed"></param> internal void AttachCache(EntityCacheEntry cacheEntry, EntityChangedHandler changed) { if (this._cacheEntry != null) { throw new InvalidOperationException("Entity cannot exist in multiple object caches"); } this._cacheEntry = cacheEntry; this._entityChangedHandler = changed; }