• Core
  • Infrastructure
  • Web
  • Extensions
Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentRepositoryExtensions

    Extension methods used to manipulate content variations by the document repository

    Inheritance
    System.Object
    Namespace: Umbraco.Extensions
    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
    Remarks

    This is so that in an operation where (for example) 2 languages are updates like french and english, it is possible that these dates assigned to them differ by a couple of Ticks, but we need to ensure they are persisted at the exact same time.

    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
    Type Name Description
    IContent content
    View Source

    CopyFrom(IContent, IContent, String)

    Copies values from another document.

    Declaration
    public static void CopyFrom(this IContent content, IContent other, string culture = "*")
    Parameters
    Type Name Description
    IContent content
    IContent other
    System.String culture
    View Source

    GetCulturesUnpublishing(IContent)

    Gets the cultures that have been flagged for unpublishing.

    Declaration
    public static IReadOnlyList<string>? GetCulturesUnpublishing(this IContent content)
    Parameters
    Type Name Description
    IContent content
    Returns
    Type Description
    System.Nullable<IReadOnlyList<System.String>>
    Remarks

    Gets cultures for which content.UnpublishCulture() has been invoked.

    View Source

    PublishCulture(IContent, CultureImpact)

    Sets the publishing values for names and properties.

    Declaration
    public static bool PublishCulture(this IContent content, CultureImpact impact)
    Parameters
    Type Name Description
    IContent content
    CultureImpact impact
    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
    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • AdjustDates(IContent, DateTime, Boolean)
      • ClearPublishInfo(IContent, String)
      • ClearPublishInfos(IContent)
      • CopyFrom(IContent, IContent, String)
      • GetCulturesUnpublishing(IContent)
      • PublishCulture(IContent, CultureImpact)
      • SetCultureEdited(IContent, Nullable<IEnumerable<String>>)
      • SetCultureInfo(IContentBase, String, String, DateTime)
      • SetPublishInfo(IContent, String, String, DateTime)
      • TouchCulture(IContentBase, String)
      • UnpublishCulture(IContent, String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX