View Source
Class ContentRepositoryExtensions
Extension methods used to manipulate content variations by the document repository
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public static class ContentRepositoryExtensions
Methods
View Source
AdjustDates(IContent, DateTime, Boolean)
Used to synchronize all culture dates to the same date if they've been modified
Declaration
public static void AdjustDates(this IContent content, DateTime date, bool publishing)
Parameters
Type |
Name |
Description |
IContent |
content |
|
DateTime |
date |
|
System.Boolean |
publishing |
|
View Source
ClearPublishInfo(IContent, String)
Returns false if the culture is already unpublished
Declaration
public static bool ClearPublishInfo(this IContent content, string culture)
Parameters
Type |
Name |
Description |
IContent |
content |
|
System.String |
culture |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
ClearPublishInfos(IContent)
Declaration
public static void ClearPublishInfos(this IContent content)
Parameters
View Source
CopyFrom(IContent, IContent, String)
Copies values from another document.
Declaration
public static void CopyFrom(this IContent content, IContent other, string culture = "*")
Parameters
View Source
GetCulturesUnpublishing(IContent)
Gets the cultures that have been flagged for unpublishing.
Declaration
public static IReadOnlyList<string>? GetCulturesUnpublishing(this IContent content)
Parameters
Returns
Type |
Description |
System.Nullable<IReadOnlyList<System.String>> |
|
View Source
PublishCulture(IContent, CultureImpact)
Sets the publishing values for names and properties.
Declaration
public static bool PublishCulture(this IContent content, CultureImpact impact)
Parameters
Returns
Type |
Description |
System.Boolean |
A value indicating whether it was possible to publish the names and values for the specified
culture(s). The method may fail if required names are not set, but it does NOT validate property data
|
View Source
SetCultureEdited(IContent, Nullable<IEnumerable<String>>)
Declaration
public static void SetCultureEdited(this IContent content, IEnumerable<string>? cultures)
Parameters
Type |
Name |
Description |
IContent |
content |
|
System.Nullable<IEnumerable<System.String>> |
cultures |
|
View Source
SetCultureInfo(IContentBase, String, String, DateTime)
Declaration
public static void SetCultureInfo(this IContentBase content, string culture, string name, DateTime date)
Parameters
Type |
Name |
Description |
IContentBase |
content |
|
System.String |
culture |
|
System.String |
name |
|
DateTime |
date |
|
View Source
SetPublishInfo(IContent, String, String, DateTime)
Declaration
public static void SetPublishInfo(this IContent content, string culture, string name, DateTime date)
Parameters
Type |
Name |
Description |
IContent |
content |
|
System.String |
culture |
|
System.String |
name |
|
DateTime |
date |
|
View Source
TouchCulture(IContentBase, String)
Updates a culture date, if the culture exists.
Declaration
public static void TouchCulture(this IContentBase content, string culture)
Parameters
Type |
Name |
Description |
IContentBase |
content |
|
System.String |
culture |
|
View Source
UnpublishCulture(IContent, String)
Returns false if the culture is already unpublished
Declaration
public static bool UnpublishCulture(this IContent content, string culture = "*")
Parameters
Type |
Name |
Description |
IContent |
content |
|
System.String |
culture |
|
Returns
Type |
Description |
System.Boolean |
|