public override void ReloadReferences() { // Do not reload references if the current object has been deleted. // TODO: enable when MemoryContext uses MemoryDataObjects //if (this.ObjectState == DataObjectState.Deleted) return; base.ReloadReferences(); // fix direct object references if (_fk_ChangedBy.HasValue) { ChangedByImpl = (Zetbox.App.Base.IdentityEfImpl)Context.Find <Zetbox.App.Base.Identity>(_fk_ChangedBy.Value); } else { ChangedByImpl = null; } if (_fk_CreatedBy.HasValue) { CreatedByImpl = (Zetbox.App.Base.IdentityEfImpl)Context.Find <Zetbox.App.Base.Identity>(_fk_CreatedBy.Value); } else { CreatedByImpl = null; } if (_fk_guid_Module.HasValue) { ModuleImpl = (Zetbox.App.Base.ModuleEfImpl)Context.FindPersistenceObject <Zetbox.App.Base.Module>(_fk_guid_Module.Value); } else if (_fk_Module.HasValue) { ModuleImpl = (Zetbox.App.Base.ModuleEfImpl)Context.Find <Zetbox.App.Base.Module>(_fk_Module.Value); } else { ModuleImpl = null; } }
public override void ReloadReferences() { // Do not reload references if the current object has been deleted. // TODO: enable when MemoryContext uses MemoryDataObjects //if (this.ObjectState == DataObjectState.Deleted) return; base.ReloadReferences(); // fix direct object references if (_fk_ChangedBy.HasValue) ChangedByImpl = (Zetbox.App.Base.IdentityEfImpl)Context.Find<Zetbox.App.Base.Identity>(_fk_ChangedBy.Value); else ChangedByImpl = null; if (_fk_CreatedBy.HasValue) CreatedByImpl = (Zetbox.App.Base.IdentityEfImpl)Context.Find<Zetbox.App.Base.Identity>(_fk_CreatedBy.Value); else CreatedByImpl = null; if (_fk_Module.HasValue) ModuleImpl = (Zetbox.App.Base.ModuleEfImpl)Context.Find<Zetbox.App.Base.Module>(_fk_Module.Value); else ModuleImpl = null; // fix cached lists references }