Class PublishedContentExtensions
Provides extension methods for IPublishedContent
.
Inheritance
Namespace: Umbraco.Web
Assembly: Umbraco.Web.dll
Syntax
public static class PublishedContentExtensions
Methods
View SourceAncestor(IPublishedContent)
Gets the ancestor of the content, ie its parent.
Declaration
public static IPublishedContent Ancestor(this IPublishedContent content)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
IPublishedContent | The ancestor of the content. |
Remarks
This method is here for consistency purposes but does not make much sense.
Ancestor(IPublishedContent, Int32)
Gets the nearest ancestor of the content, at a lever lesser or equal to a specified level.
Declaration
public static IPublishedContent Ancestor(this IPublishedContent content, int maxLevel)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Int32 | maxLevel | The level. |
Returns
Type | Description |
---|---|
IPublishedContent | The nearest (in down-top order) ancestor of the content, at a level lesser or equal to the specified level. |
Remarks
Does not consider the content itself. May return null
.
Ancestor(IPublishedContent, String)
Gets the nearest ancestor of the content, of a specified content type.
Declaration
public static IPublishedContent Ancestor(this IPublishedContent content, string contentTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | contentTypeAlias | The content type alias. |
Returns
Type | Description |
---|---|
IPublishedContent | The nearest (in down-top order) ancestor of the content, of the specified content type. |
Remarks
Does not consider the content itself. May return null
.
Ancestor<T>(IPublishedContent)
Gets the nearest ancestor of the content, of a specified content type.
Declaration
public static T Ancestor<T>(this IPublishedContent content)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
T | The nearest (in down-top order) ancestor of the content, of the specified content type. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Remarks
Does not consider the content itself. May return null
.
Ancestor<T>(IPublishedContent, Int32)
Gets the nearest ancestor of the content, at the specified level and of the specified content type.
Declaration
public static T Ancestor<T>(this IPublishedContent content, int maxLevel)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Int32 | maxLevel | The level. |
Returns
Type | Description |
---|---|
T | The ancestor of the content, at the specified level and of the specified content type. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Remarks
Does not consider the content itself. If the ancestor at the specified level is
not of the specified type, returns null
.
AncestorOrSelf(IPublishedContent)
Gets the content or its nearest ancestor.
Declaration
public static IPublishedContent AncestorOrSelf(this IPublishedContent content)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
IPublishedContent | The content. |
Remarks
This method is here for consistency purposes but does not make much sense.
AncestorOrSelf(IPublishedContent, Int32)
Gets the content or its nearest ancestor, at a lever lesser or equal to a specified level.
Declaration
public static IPublishedContent AncestorOrSelf(this IPublishedContent content, int maxLevel)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Int32 | maxLevel | The level. |
Returns
Type | Description |
---|---|
IPublishedContent | The content or its nearest (in down-top order) ancestor, at a level lesser or equal to the specified level. |
Remarks
May or may not return the content itself depending on its level. May return null
.
AncestorOrSelf(IPublishedContent, String)
Gets the content or its nearest ancestor, of a specified content type.
Declaration
public static IPublishedContent AncestorOrSelf(this IPublishedContent content, string contentTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | contentTypeAlias | The content type. |
Returns
Type | Description |
---|---|
IPublishedContent | The content or its nearest (in down-top order) ancestor, of the specified content type. |
Remarks
May or may not return the content itself depending on its content type. May return null
.
AncestorOrSelf<T>(IPublishedContent)
Gets the content or its nearest ancestor, of a specified content type.
Declaration
public static T AncestorOrSelf<T>(this IPublishedContent content)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
T | The content or its nearest (in down-top order) ancestor, of the specified content type. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Remarks
May or may not return the content itself depending on its content type. May return null
.
AncestorOrSelf<T>(IPublishedContent, Int32)
Gets the content or its nearest ancestor, at a lever lesser or equal to a specified level, and of a specified content type.
Declaration
public static T AncestorOrSelf<T>(this IPublishedContent content, int maxLevel)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Int32 | maxLevel | The level. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Ancestors(IPublishedContent)
Gets the ancestors of the content.
Declaration
public static IEnumerable<IPublishedContent> Ancestors(this IPublishedContent content)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The ancestors of the content, in down-top order. |
Remarks
Does not consider the content itself.
Ancestors(IPublishedContent, Int32)
Gets the ancestors of the content, at a level lesser or equal to a specified level.
Declaration
public static IEnumerable<IPublishedContent> Ancestors(this IPublishedContent content, int maxLevel)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Int32 | maxLevel | The level. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The ancestors of the content, at a level lesser or equal to the specified level, in down-top order. |
Remarks
Does not consider the content itself. Only content that are "high enough" in the tree are returned.
Ancestors(IPublishedContent, String)
Gets the ancestors of the content, of a specified content type.
Declaration
public static IEnumerable<IPublishedContent> Ancestors(this IPublishedContent content, string contentTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | contentTypeAlias | The content type. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The ancestors of the content, of the specified content type, in down-top order. |
Remarks
Does not consider the content itself. Returns all ancestors, of the specified content type.
Ancestors<T>(IPublishedContent)
Gets the ancestors of the content, of a specified content type.
Declaration
public static IEnumerable<T> Ancestors<T>(this IPublishedContent content)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | The ancestors of the content, of the specified content type, in down-top order. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Remarks
Does not consider the content itself. Returns all ancestors, of the specified content type.
Ancestors<T>(IPublishedContent, Int32)
Gets the ancestors of the content, at a level lesser or equal to a specified level, and of a specified content type.
Declaration
public static IEnumerable<T> Ancestors<T>(this IPublishedContent content, int maxLevel)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Int32 | maxLevel | The level. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | The ancestors of the content, at a level lesser or equal to the specified level, and of the specified content type, in down-top order. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Remarks
Does not consider the content itself. Only content that are "high enough" in the trees, and of the specified content type, are returned.
AncestorsOrSelf(IPublishedContent)
Gets the content and its ancestors.
Declaration
public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The content and its ancestors, in down-top order. |
AncestorsOrSelf(IPublishedContent, Boolean, Func<IPublishedContent, Boolean>)
Declaration
public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, bool orSelf, Func<IPublishedContent, bool> func)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Boolean | orSelf | |
System.Func<IPublishedContent, System.Boolean> | func |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> |
AncestorsOrSelf(IPublishedContent, Int32)
Gets the content and its ancestors, at a level lesser or equal to a specified level.
Declaration
public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, int maxLevel)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Int32 | maxLevel | The level. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The content and its ancestors, at a level lesser or equal to the specified level, in down-top order. |
Remarks
Only content that are "high enough" in the tree are returned. So it may or may not begin with the content itself, depending on its level.
AncestorsOrSelf(IPublishedContent, String)
Gets the content and its ancestors, of a specified content type.
Declaration
public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, string contentTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | contentTypeAlias | The content type. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The content and its ancestors, of the specified content type, in down-top order. |
Remarks
May or may not begin with the content itself, depending on its content type.
AncestorsOrSelf<T>(IPublishedContent)
Gets the content and its ancestors, of a specified content type.
Declaration
public static IEnumerable<T> AncestorsOrSelf<T>(this IPublishedContent content)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | The content and its ancestors, of the specified content type, in down-top order. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Remarks
May or may not begin with the content itself, depending on its content type.
AncestorsOrSelf<T>(IPublishedContent, Int32)
Gets the content and its ancestor, at a lever lesser or equal to a specified level, and of a specified content type.
Declaration
public static IEnumerable<T> AncestorsOrSelf<T>(this IPublishedContent content, int maxLevel)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Int32 | maxLevel | The level. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | The content and its ancestors, at a level lesser or equal to the specified level, and of the specified content type, in down-top order. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Remarks
May or may not begin with the content itself, depending on its level and content type.
Breadcrumbs(IPublishedContent, Boolean)
Gets the breadcrumbs (ancestors and self, top to bottom) for the specified content
.
Declaration
public static IEnumerable<IPublishedContent> Breadcrumbs(this IPublishedContent content, bool andSelf = true)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Boolean | andSelf | Indicates whether the specified content should be included. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The breadcrumbs (ancestors and self, top to bottom) for the specified |
Breadcrumbs(IPublishedContent, Int32, Boolean)
Gets the breadcrumbs (ancestors and self, top to bottom) for the specified content
at a level higher or equal to minLevel
.
Declaration
public static IEnumerable<IPublishedContent> Breadcrumbs(this IPublishedContent content, int minLevel, bool andSelf = true)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Int32 | minLevel | The minimum level. |
System.Boolean | andSelf | Indicates whether the specified content should be included. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The breadcrumbs (ancestors and self, top to bottom) for the specified |
Breadcrumbs<T>(IPublishedContent, Boolean)
Gets the breadcrumbs (ancestors and self, top to bottom) for the specified content
at a level higher or equal to the specified root content type T
.
Declaration
public static IEnumerable<IPublishedContent> Breadcrumbs<T>(this IPublishedContent content, bool andSelf = true)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Boolean | andSelf | Indicates whether the specified content should be included. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The breadcrumbs (ancestors and self, top to bottom) for the specified |
Type Parameters
Name | Description |
---|---|
T | The root content type. |
Children(IPublishedContent, Func<IPublishedContent, Boolean>, String)
Gets the children of the content, filtered by a predicate.
Declaration
public static IEnumerable<IPublishedContent> Children(this IPublishedContent content, Func<IPublishedContent, bool> predicate, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.Func<IPublishedContent, System.Boolean> | predicate | The predicate. |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The children of the content, filtered by the predicate. |
Remarks
Children are sorted by their sortOrder.
Children<T>(IPublishedContent, String)
Gets the children of the content, of a given content type.
Declaration
public static IEnumerable<T> Children<T>(this IPublishedContent content, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | The children of content, of the given content type. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Remarks
Children are sorted by their sortOrder.
ChildrenAsTable(IPublishedContent, ServiceContext, String, String)
Gets the children of the content in a DataTable.
Declaration
public static DataTable ChildrenAsTable(this IPublishedContent content, ServiceContext services, string contentTypeAliasFilter = "", string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
ServiceContext | services | A service context. |
System.String | contentTypeAliasFilter | An optional content type alias. |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Data.DataTable | The children of the content. |
ChildrenOfType(IPublishedContent, String, String)
Gets the children of the content, of any of the specified types.
Declaration
public static IEnumerable<IPublishedContent> ChildrenOfType(this IPublishedContent content, string contentTypeAlias, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | contentTypeAlias | The content type alias. |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The children of the content, of any of the specified types. |
CreatorName(IPublishedContent, IUserService)
Declaration
public static string CreatorName(this IPublishedContent content, IUserService userService)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
IUserService | userService |
Returns
Type | Description |
---|---|
System.String |
Descendant(IPublishedContent, Int32, String)
Declaration
public static IPublishedContent Descendant(this IPublishedContent content, int level, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Int32 | level | |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent |
Descendant(IPublishedContent, String)
Declaration
public static IPublishedContent Descendant(this IPublishedContent content, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent |
Descendant<T>(IPublishedContent, Int32, String)
Declaration
public static T Descendant<T>(this IPublishedContent content, int level, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Int32 | level | |
System.String | culture |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Descendant<T>(IPublishedContent, String)
Declaration
public static T Descendant<T>(this IPublishedContent content, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
DescendantOfType(IPublishedContent, String, String)
Declaration
public static IPublishedContent DescendantOfType(this IPublishedContent content, string contentTypeAlias, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | contentTypeAlias | |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent |
DescendantOrSelf(IPublishedContent, Int32, String)
Declaration
public static IPublishedContent DescendantOrSelf(this IPublishedContent content, int level, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Int32 | level | |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent |
DescendantOrSelf(IPublishedContent, String)
Declaration
public static IPublishedContent DescendantOrSelf(this IPublishedContent content, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent |
DescendantOrSelf<T>(IPublishedContent, Int32, String)
Declaration
public static T DescendantOrSelf<T>(this IPublishedContent content, int level, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Int32 | level | |
System.String | culture |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
DescendantOrSelf<T>(IPublishedContent, String)
Declaration
public static T DescendantOrSelf<T>(this IPublishedContent content, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
DescendantOrSelfOfType(IPublishedContent, String, String)
Declaration
public static IPublishedContent DescendantOrSelfOfType(this IPublishedContent content, string contentTypeAlias, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | contentTypeAlias | |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent |
Descendants(IPublishedContent, Int32, String)
Declaration
public static IEnumerable<IPublishedContent> Descendants(this IPublishedContent content, int level, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Int32 | level | |
System.String | culture |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> |
Descendants(IPublishedContent, String)
Declaration
public static IEnumerable<IPublishedContent> Descendants(this IPublishedContent content, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> |
Descendants<T>(IPublishedContent, Int32, String)
Declaration
public static IEnumerable<T> Descendants<T>(this IPublishedContent content, int level, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Int32 | level | |
System.String | culture |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> |
Type Parameters
Name | Description |
---|---|
T |
Descendants<T>(IPublishedContent, String)
Declaration
public static IEnumerable<T> Descendants<T>(this IPublishedContent content, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> |
Type Parameters
Name | Description |
---|---|
T |
DescendantsOfType(IPublishedContent, String, String)
Declaration
public static IEnumerable<IPublishedContent> DescendantsOfType(this IPublishedContent content, string contentTypeAlias, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | contentTypeAlias | |
System.String | culture |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> |
DescendantsOrSelf(IPublishedContent, Int32, String)
Declaration
public static IEnumerable<IPublishedContent> DescendantsOrSelf(this IPublishedContent content, int level, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Int32 | level | |
System.String | culture |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> |
DescendantsOrSelf(IPublishedContent, String)
Declaration
public static IEnumerable<IPublishedContent> DescendantsOrSelf(this IPublishedContent content, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> |
DescendantsOrSelf<T>(IEnumerable<IPublishedContent>, String)
Returns all DescendantsOrSelf of all content referenced
Declaration
public static IEnumerable<T> DescendantsOrSelf<T>(this IEnumerable<IPublishedContent> parentNodes, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | parentNodes | |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> |
Type Parameters
Name | Description |
---|---|
T |
Remarks
This can be useful in order to return all nodes in an entire site by a type when combined with ContentAtRoot() or similar.
DescendantsOrSelf<T>(IPublishedContent, Int32, String)
Declaration
public static IEnumerable<T> DescendantsOrSelf<T>(this IPublishedContent content, int level, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Int32 | level | |
System.String | culture |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> |
Type Parameters
Name | Description |
---|---|
T |
DescendantsOrSelf<T>(IPublishedContent, String)
Declaration
public static IEnumerable<T> DescendantsOrSelf<T>(this IPublishedContent content, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> |
Type Parameters
Name | Description |
---|---|
T |
DescendantsOrSelfOfType(IEnumerable<IPublishedContent>, String, String)
Returns all DescendantsOrSelf of all content referenced
Declaration
public static IEnumerable<IPublishedContent> DescendantsOrSelfOfType(this IEnumerable<IPublishedContent> parentNodes, string docTypeAlias, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | parentNodes | |
System.String | docTypeAlias | |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> |
Remarks
This can be useful in order to return all nodes in an entire site by a type when combined with ContentAtRoot() or similar.
DescendantsOrSelfOfType(IPublishedContent, String, String)
Declaration
public static IEnumerable<IPublishedContent> DescendantsOrSelfOfType(this IPublishedContent content, string contentTypeAlias, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | contentTypeAlias | |
System.String | culture |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> |
FirstChild(IPublishedContent, Func<IPublishedContent, Boolean>, String)
Declaration
public static IPublishedContent FirstChild(this IPublishedContent content, Func<IPublishedContent, bool> predicate, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Func<IPublishedContent, System.Boolean> | predicate | |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent |
FirstChild(IPublishedContent, Guid, String)
Declaration
public static IPublishedContent FirstChild(this IPublishedContent content, Guid uniqueId, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Guid | uniqueId | |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent |
FirstChild(IPublishedContent, String)
Declaration
public static IPublishedContent FirstChild(this IPublishedContent content, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent |
FirstChild<T>(IPublishedContent, Func<T, Boolean>, String)
Declaration
public static T FirstChild<T>(this IPublishedContent content, Func<T, bool> predicate, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Func<T, System.Boolean> | predicate | |
System.String | culture |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
FirstChild<T>(IPublishedContent, String)
Declaration
public static T FirstChild<T>(this IPublishedContent content, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
FirstChildOfType(IPublishedContent, String, String)
Gets the first child of the content, of a given content type.
Declaration
public static IPublishedContent FirstChildOfType(this IPublishedContent content, string contentTypeAlias, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | contentTypeAlias | |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent |
GetCultureFromDomains(IPublishedContent, Uri)
Gets the culture assigned to a document by domains, in the context of a current Uri.
Declaration
public static string GetCultureFromDomains(this IPublishedContent content, Uri current = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The document. |
System.Uri | current | An optional current Uri. |
Returns
Type | Description |
---|---|
System.String | The culture assigned to the document by domains. |
Remarks
In 1:1 multilingual setup, a document contains several cultures (there is not one document per culture), and domains, withing the context of a current Uri, assign a culture to that document.
GetTemplateAlias(IPublishedContent)
Returns the current template Alias
Declaration
public static string GetTemplateAlias(this IPublishedContent content)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content |
Returns
Type | Description |
---|---|
System.String | Empty string if none is set. |
HasValue(IPublishedContent, String, String, String, Fallback)
Gets a value indicating whether the content has a value for a property identified by its alias.
Declaration
public static bool HasValue(this IPublishedContent content, string alias, string culture = null, string segment = null, Fallback fallback = default(Fallback))
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | alias | The property alias. |
System.String | culture | The variation language. |
System.String | segment | The variation segment. |
Fallback | fallback | Optional fallback strategy. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the content has a value for the property identified by the alias. |
Remarks
Returns true if HasValue is true, or a fallback strategy can provide a value.
IsAllowedTemplate(IPublishedContent, Int32)
Declaration
public static bool IsAllowedTemplate(this IPublishedContent content, int templateId)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.Int32 | templateId |
Returns
Type | Description |
---|---|
System.Boolean |
IsAllowedTemplate(IPublishedContent, String)
Declaration
public static bool IsAllowedTemplate(this IPublishedContent content, string templateAlias)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | templateAlias |
Returns
Type | Description |
---|---|
System.Boolean |
IsAncestor(IPublishedContent, IPublishedContent)
Declaration
public static bool IsAncestor(this IPublishedContent content, IPublishedContent other)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
IPublishedContent | other |
Returns
Type | Description |
---|---|
System.Boolean |
IsAncestor(IPublishedContent, IPublishedContent, String)
If the specified content
is an ancestor of other
, the HTML encoded valueIfTrue
will be returned; otherwise, System.String.Empty.
Declaration
public static HtmlString IsAncestor(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsAncestor(IPublishedContent, IPublishedContent, String, String)
If the specified content
is an ancestor of other
, the HTML encoded valueIfTrue
will be returned; otherwise, valueIfFalse
.
Declaration
public static HtmlString IsAncestor(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
System.String | valueIfFalse | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsAncestorOrSelf(IPublishedContent, IPublishedContent)
Declaration
public static bool IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
IPublishedContent | other |
Returns
Type | Description |
---|---|
System.Boolean |
IsAncestorOrSelf(IPublishedContent, IPublishedContent, String)
If the specified content
is an ancestor of other
or are the same, the HTML encoded valueIfTrue
will be returned; otherwise, System.String.Empty.
Declaration
public static HtmlString IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsAncestorOrSelf(IPublishedContent, IPublishedContent, String, String)
If the specified content
is an ancestor of other
or are the same, the HTML encoded valueIfTrue
will be returned; otherwise, valueIfFalse
.
Declaration
public static HtmlString IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
System.String | valueIfFalse | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsComposedOf(IPublishedContent, String)
Gets a value indicating whether the content is of a content type composed of the given alias
Declaration
public static bool IsComposedOf(this IPublishedContent content, string alias)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | alias | The content type alias. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the content is of a content type composed of a content type identified by the alias. |
IsDescendant(IPublishedContent, IPublishedContent)
Declaration
public static bool IsDescendant(this IPublishedContent content, IPublishedContent other)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
IPublishedContent | other |
Returns
Type | Description |
---|---|
System.Boolean |
IsDescendant(IPublishedContent, IPublishedContent, String)
If the specified content
is a decendant of other
, the HTML encoded valueIfTrue
will be returned; otherwise, System.String.Empty.
Declaration
public static HtmlString IsDescendant(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsDescendant(IPublishedContent, IPublishedContent, String, String)
If the specified content
is a decendant of other
, the HTML encoded valueIfTrue
will be returned; otherwise, valueIfFalse
.
Declaration
public static HtmlString IsDescendant(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
System.String | valueIfFalse | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsDescendantOrSelf(IPublishedContent, IPublishedContent)
Declaration
public static bool IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
IPublishedContent | other |
Returns
Type | Description |
---|---|
System.Boolean |
IsDescendantOrSelf(IPublishedContent, IPublishedContent, String)
If the specified content
is a decendant of other
or are the same, the HTML encoded valueIfTrue
will be returned; otherwise, System.String.Empty.
Declaration
public static HtmlString IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsDescendantOrSelf(IPublishedContent, IPublishedContent, String, String)
If the specified content
is a decendant of other
or are the same, the HTML encoded valueIfTrue
will be returned; otherwise, valueIfFalse
.
Declaration
public static HtmlString IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
System.String | valueIfFalse | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsDocumentType(IPublishedContent, String)
Determines whether the specified content is a specified content type.
Declaration
public static bool IsDocumentType(this IPublishedContent content, string docTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content to determine content type of. |
System.String | docTypeAlias | The alias of the content type to test against. |
Returns
Type | Description |
---|---|
System.Boolean | True if the content is of the specified content type; otherwise false. |
IsDocumentType(IPublishedContent, String, Boolean)
Determines whether the specified content is a specified content type or it's derived types.
Declaration
public static bool IsDocumentType(this IPublishedContent content, string docTypeAlias, bool recursive)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content to determine content type of. |
System.String | docTypeAlias | The alias of the content type to test against. |
System.Boolean | recursive | When true, recurses up the content type tree to check inheritance; when false just calls IsDocumentType(this IPublishedContent content, string docTypeAlias). |
Returns
Type | Description |
---|---|
System.Boolean | True if the content is of the specified content type or a derived content type; otherwise false. |
IsEqual(IPublishedContent, IPublishedContent)
Declaration
public static bool IsEqual(this IPublishedContent content, IPublishedContent other)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
IPublishedContent | other |
Returns
Type | Description |
---|---|
System.Boolean |
IsEqual(IPublishedContent, IPublishedContent, String)
If the specified content
is equal to other
, the HTML encoded valueIfTrue
will be returned; otherwise, System.String.Empty.
Declaration
public static HtmlString IsEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsEqual(IPublishedContent, IPublishedContent, String, String)
If the specified content
is equal to other
, the HTML encoded valueIfTrue
will be returned; otherwise, valueIfFalse
.
Declaration
public static HtmlString IsEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
System.String | valueIfFalse | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsNotEqual(IPublishedContent, IPublishedContent)
If the specified content
is not equal to other
, the HTML encoded valueIfTrue
will be returned; otherwise, valueIfFalse
.
Declaration
public static bool IsNotEqual(this IPublishedContent content, IPublishedContent other)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
Returns
Type | Description |
---|---|
System.Boolean | The HTML encoded value. |
IsNotEqual(IPublishedContent, IPublishedContent, String)
If the specified content
is not equal to other
, the HTML encoded valueIfTrue
will be returned; otherwise, System.String.Empty.
Declaration
public static HtmlString IsNotEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
IsNotEqual(IPublishedContent, IPublishedContent, String, String)
If the specified content
is not equal to other
, the HTML encoded valueIfTrue
will be returned; otherwise, valueIfFalse
.
Declaration
public static HtmlString IsNotEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
IPublishedContent | other | The other content. |
System.String | valueIfTrue | The value if |
System.String | valueIfFalse | The value if |
Returns
Type | Description |
---|---|
System.Web.HtmlString | The HTML encoded value. |
Parent<T>(IPublishedContent)
Gets the parent of the content, of a given content type.
Declaration
public static T Parent<T>(this IPublishedContent content)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
T | The parent of content, of the given content type, else null. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Root(IPublishedContent)
Gets the root content (ancestor or self at level 1) for the specified content
.
Declaration
public static IPublishedContent Root(this IPublishedContent content)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
IPublishedContent | The root content (ancestor or self at level 1) for the specified |
Remarks
This is the same as calling AncestorOrSelf(IPublishedContent, Int32) with maxLevel
set to 1.
Root<T>(IPublishedContent)
Gets the root content (ancestor or self at level 1) for the specified content
if it's of the specified content type T
.
Declaration
public static T Root<T>(this IPublishedContent content)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
Returns
Type | Description |
---|---|
T | The root content (ancestor or self at level 1) for the specified |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Remarks
This is the same as calling AncestorOrSelf<T>(IPublishedContent, Int32) with maxLevel
set to 1.
SearchChildren(IPublishedContent, String, String)
Declaration
public static IEnumerable<PublishedSearchResult> SearchChildren(this IPublishedContent content, string term, string indexName = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | term | |
System.String | indexName |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PublishedSearchResult> |
SearchDescendants(IPublishedContent, String, String)
Declaration
public static IEnumerable<PublishedSearchResult> SearchDescendants(this IPublishedContent content, string term, string indexName = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | term | |
System.String | indexName |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PublishedSearchResult> |
Siblings(IPublishedContent, String)
Gets the siblings of the content.
Declaration
public static IEnumerable<IPublishedContent> Siblings(this IPublishedContent content, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The siblings of the content. |
Remarks
Note that in V7 this method also return the content node self.
Siblings<T>(IPublishedContent, String)
Gets the siblings of the content, of a given content type.
Declaration
public static IEnumerable<T> Siblings<T>(this IPublishedContent content, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | The siblings of the content, of the given content type. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
Remarks
Note that in V7 this method also return the content node self.
SiblingsAndSelf(IPublishedContent, String)
Gets the siblings of the content including the node itself to indicate the position.
Declaration
public static IEnumerable<IPublishedContent> SiblingsAndSelf(this IPublishedContent content, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The siblings of the content including the node itself. |
SiblingsAndSelf<T>(IPublishedContent, String)
Gets the siblings of the content including the node itself to indicate the position, of a given content type.
Declaration
public static IEnumerable<T> SiblingsAndSelf<T>(this IPublishedContent content, string culture = null)
where T : class, IPublishedContent
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | The siblings of the content including the node itself, of the given content type. |
Type Parameters
Name | Description |
---|---|
T | The content type. |
SiblingsAndSelfOfType(IPublishedContent, String, String)
Gets the siblings of the content including the node itself to indicate the position, of a given content type.
Declaration
public static IEnumerable<IPublishedContent> SiblingsAndSelfOfType(this IPublishedContent content, string contentTypeAlias, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | contentTypeAlias | The content type alias. |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The siblings of the content including the node itself, of the given content type. |
SiblingsOfType(IPublishedContent, String, String)
Gets the siblings of the content, of a given content type.
Declaration
public static IEnumerable<IPublishedContent> SiblingsOfType(this IPublishedContent content, string contentTypeAlias, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | contentTypeAlias | The content type alias. |
System.String | culture | The specific culture to filter for. If null is used the current culture is used. (Default is null) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The siblings of the content, of the given content type. |
Remarks
Note that in V7 this method also return the content node self.
Url(IPublishedContent, String, UrlMode)
Gets the URL of the content item.
Declaration
public static string Url(this IPublishedContent content, string culture = null, UrlMode mode = UrlMode.Default)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
System.String | culture | |
UrlMode | mode |
Returns
Type | Description |
---|---|
System.String |
Remarks
If the content item is a document, then this method returns the URL of the document. If it is a media, then this methods return the media URL for the 'umbracoFile' property. Use the MediaUrl() method to get the media URL for other properties.
The value of this property is contextual. It depends on the 'current' request uri, if any. In addition, when the content type is multi-lingual, this is the URL for the specified culture. Otherwise, it is the invariant URL.
Value(IPublishedContent, String, String, String, Fallback, Object)
Gets the value of a content's property identified by its alias, if it exists, otherwise a default value.
Declaration
public static object Value(this IPublishedContent content, string alias, string culture = null, string segment = null, Fallback fallback = default(Fallback), object defaultValue = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | alias | The property alias. |
System.String | culture | The variation language. |
System.String | segment | The variation segment. |
Fallback | fallback | Optional fallback strategy. |
System.Object | defaultValue | The default value. |
Returns
Type | Description |
---|---|
System.Object | The value of the content's property identified by the alias, if it exists, otherwise a default value. |
Value<T>(IPublishedContent, String, String, String, Fallback, T)
Gets the value of a content's property identified by its alias, converted to a specified type.
Declaration
public static T Value<T>(this IPublishedContent content, string alias, string culture = null, string segment = null, Fallback fallback = default(Fallback), T defaultValue = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | The content. |
System.String | alias | The property alias. |
System.String | culture | The variation language. |
System.String | segment | The variation segment. |
Fallback | fallback | Optional fallback strategy. |
T | defaultValue | The default value. |
Returns
Type | Description |
---|---|
T | The value of the content's property identified by the alias, converted to the specified type. |
Type Parameters
Name | Description |
---|---|
T | The target property type. |
WriterName(IPublishedContent, IUserService)
Declaration
public static string WriterName(this IPublishedContent content, IUserService userService)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | |
IUserService | userService |
Returns
Type | Description |
---|---|
System.String |