Rebel.Cms.Web.TypedEntityExtensions.IsContent C# (CSharp) Method

IsContent() public static method

Determines whether the specified entity is content.
public static IsContent ( this entity, IReadonlyGroupUnit uow ) : bool
entity this The entity.
uow IReadonlyGroupUnit
return bool
        public static bool IsContent(this TypedEntity entity, IReadonlyGroupUnit<IContentStore> uow)
        {
            var ancestorRelations = uow.Repositories.GetAncestorRelations(entity.Id, FixedRelationTypes.DefaultRelationType).ToArray();
            return ancestorRelations.Any(x => x.SourceId.Value == FixedHiveIds.ContentVirtualRoot.Value);
        }
TypedEntityExtensions