using System; using System.Collections.Generic; using System.Linq; using System.Text; using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Models { public static class EntityExtensions { /// /// Returns true if this entity has just been created and persisted to the data store /// /// /// /// /// This is useful when handling events to determine if an entity is a brand new entity or was /// already existing. /// public static bool IsNewEntity(this IEntity entity) { var dirty = (IRememberBeingDirty)entity; return dirty.WasPropertyDirty("Id"); } } }