November Happy Hour will be moved to Thursday December 5th.

Class DefaultContentProviderDatabase

Abstraction for working with data access classes

Inheritance
System.Object
DefaultContentProviderDatabase
Namespace: EPiServer.Core.Internal
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
[ServiceConfiguration]
public class DefaultContentProviderDatabase : Object

Constructors

DefaultContentProviderDatabase(ServiceAccessor<ContentListDB>, ServiceAccessor<ContentLoadDB>, ServiceAccessor<ContentSaveDB>, ServiceAccessor<ContentSoftLinkIndexer>, ServiceAccessor<IContentSoftLinkRepository>, ServiceAccessor<ContentSoftLinkDB>, BlobDB, IStatusTransitionEvaluator)

Declaration
public DefaultContentProviderDatabase(ServiceAccessor<ContentListDB> contentListDBAccessor, ServiceAccessor<ContentLoadDB> contentLoadDBAccessor, ServiceAccessor<ContentSaveDB> contentSaveDataAccess, ServiceAccessor<ContentSoftLinkIndexer> contentSoftLinkIndexer, ServiceAccessor<IContentSoftLinkRepository> contentSoftLinkRepo, ServiceAccessor<ContentSoftLinkDB> softLinkDBAccessor, BlobDB blobDB, IStatusTransitionEvaluator statusTransitionEvaluator)
Parameters
Type Name Description
ServiceAccessor<ContentListDB> contentListDBAccessor
ServiceAccessor<ContentLoadDB> contentLoadDBAccessor
ServiceAccessor<ContentSaveDB> contentSaveDataAccess
ServiceAccessor<ContentSoftLinkIndexer> contentSoftLinkIndexer
ServiceAccessor<IContentSoftLinkRepository> contentSoftLinkRepo
ServiceAccessor<ContentSoftLinkDB> softLinkDBAccessor
BlobDB blobDB
IStatusTransitionEvaluator statusTransitionEvaluator

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 true [force delete].

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 true [force delete].

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 true references to descendents are included.

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 true only published content is checked.

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 true [only published].

Returns
Type Description
System.Collections.Generic.IList<ContentUsage>

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>

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 true [archive].

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.

Extension Methods