Try our conversational search powered by Generative AI!

Class ContentRootService

Service registry for content roots.

Inheritance
System.Object
ContentRootService
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public abstract class ContentRootService

Constructors

ContentRootService()

Declaration
protected ContentRootService()

Methods

Get(String)

Get the root content for the root name.

Declaration
public abstract ContentReference Get(string rootName)
Parameters
Type Name Description
System.String rootName
Returns
Type Description
ContentReference

The content root

List()

List of content roots.

Declaration
public abstract IEnumerable<ContentReference> List()
Returns
Type Description
System.Collections.Generic.IEnumerable<ContentReference>

Register<T>(String, Guid, ContentReference)

Register a content root for the root name with specific contentRootId. A Content of type T is created as a content root with the contentRootId.

Declaration
public abstract void Register<T>(string rootName, Guid contentRootId, ContentReference parent)

    where T : IContent
Parameters
Type Name Description
System.String rootName

The root name

System.Guid contentRootId

The content root id

ContentReference parent

The partent of root

Type Parameters
Name Description
T

The type of root content

Exceptions
Type Condition
System.NotSupportedException

If the rootname is already registered with another contentRootId.

Unregister(String)

Un-register the content root.

Declaration
public abstract void Unregister(string rootName)
Parameters
Type Name Description
System.String rootName

The root name

Extension Methods