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"); } }
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); } } }
protected internal virtual void PreSaving(PreSavingContext ctx) { }
protected internal override void PreSaving(PreSavingContext ctx) { }