using Umbraco.Core.Models.Entities;
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 IRememberBeingDirty entity)
{
return entity.WasPropertyDirty("Id");
}
}
}