Class DefaultContentVersionRepository
Inheritance
Namespace: EPiServer.DataAbstraction.Internal
Assembly: EPiServer.dll
Version: 12.0.3Syntax
[ServiceConfiguration]
public class DefaultContentVersionRepository : Object, IContentVersionRepository, IContentVersionRepositoryEx
Constructors
DefaultContentVersionRepository(ServiceAccessor<ContentVersionDB>, ISynchronizedObjectInstanceCache, IContentCacheKeyCreator, ContentOptions)
Declaration
public DefaultContentVersionRepository(ServiceAccessor<ContentVersionDB> versionDD, ISynchronizedObjectInstanceCache cache, IContentCacheKeyCreator cacheKeyCreator, ContentOptions contentOptions)
Parameters
Type | Name | Description |
---|---|---|
Service |
versionDD | |
ISynchronized |
cache | |
IContent |
cacheKeyCreator | |
Content |
contentOptions |
Fields
CachedContentVersionKey
Declaration
public const string CachedContentVersionKey = "EP:ContentVersion:"
Field Value
Type | Description |
---|---|
System. |
Methods
ClearCache(ContentReference)
Declaration
public void ClearCache(ContentReference contentLink)
Parameters
Type | Name | Description |
---|---|---|
Content |
contentLink |
Delete(ContentReference)
Delete a single version of a Content
Declaration
public virtual void Delete(ContentReference contentLink)
Parameters
Type | Name | Description |
---|---|---|
Content |
contentLink | The content link. |
DeleteVersionByDataAccess(ContentReference)
Deletes the version from Respository.
Declaration
protected virtual void DeleteVersionByDataAccess(ContentReference contentLink)
Parameters
Type | Name | Description |
---|---|---|
Content |
contentLink | The content link. |
Initialize(IContentEvents)
Declaration
public void Initialize(IContentEvents contentEvents)
Parameters
Type | Name | Description |
---|---|---|
IContent |
contentEvents |
List(VersionFilter, Int32, Int32, out Int32)
Lists all versions that matches the filter
Declaration
public IEnumerable<ContentVersion> List(VersionFilter filter, int startIndex, int maxRows, out int totalCount)
Parameters
Type | Name | Description |
---|---|---|
Version |
filter | The filter used |
System. |
startIndex | The start index, used for paging |
System. |
maxRows | The maximum number of rows returned |
System. |
totalCount | The total amount of matched versions |
Returns
Type | Description |
---|---|
System. |
A list of versions, if no versions where matched an empty list will be returned |
ListObsolete(Int32, out Int32)
Declaration
public IEnumerable<ContentVersion> ListObsolete(int maxRows, out int totalCount)
Parameters
Type | Name | Description |
---|---|---|
System. |
maxRows | |
System. |
totalCount |
Returns
Type | Description |
---|---|
System. |
Load(ContentReference)
Loads the version.
Declaration
public virtual ContentVersion Load(ContentReference contentLink)
Parameters
Type | Name | Description |
---|---|---|
Content |
contentLink | The content link. |
Returns
Type | Description |
---|---|
Content |
LoadCommonDraft(ContentReference, String)
Loads the common draft.
Declaration
public virtual ContentVersion LoadCommonDraft(ContentReference contentLink, string language)
Parameters
Type | Name | Description |
---|---|---|
Content |
contentLink | The content link to load common draft for. |
System. |
language | The language. |
Returns
Type | Description |
---|---|
Content |
CommonDraft if it exist, otherwise Published, If no published exist the latest saved version is returned |
LoadPublished(ContentReference)
Loads the published version
Declaration
public virtual ContentVersion LoadPublished(ContentReference contentLink)
Parameters
Type | Name | Description |
---|---|---|
Content |
contentLink | The content link. |
Returns
Type | Description |
---|---|
Content |
LoadPublished(ContentReference, String)
Loads the published version a page with current language selection if the languageBranch is null otherwise loads the published version a page for a specific language
Declaration
public virtual ContentVersion LoadPublished(ContentReference contentLink, string languageBranch)
Parameters
Type | Name | Description |
---|---|---|
Content |
contentLink | The content link. |
System. |
languageBranch | The language branch. |
Returns
Type | Description |
---|---|
Content |
SetCommonDraft(ContentReference)
Sets the specified version as common draft.
Declaration
public void SetCommonDraft(ContentReference contentLink)
Parameters
Type | Name | Description |
---|---|---|
Content |
contentLink | The content link. |