コード例 #1
0
        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_Owner.HasValue)
            {
                OwnerImpl = (Zetbox.App.Base.IdentityEfImpl)Context.Find <Zetbox.App.Base.Identity>(_fk_Owner.Value);
            }
            else
            {
                OwnerImpl = null;
            }

            if (_fk_guid_Type.HasValue)
            {
                TypeImpl = (Zetbox.App.Base.ObjectClassEfImpl)Context.FindPersistenceObject <Zetbox.App.Base.ObjectClass>(_fk_guid_Type.Value);
            }
            else
            if (_fk_Type.HasValue)
            {
                TypeImpl = (Zetbox.App.Base.ObjectClassEfImpl)Context.Find <Zetbox.App.Base.ObjectClass>(_fk_Type.Value);
            }
            else
            {
                TypeImpl = null;
            }
        }
コード例 #2
0
        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_Owner.HasValue)
                OwnerImpl = (Zetbox.App.Base.IdentityEfImpl)Context.Find<Zetbox.App.Base.Identity>(_fk_Owner.Value);
            else
                OwnerImpl = null;

            if (_fk_guid_Type.HasValue)
                TypeImpl = (Zetbox.App.Base.ObjectClassEfImpl)Context.FindPersistenceObject<Zetbox.App.Base.ObjectClass>(_fk_guid_Type.Value);
            else
            if (_fk_Type.HasValue)
                TypeImpl = (Zetbox.App.Base.ObjectClassEfImpl)Context.Find<Zetbox.App.Base.ObjectClass>(_fk_Type.Value);
            else
                TypeImpl = null;
            // fix cached lists references
        }