Example #1
0
 protected internal override void PreSaving(PreSavingContext ctx)
 {
     if (AllowChange)
     {
         base.PreSaving(ctx);
     }
     else
     if (Modified == ModifiedState.SelfModified)
     {
         throw new InvalidOperationException("Attempt to save a not new modified ImmutableEntity");
     }
 }
Example #2
0
        protected internal override void PreSaving(PreSavingContext ctx)
        {
            base.PreSaving(ctx);

            if (Corrupt)
            {
                var integrity = MainEntity.EntityIntegrityCheckBase(); // So, no corruption allowed
                if (integrity == null)
                {
                    this.Corrupt = false;
                    if (!MainEntity.IsNew)
                    {
                        Corruption.OnCorruptionRemoved(MainEntity);
                    }
                }
                else if (MainEntity.IsNew)
                {
                    Corruption.OnSaveCorrupted(MainEntity, integrity);
                }
            }
        }
Example #3
0
 protected internal virtual void PreSaving(PreSavingContext ctx)
 {
 }
Example #4
0
 protected internal override void PreSaving(PreSavingContext ctx)
 {
 }