Class ContentStore
Repository for working with ContentData.
Inheritance
Inherited Members
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 8.11.0Syntax
[ServiceConfiguration]
public class ContentStoreConstructors
ContentStore()
Initializes a new instance of the ContentStore class.
Declaration
public ContentStore()ContentStore(ServiceAccessor<ContentListDB>, ServiceAccessor<ContentLoadDB>, ServiceAccessor<ContentSaveDB>, ServiceAccessor<ContentSoftLinkIndexer>, ServiceAccessor<ContentSoftLinkRepository>, ServiceAccessor<ContentSoftLinkDB>)
Initializes a new instance of the ContentStore class.
Declaration
public ContentStore(ServiceAccessor<ContentListDB> contentListDBAccessor, ServiceAccessor<ContentLoadDB> contentLoadDBAccessor, ServiceAccessor<ContentSaveDB> contentSaveDataAccess, ServiceAccessor<ContentSoftLinkIndexer> contentSoftLinkIndexer, ServiceAccessor<ContentSoftLinkRepository> contentSoftLinkRepo, ServiceAccessor<ContentSoftLinkDB> softLinkDBAccessor)Parameters
| Type | Name | Description | 
|---|---|---|
| ServiceAccessor<ContentListDB> | contentListDBAccessor | The page list data access. | 
| ServiceAccessor<ContentLoadDB> | contentLoadDBAccessor | The page load data access. | 
| ServiceAccessor<ContentSaveDB> | contentSaveDataAccess | The page save data access. | 
| ServiceAccessor<ContentSoftLinkIndexer> | contentSoftLinkIndexer | Responsible for extracting links | 
| ServiceAccessor<ContentSoftLinkRepository> | contentSoftLinkRepo | Responsible for saving extracted links | 
| ServiceAccessor<ContentSoftLinkDB> | softLinkDBAccessor | Deals with links to and from content | 
Methods
CountDescendants(ContentReference)
Counts the descendants.
Declaration
public virtual int CountDescendants(ContentReference contentLink)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | 
Delete(ContentReference, Boolean)
Deletes the specified content link.
Declaration
public virtual void Delete(ContentReference contentLink, bool forceDelete)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
| System.Boolean | forceDelete | if set to  | 
DeleteChildren(ContentReference, Boolean)
Deletes the children.
Declaration
public virtual void DeleteChildren(ContentReference contentLink, bool forceDelete)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
| System.Boolean | forceDelete | if set to  | 
DeleteLanguage(ContentReference, String)
Deletes the language.
Declaration
public virtual void DeleteLanguage(ContentReference contentLink, string languageBranch)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
| System.String | languageBranch | The language branch. | 
GetReferenceInformationForContent(ContentReference, Boolean)
Gets the content of the reference information for.
Declaration
public virtual IEnumerable<ReferenceInformation> GetReferenceInformationForContent(ContentReference contentLink, bool includeDecendents)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
| System.Boolean | includeDecendents | if set to  | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<ReferenceInformation> | 
IsContentTypeUsed(ContentType, Boolean)
Checks if a content type is used.
Declaration
public virtual bool IsContentTypeUsed(ContentType contentType, bool onlyPublished)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentType | contentType | Type of the content. | 
| System.Boolean | onlyPublished | if set to  | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
ListAll()
Lists all.
Declaration
public virtual IList<ContentReference> ListAll()Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<ContentReference> | 
ListAll(ContentReference)
Lists all.
Declaration
public virtual IList<ContentReference> ListAll(ContentReference contentLink)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<ContentReference> | 
ListAll(ContentReference, String)
Lists all.
Declaration
public virtual IList<ContentReference> ListAll(ContentReference contentLink, string languageBranch)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
| System.String | languageBranch | The language branch. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<ContentReference> | 
ListContentOfContentType(ContentType, Boolean)
Lists the contents of the content type.
Declaration
public virtual IList<ContentUsage> ListContentOfContentType(ContentType contentType, bool onlyPublished)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentType | contentType | Type of the content. | 
| System.Boolean | onlyPublished | if set to  | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<ContentUsage> | 
ListExternalFolderIDs()
Lists the external folder I ds.
Declaration
public virtual IList<int> ListExternalFolderIDs()Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<System.Int32> | 
ListMatchingSegments(ContentReference, String)
Lists references to all children content items that have matching routing/url segments.
Declaration
public virtual IList<MatchingSegmentResult> ListMatchingSegments(ContentReference parentLink, string urlSegment)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | parentLink | The parent link. | 
| System.String | urlSegment | The URL segment. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<MatchingSegmentResult> | 
Load(ContentReference, Int32)
Loads the content.
Declaration
public virtual IContent Load(ContentReference contentLink, int languageBranchID)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
| System.Int32 | languageBranchID | The language branch ID. | 
Returns
| Type | Description | 
|---|---|
| IContent | 
LoadChildrenReferencesAndTypes(Int32, String, out FilterSortOrder)
load content references and content types
Declaration
public virtual IList<GetChildrenReferenceResult> LoadChildrenReferencesAndTypes(int contentID, string languageID, out FilterSortOrder parentSortOrder)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | contentID | |
| System.String | languageID | |
| FilterSortOrder | parentSortOrder | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<GetChildrenReferenceResult> | 
LoadLongString(Guid)
Loads the long string.
Declaration
public virtual string LoadLongString(Guid longStringGuid)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Guid | longStringGuid | The long string GUID. | 
Returns
| Type | Description | 
|---|---|
| System.String | 
LoadSpecificContentInstances(IList<ContentReference>, Int32)
Loads the specific content instances.
Declaration
public virtual IList<IContent> LoadSpecificContentInstances(IList<ContentReference> contentLinks, int languageBranchID)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Collections.Generic.IList<ContentReference> | contentLinks | The content links. | 
| System.Int32 | languageBranchID | The language branch ID. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<IContent> | 
LoadSpecificContentInstances(Int32[])
Loads the specific content instances.
Declaration
[Obsolete("Use overload that uses an IList<ContentReference> as parameter")]
public virtual IList<IContent> LoadSpecificContentInstances(int[] contentLinks)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32[] | contentLinks | The content links. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<IContent> | 
LoadSpecificContentInstances(Int32[], Int32)
Loads the specific content instances.
Declaration
[Obsolete("Use overload that uses an IList<ContentReference> as parameter")]
public virtual IList<IContent> LoadSpecificContentInstances(int[] contentLinks, int languageBranchID)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32[] | contentLinks | The content links. | 
| System.Int32 | languageBranchID | The language branch ID. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<IContent> | 
LoadSpecificContentVersions(IList<ContentReference>)
Batch loads specific versions of content.
Declaration
public virtual IList<IContent> LoadSpecificContentVersions(IList<ContentReference> contentLinks)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Collections.Generic.IList<ContentReference> | contentLinks | The versions to load. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<IContent> | 
Remarks
WorkID must be set on all versions otherwise System.ArgumentException is thrown.
LoadVersion(ContentReference)
Loads the version.
Declaration
public virtual IContent LoadVersion(ContentReference contentLink)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
Returns
| Type | Description | 
|---|---|
| IContent | 
LoadVersion(ContentReference, Int32)
Loads the version.
Declaration
public virtual IContent LoadVersion(ContentReference contentLink, int languageBranchID)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
| System.Int32 | languageBranchID | The language branch ID. | 
Returns
| Type | Description | 
|---|---|
| IContent | 
Move(ContentReference, ContentReference)
Moves the specified content link.
Declaration
public virtual void Move(ContentReference contentLink, ContentReference destinationLink)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
| ContentReference | destinationLink | The destination link. | 
Move(Int32, Int32, Boolean)
Moves the specified content link.
Declaration
public virtual void Move(int contentLink, int destinationLinkID, bool archive)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | contentLink | The content link. | 
| System.Int32 | destinationLinkID | The destination link ID. | 
| System.Boolean | archive | if set to  | 
MoveToWastebasket(ContentReference, String)
Moves to wastebasket.
Declaration
public virtual void MoveToWastebasket(ContentReference contentLink, string deletedBy)Parameters
| Type | Name | Description | 
|---|---|---|
| ContentReference | contentLink | The content link. | 
| System.String | deletedBy | The user who delete the content. | 
Save(IContent, SaveAction, String)
Saves the specified content.
Declaration
public virtual ContentReference Save(IContent content, SaveAction action, string currentUser)Parameters
| Type | Name | Description | 
|---|---|---|
| IContent | content | The content. | 
| SaveAction | action | The action. | 
| System.String | currentUser | The current user. | 
Returns
| Type | Description | 
|---|---|
| ContentReference | 
Save(IContent, String)
Saves the specified content.
Declaration
public virtual void Save(IContent content, string currentUser)Parameters
| Type | Name | Description | 
|---|---|---|
| IContent | content | The content. | 
| System.String | currentUser | The current user. | 
