Exemple #1
0
        public virtual void AfterDelete()
        {
            Type superClass = Reflections.GetBaseType(this.GetType());

            if (superClass != typeof(PersistentEntity))
            {
                PersistentEntity superObject = ((PersistentEntity)Reflections.GetSuperInstanceFromInstance(this));
                superObject.Delete();
            }
        }
Exemple #2
0
        public virtual bool BeforeUpdate()
        {
            Type superClass = Reflections.GetBaseType(this.GetType());

            if (superClass != typeof(PersistentEntity))
            {
                PersistentEntity superObject = ((PersistentEntity)Reflections.GetSuperInstanceFromInstance(this));
                if (superObject.Update())
                {
                    this.SetId(superObject.GetId());
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            return(true);
        }