Castle.ActiveRecord.HookDispatcher.IsTransient C# (CSharp) Méthode

IsTransient() public méthode

Called when a transient entity is passed to SaveOrUpdate.
The return value determines if the object is saved - the entity is passed to Save(), resulting in an INSERT - the entity is passed to Update(), resulting in an UPDATE - Hibernate uses the unsaved-value mapping to determine if the object is unsaved
public IsTransient ( object entity ) : bool?
entity object A transient entity
Résultat bool?
        public override bool? IsTransient(object entity)
        {
            ActiveRecordHooksBase hookTarget = entity as ActiveRecordHooksBase;

            if (hookTarget != null)
            {
                return hookTarget.IsUnsaved();
            }

            return null;
        }